我想在Leaflet的标记图标底部打开一个弹出窗口。
我的代码:
var mymap = L.map('mapid').setView([51.505, -0.09], 13);
L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpandmbXliNDBjZWd2M2x6bDk3c2ZtOTkifQ._QA7i5Mpkd_m30IGElHziw', {
maxZoom: 18,
attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' +
'<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
'Imagery © <a href="http://mapbox.com">Mapbox</a>',
id: 'mapbox.streets'
}).addTo(mymap);
var lati = 51.51;
var longi = -0.09;
var popupLocation1 = new L.LatLng(lati, longi);
var popupContent1 = 'This is a nice popup';
popup1 = new L.Popup();
popup1.setLatLng(popupLocation1);
popup1.setContent(popupContent1);
var m1 = L.marker([ lati, longi ]).addTo(mymap);
m1.bindPopup(popup1);
m1.openPopup();
所以我在标记上方弹出了一个窗口。
我想在底部弹出一个窗口,例如: