VDS Technologies


Map losing zoom level when panning and zooming

11/6/2012 9:35:01 AM
Total Posts 1

Map losing zoom level when panning and zooming


I am using aspmap 4.3. I have a map on which i am drawing a circle with a label like so:

'Set centre and zoom for map

Map1.MapScale = Map1.ToScale("20K")

Map1.CenterAt(New AspMap.Point(gf.CentreLon, gf.CentreLat))

'Draw shape

shp = NewAspMap.Shape()

shp.MakeCircle(gf.CentreLon, gf.CentreLat, Map1.ConvertDistance(gf.Radius, MeasureUnit.Meter, Map1.MapUnit))


Dim ms As MapShape = Map1.MapShapes.Add(shp, gf.GeofenceName)ms.Font.Outline =

Truems.Font.OutlineColor = Drawing.Color.White

ms.Font.Name =

"Arial"ms.Font.Size = 30

ms.Symbol.LineColor = Drawing.Color.Blue

ms.Symbol.FillStyle = FillStyle.Invisible

ms.Symbol.Size = 2


When the user pans or zooms on the map using the ZoomBar tool the map does not pan or zoom properly.

If the user clicks the level bars of the zoombar then the zoom works ok. However if they click the plus or minus buttons the zoom fails. If they click the minus button the map goes to zoom level 0 in the zoom levels collection and if they click the plus button the map goes to zoom level 1. This happens regardless of what map was previously at. If the user tries to pan the map, the zoom on the map also resets to zoom level 0.

If i remove the shape from the map the map pans and zooms fine.

I have tried drawing the shape both before and after i set the map centre and zoom level but the end result is the same. I have also tried clearing the map shapes from the maps in the HotspotClick event but this makes no difference either

thanks for your help

11/6/2012 9:48:16 AM
Total Posts 323

Re: Map losing zoom level when panning and zooming

Please post the entire code with the Page_ events.