私は Javascript とリーフレットの初心者です。まずgeojson.js
、このようなファイルを作成しました
var data={
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"id": 1,
"properties": {
"Name": "Germany",
"description": "",
"timestamp": "",
"begin": "",
"end": "",
"altitudeMode": "clampToGround",
"tessellate": 1,
"extrude": -1,
"visibility": -1
},
"geometry": {
"type": "Point",
"coordinates": [
51.329219337279405,
10.454119349999928
]
}
}
]
}
このような座標へのアクセス
points[0] = data.features[0].geometry.coordinates[0];
points[1] = data.features[0].geometry.coordinates[1];
これは問題ありませんが、いくつかの geojson を作成し、それらを同じフォルダーに保存し、leaflet/geojson.js
http や ajax ではなく url でアクセスしたいと考えています。このようなもの:
var data = $.getJSON( "leaflet/geojson.js", function(json) {
points[0] = json.features[0].geometry.coordinates[0];
})
私はそれを行うことができますか?
前もって感謝します!