Marker positions not refreshing properly

May 21, 2009 at 3:23 AM

My app loads a map and then creates ~100 GMapMarkers on an overlay and adds them to the map ...

 

sales = New GMapOverlay(MainMap, "sales")

... Start loop

PointLatLng = CType(GMaps.Instance.GetLatLngFromGeocoder("Somewhere in Australia ..."), PointLatLng)

Dim GMapMarker As New GMapMarkerGoogleGreen(PointLatLng)

sales.Markers.Add(GMapMarker)

... Loop

MainMap.Overlays.Add(sales)

MainMap.ReloadMap()

 

The problem is that when I do the Overlays.Add only 2 or 3 markers show up. If I right click and drag the map a little, suddenly those 2 or 3 markers will disappear and the entire set of markers I've created appear on the map.

I also have another button that then .Remove and .Adds a sets of overlays. Once you've moved a map once for an overlay, that overlay will show the correct results and continue, no matter how many times you add or remove it. However the other overlays will show wrongly until you click and drag the map for each of them.

Does anyone know why this is happening?

 

May 21, 2009 at 3:24 AM

I found the problem ... you must call .GotoCurrentPosition even if you do a RefreshMap. Why is a missing .GotoCurrentPosition always causing these problems?

Coordinator
May 21, 2009 at 1:12 PM

noo need to reload map at all, just first time