Need to zoom without scaling tiles

Topics: SharpMap v0.9 / v1.x
May 8, 2012 at 3:08 PM

I'm using SharpMap to build a static image map which contains a couple of layers (fed from a tile server) and a collection of markers.  To set the position and zoom level of my map I'm currently taking my map points, calculating a center point and bounding box, and then applying these to the map using the map.Center property and map.ZoomToBox method.

This works but has an unfortunate side effect.  One of my tile layers includes text.  That text is being distorted when the layer is zoomed to the correct size to fit my bounding box.  Is there a way to perform the zoom so that it will not rescale the tile layers underneath?  I'd rather have some extra space beyond my map points (as you see when zooming using Google Maps or OpenLayers) than have the distortion in my finished product.


May 9, 2012 at 2:43 AM


Google maps using multiple levels of 0 to 22. when the map zoom to any level of the level, the image is updated without having to scale from the previous image.

You must create multiple level tiles for your tilte server.



May 9, 2012 at 7:22 AM

If your using MapBox:
In order to not rescale your tiles you need to snap the zoome level to your resolutions that you have created tiles for,

You can do that by listen to the MapZoomChanged Event and here change the Zoom property to one of your generated resolutions..

May 14, 2012 at 6:40 PM

petlof, is this event unique to SharpMap 2.0?  With 0.9, I'm not seeing any event named "MapZoomChanged' or "ZoomChanged".

trieuvy, I'm not generating my own tiles.  I'm reading tiles from an existing tile server.  The problem is that SharpMap is zooming to make a perfect fit of the bounds box which messes up text on the tiles.