This project is read-only.

Layer is hazy when loaded through code

Nov 1, 2010 at 6:17 PM


I am building an application using the Dot Spatial libraries. I need to have a base map in the application and this layer should be loaded as soon as the application is initialized. So I am adding a jpg image of base layer, but the image looks hazy. When someone clicks on the map then the map extents are adjusted and the image shows up the way it should. This also happend when you load a vector through code.

Is there something I can do after I load the layer so that it doesn't look hazy.

Thank you,


Nov 1, 2010 at 7:14 PM
I have heard this mentioned before. Please post it as an issue if there is not one there for this already. It may already be posted though, so don't duplicate it if it is. I believe we eventually found a solution for this for Hydrodesktop by using some combination of MapFrame.ResetExtents followed by a MapFrame.Invalidate or the like. It has to do with the buffer being the wrong size as compared to the map. The buffer is on the MapFrame. However, we would ideally not have the fuzzy version and should add in a check somewhere where there is not currently a check ;). Does the image look hazy if you open it as a data format in the TestViewer? If not, then there is definitely a clue to be found there and maybe tracking through the open file code could help us figure out what is different from when you are adding the layer programmatically.


Nov 1, 2010 at 8:12 PM


Thanks for getting back to me.

When the layer is added using the "Add Data" button it works fine. I have this problem only when I load it through code. I will post it as an issue.



Nov 5, 2010 at 9:22 PM


I also have a problem when loading images. Actually I have two resolutions for the same geotiff map that I use as the background in my application. Smaller geotiff loads fine (clear, sharp) while the larger one is blurry when loaded. I guess this might be in corelation with the problem you've mentioned.