Reinitialize GMapControl

Sep 29, 2010 at 9:36 AM

Hi! Is it possible to reinitialize the GMapControl of WindowsPresentation to its initial state?

I got a situation wherein my client wants to switch on/off layers of the map. I've solved this already, but I have to zoom in/out first so that i can see the result.. also, the initial view of the map (all layers are intact) is still there..

i've tried the ReloadMap() and InvalidateVisual() but it didn't work..

so is there a way to reinitialize the Gmapcontrol? so that it will initially load the layers that my client switches on..

Sep 29, 2010 at 9:57 AM

you mean, when you reset coordinates of markers when they are invisible and then later make them visible and they appears in the old/wrong location?

Sep 29, 2010 at 12:18 PM

no, not the markers.. u know mapserver right? wherein in the url u specify layers.. my request is something like this


this is not the full url but i hope u'll get my point, i want to dynamically change the layers in the url and i've done it already. my problem is that i don't know how to refresh the mapcontrol so that it loads a map that now has layers=road,roads2 only for example.

Sep 29, 2010 at 12:57 PM

you can use different map types, change url behind, using the same maptype is not very great ;}

Sep 29, 2010 at 1:02 PM

i see! thanks radioman! haven't thought of that. you're awesome! ^_^