VDS Technologies

 

google and virtualearth put together

11/11/2013 6:20:16 AM
Total Posts 33

google and virtualearth put together

dear,

how to put together between google and vitualearth in aspmap app,

so user can choose for background layer google or background layer virtualearth

i have test in codebehind : default background layer is "GoogleMapType.Normal"

Dim gml As GoogleMapsLayer
Dim ve As VirtualEarthLayer

If optnormal.Checked = True Then
gml = New GoogleMapsLayer(mapClass.apiGGL(), GoogleMapType.Normal)
map1.BackgroundLayer = gml
ElseIf optsat.Checked = True Then
gml = New GoogleMapsLayer(mapClass.apiGGL(), GoogleMapType.Satellite)
map1.BackgroundLayer = gml
ElseIf opthybrid.Checked = True Then
gml = New GoogleMapsLayer(mapClass.apiGGL(), GoogleMapType.Hybrid)
map1.BackgroundLayer = gml
ElseIf optveroad.Checked = True Then
ve = New VirtualEarthLayer(VirtualEarthMapType.Road)
map1.BackgroundLayer = ve

ElseIf optveaerial.Checked = True Then
ve = New VirtualEarthLayer(VirtualEarthMapType.Aerial)
map1.BackgroundLayer = ve

ElseIf optvelabels.Checked = True Then
ve = New VirtualEarthLayer(VirtualEarthMapType.Hybrid)
map1.BackgroundLayer = ve

End If

 

when i choose background layer virtual earth, unfortunately the coordinate layer changes aoutomatically

please help, there is a way to put together between google and virtual earth?

 

many thanks

 

11/11/2013 6:52:13 AM
MVP
Total Posts 323

Re: google and virtualearth put together

Different background layers use different sets of scripts. Once a background layer has been initialized for the first time on the client side, there is no way to change it on the server side without refreshing the page.

Thereby, the controls (check boxes, buttons) you are using to switch between background layers must perform a full postback, they should not be registered as triggers for UpdatePanels.

11/11/2013 7:07:21 AM
Total Posts 33

Re: google and virtualearth put together

oh i see,

thanks a lot it's very helpful

 

 

 

1/9/2015 10:34:36 AM
Total Posts 11

Re: google and virtualearth put together

Is the same answer if we join google and without google together???

regards..

Bahar

1/9/2015 3:10:27 PM
MVP
Total Posts 323

Re: google and virtualearth put together

You may set the Map.BackgroundLayer property to turn the Google layer on/off.
The background layer should be added anyway on the server side, to keep the coordinate system.