Наконец добавлен слой OSM!
This commit is contained in:
parent
3ddd763a7a
commit
8349d3a23f
|
|
@ -23,17 +23,32 @@ function getURLParameter(name) {
|
||||||
* @returns true
|
* @returns true
|
||||||
*/
|
*/
|
||||||
function init() {
|
function init() {
|
||||||
|
myLayer = function () {
|
||||||
|
return new ymaps.Layer(
|
||||||
|
'http://otile1.mqcdn.com/tiles/1.0.0/osm/%z/%x/%y.png', {projection: ymaps.projection.sphericalMercator});
|
||||||
|
};
|
||||||
|
|
||||||
|
ymaps.layer.storage.add('my#layer', myLayer);
|
||||||
|
ymaps.mapType.storage.add('my#type', new ymaps.MapType('OpenStreetMap', ['my#layer']));
|
||||||
|
|
||||||
myMap = new ymaps.Map("map", {
|
myMap = new ymaps.Map("map", {
|
||||||
center: [ymaps.geolocation.latitude, ymaps.geolocation.longitude],
|
center: [ymaps.geolocation.latitude, ymaps.geolocation.longitude],
|
||||||
zoom: 12,
|
zoom: 12,
|
||||||
|
type:'my#type',
|
||||||
behaviors: ['default', 'scrollZoom']
|
behaviors: ['default', 'scrollZoom']
|
||||||
});
|
});
|
||||||
|
|
||||||
myMap.controls.add('mapTools');
|
myMap.controls.add('mapTools');
|
||||||
myMap.controls.add('typeSelector');
|
|
||||||
myMap.controls.add('smallZoomControl');
|
myMap.controls.add('smallZoomControl');
|
||||||
myMap.controls.add('scaleLine');
|
myMap.controls.add('scaleLine');
|
||||||
|
|
||||||
|
typeSelector = new ymaps.control.TypeSelector();
|
||||||
|
typeSelector.addMapType('my#type', 0);
|
||||||
|
typeSelector.addMapType('yandex#publicMap', 1);
|
||||||
|
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>');
|
||||||
|
|
||||||
initCategories()
|
initCategories()
|
||||||
getPoints();
|
getPoints();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue