Picture Maps for Openstreetmaps (OSM) and Google Maps (Satellite View)

Are Openstreetmap tiles (OSM) compatible with Google Maps tiles (satellite view)? By compatibility, I mean - is it possible to use code / logic written to read OSM tiles to load tiles from Google maps?

Can someone point out good resources that can explain more on this topic.

+3
source share
1 answer

If by compatibility you mean "is there an equal tile covering the same area for a certain zoom level", then yes, OpenStreetMap tiles are compatible with Google Maps and even Bing Maps.

OSM API Google, , :

var copyOSM = new GCopyrightCollection("<a href=\"http://www.openstreetmap.org/\">OpenStreetMap</a>");
copyOSM.addCopyright(new GCopyright(1, new GLatLngBounds(new GLatLng(-90,-180), new GLatLng(90,180)), 0, " "));

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(), "Mapnik");

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

map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
+5

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


All Articles