My Winforms map has a raster layer and an in-memory feature layer. My MinimumScale is set to 100. However, using the mouse wheel I cannot zoom any lower than 1126.46444320679. Do I need to do anything else so I can zoom in to the 100 scale?
Thanks!
My Winforms map has a raster layer and an in-memory feature layer. My MinimumScale is set to 100. However, using the mouse wheel I cannot zoom any lower than 1126.46444320679. Do I need to do anything else so I can zoom in to the 100 scale?
Thanks!
Gregory,
The hidden logic for this is that the default map snapping mode is snapped, which saying the scale must be among those 20 pre-defined scales.
Just have a try setting different snapping mode for Map Control:
winformsMap1.ZoomLevelSnapping = ZoomLevelSnappingMode.None;
Any more questions just feel free to let me know.
Thanks.
Yale
Greg,
I would advise not do go with Yale’s suggestion. (No offense Yale!) What you can do is adjust the scales in the Zoom Level sets. I would try to hold onto snapping as if you want tiling at all it is the best bet. Even if you don’t think you want tiling now you may want to reserve the option. What you can do is on the ZoomLevelSet of the map itself you can change the scales. I suggest you think about this before you go all out changing scales around. Changing the bottom scales isn’t a big deal but changing all the scales would be. The thing to consider is that you may need to sync this scale change with all of your layers which also use zoom levels. You can create your own ZoomLevel object if you want a custom one and simple set it on the layers and the map for a consistent view. If you just change the 20th one you could get away with not changing anything else as the drawing will be the same form zoom level 20 even if it is a little lower than before. If you need a custom ZoomLevel I can show you that, we have examples as well like GoogleZoomLevelSet and some others where the scales are wired to match those maps.
Example:
winformsMap1.ZoomLevelSet.ZoomLevel20.Scale =
David
David, I’ll definitely give your approach a try. This present application is using GdiPlusRasterLayer and is not tiling, but my “other” application does tile, so I fully appreciate the implicatioons of snapping to the zoom level!
Gregory,
Sorry for my misunderstanding and misguiding, I agree that David’s solution should be better when tile cached is needed.
Any more questions just feel free to let me know.
Thanks.
Yale