Добавлены тайлы от Google Maps - крутяк))

This commit is contained in:
Krivchikov Dmitry 2014-06-06 00:09:14 +04:00
parent 9ab2eff6e7
commit da75abb383
1 changed files with 8 additions and 1 deletions

View File

@ -37,6 +37,12 @@ function init() {
ymaps.layer.storage.add('osm#layer', osmLayer);
ymaps.mapType.storage.add('osm#type', new ymaps.MapType('OpenStreetMap', ['osm#layer']));
googleLayer = function () {
return new ymaps.Layer('http://mt0.google.com/vt/lyrs=m@176000000&hl=ru&%c', {projection: ymaps.projection.sphericalMercator,tileTransparent: true});
}
ymaps.layer.storage.add('google#layer', googleLayer);
ymaps.mapType.storage.add('google#type', new ymaps.MapType('Google Maps', ['google#layer']));
myMap = new ymaps.Map("map", {
center: [ymaps.geolocation.latitude, ymaps.geolocation.longitude],
zoom: 12,
@ -50,8 +56,9 @@ function init() {
typeSelector = new ymaps.control.TypeSelector();
typeSelector.addMapType('quest#type', 0);
typeSelector.addMapType('osm#type', 1);
typeSelector.addMapType('google#type', 1);
typeSelector.addMapType('yandex#publicMap', 2);
typeSelector.addMapType('osm#type', 3);
myMap.controls.add(typeSelector);
myMap.copyrights.add('Участники <a href="http://www.openstreetmap.org/copyright" target="blank">OpenStreetMap</a>');
myMap.copyrights.add('Tiles courtesy of <a href="http://www.mapquest.com/" target="blank">MapQuest</a>');