shramov / leaflet-plugins

Plugins for Leaflet library
http://psha.org.ru/b/leaflet-plugins.html
MIT License
722 stars 289 forks source link

Markers on Yandexmap #26

Closed ghost closed 12 years ago

ghost commented 12 years ago

При добавлении маркера на карту, маркер отображается только на OSM. На карте Yandex маркер не виден.

    var map = L.map('map').setView([57,1], 13);
    var osm = new L.TileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png');

    var layerdefs = {
        ysat: { name: "Yandex", js: ["/scripts/tile/Yandex.js", "http://api-maps.yandex.ru/2.0/?load=package.map&lang=ru-RU"],
            init: function() {return new L.Yandex("satellite"); }},
    };

    var yndx = new L.DeferredLayer(layerdefs.ysat);
    map.addLayer(osm);
    map.addControl(new L.Control.Layers({'OSM':osm,  "Y":yndx},
                        {}));

    L.marker([57,1]).addTo(map)
        .bindPopup("<b>Hello world!</b><br />I am a popup.").openPopup();
nashby commented 12 years ago

@radxbook looks like it's a bug with latest leaflet. You can fix by adding z-index to .leaflet-map-pane:

.leaflet-map-pane {
  z-index: 1000;
}
ghost commented 12 years ago

thanks, it works