1 回答

TA貢獻(xiàn)1875條經(jīng)驗 獲得超5個贊
你必須打電話new L.Marker()或L.marker()
要修復(fù)您的第二個錯誤(在評論中),您必須首先定義您的 featureGroup,然后創(chuàng)建標(biāo)記。
var fg = new L.featureGroup();
var WA0TJT = L.Marker(new L.LatLng(39.202911,-94.602887),{
contextmenu: true,
contextmenuWidth: 140,
contextmenuItems: [{ text: 'Click here to add mileage circles', callback: circleKoords}],
icon: new L.NumberedDivIcon({number: '1' }),
title:"marker_1" }).addTo(fg).bindPopup("1<br><b>ID: #0013</b><br>WA0TJT<br>Keith Kaiser<br>Platte Co., MO Dist: A<br>39.202911, -94.602887<br>EM29QE").openPopup();
您也不會在地圖上看到任何內(nèi)容,因為您沒有將要素組添加到地圖中。你需要一個地圖實例。
var map = L.map('map', {
...
});
fg.addTo(map);
添加回答
舉報