我有leaflet.js图层控件,谷歌地图,OSM和Yandex地图图层和Yandex地图流量叠加(它只是显示流量的颜色线)
我使用以下Google插件和Yandex地图将其投放到传单上:https://github.com/shramov/leaflet-plugins
这是我的代码:
var map = new L.Map('map', { center: new L.LatLng(59.94, 30.29), zoom: 10, zoomsliderControl: true,
scrollWheelZoom:true, zoomAnimation: false });
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
var osm = new L.TileLayer(osmUrl, {attribution: '', maxZoom:18 });
var yndx = new L.Yandex("", {attribution: ''});
var ytraffic = new L.Yandex("null", {traffic:true, opacity:1, overlay:true });
var googleLayer = new L.Google('ROADMAP');
var layersControl = new L.Control.Layers({"Yandex":yndx, 'OSM':osm, 'Google':googleLayer}, {"Traffic":ytraffic});
map.addControl(layersControl);
map.addLayer(yndx);
L.marker([59.94, 30.29], {icon: new L.Icon({iconUrl: "../css/car.png", iconAnchor: new L.point(16, 37), iconSize: new L.point(64, 38)}) }).addTo(map);
问题是交通线路覆盖层与地图上的标记重叠。据我所知,这不应该发生,因为覆盖窗格通常位于标记窗格下方。
请告知如何将标记放在交通线上方。
答案 0 :(得分:1)
我在GitNub上发现它已知问题,从顶部发表的第三条评论帮助我: https://github.com/shramov/leaflet-plugins/issues/97