Google displays satellite

I am using google maps API with openstreetmap (see the following sample code)

I would like to add a google view for satellites .

How can I do that?

var tilesMapnik = new GTileLayer(copyOSM, 1, 17, {tileUrlTemplate: 'http://tile.openstreetmap.org/{Z}/{X}/{Y}.png'}); var mapMapnik = new GMapType([tilesMapnik],G_NORMAL_MAP.getProjection(), "รฎรดรค"); map = new GMap2(document.getElementById("map_canvas"), { mapTypes: [mapMapnik] }); map.setCenter(new GLatLng(32.08, 34.82), 12); map.addControl(new GLargeMapControl()); map.addControl(new GMapTypeControl()); 

Explanation of using openstreetmap with google maps:

http://wiki.openstreetmap.org/wiki/Google_Maps_Example

+1
source share
2 answers

If you just want to add the satellite to your Google map, try the following:

 map = new GMap2(document.getElementById("map_canvas"), { mapTypes: [mapMapnik, G_SATELLITE_MAP] }); 

Alternatively, you can also use this:

 map.addMapType(G_SATELLITE_MAP); 
+5
source

I think he wants to add 2 tabs, one of them - openStreetMapData and seconf - google satellite data

like on this site.

http://www.shvoongmap.co.il/

the first tab on the map, written in Hebrew, is openStreetMap data and the rest, written in English, is Google data.

+1
source

Source: https://habr.com/ru/post/1381310/


All Articles