嗨我需要在地圖上顯示自定義標記,但無法顯示在我的地圖上,請幫助我如何顯示自定義標記。如何在地圖中顯示自定義標記
這是我的JSON對象:
{
"features": [
{
"geometry": {
"coordinates": [
[-89.39982622861862, 43.06710857435938 ],
[-89.39982622861862, 43.06710857435938 ]
],
"type": "Point"
},
"id": "ci7gsmklj004ahym0qpgca8j7",
"properties": {
"icon": {
"options": {
"className": "",
"iconUrl": "/hb/assets/leaflet/images/d.png",
"iconSize": [ 64, 64],
"iconAnchor": [ 32, 32],
"popupAnchor": [ 0, -24 ]
},
"_initHooksCalled": true
},
"text": "Hari",
"title": "Hunt Area #1"
},
"type": "Feature"
}
],
"type": "FeatureCollection"
}
這是我的代碼:
var layer = new L.tileLayer('http://{s}.tiles.mapbox.com/v4/zittelevan.lgjj093b/{z}/{x}/{y}.png?access_token={token}', {
attribution: 'Attribute data here'
maxZoom: 18,
token: "Token Here"
});
var map = new L.map('map', {
center:[43.10361493125458,89.52398300170898],
zoom: 18,
layers: [layer],
});
L.geoJson(features).addTo(map);
我跟着不同的網站,但我無法正確地找到一個解決方案,這樣我請求你的人,請幫幫我如何在地圖上顯示自定義標記。
由於沒有 – HariKrishna