This project is read-only.

Support for OpenStreetMap

Dec 24, 2009 at 9:52 AM

Hi,

Is it possible to open support for openstreetmap instead of the normal map?

it's quite easy using the original google maps api, like this:

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

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

 

Thanks.