Mapbox.js: parsing coordinates into latitude and longitude from GeoJSON

المشرف العام

Administrator
طاقم الإدارة
I am making my way through learning Mapbox and Mapbox.js. I have loaded my GeoJSON data from a URL:

var featureLayer = L.mapbox.featureLayer().loadURL('./data_frag.geojson').addTo(map);Now I am trying to parse out the lat and lon coordinates. It makes sense to me to try something like:

var longitude = featureLayer.geometry.coordinates[0];var latitude = featureLayer.geometry.coordinates[1];but that is not right.

Should I be using the feature layer or the geoJSON layer for this?

Thanks much



أكثر...
 
أعلى