google maps background

7/24/2014 5:26:09 AM
Total Posts 33

google maps background

how to add / remove / change parameter in url background layer for ex:

from :

http://mt1.googleapis.com/vt?lyrs=m@270174904&src=apiv3&hl=en-US&x=3263&y=2118&z=12&style=47,37%7Csmartmaps

 

to :

http://mt1.googleapis.com/vt?lyrs=m@270174904,traffic&src=apiv3&hl=en-US&x=3263&y=2118&z=12&style=47,37%7Csmartmaps

 

thanks

 

7/24/2014 6:30:07 AM
MVP
Total Posts 323

Re: google maps background

The urls are generated by the Google Maps API, you cannot change them directly.

Call the get_backgroundLayerMapObject() property of the AspMap's JavaScript Map control, it will return the Google Maps Map object.

7/24/2014 8:16:00 AM
Total Posts 33

Re: google maps background

can you please write sample method for get_backgroundLayerMapObject() ? 

or can i put backgorund layer like in the url :

https://developers.google.com/maps/documentation/javascript/examples/layer-traffic

 

thanks

 

 

7/24/2014 9:31:21 AM
MVP
Total Posts 323

Re: google maps background

Add the following code after the </form> tag:

<script>

$addHandler(window, "load", initBackgroundLayer);

function initBackgroundLayer()

{

        map = AspMap.getMap('<%=map.ClientID%>');

        googleMap = map.get_backgroundLayerMapObject();

        trafficLayer = new google.maps.TrafficLayer();

        trafficLayer.setMap(googleMap);

}

</script>

7/24/2014 1:15:40 PM
Total Posts 33

Re: google maps background

wow... amazing. :) thank you very much it is verry helpfull