Hi, I need to get the latitude and longitude from a multilinestring geojson file in order to store them.
I can get the array, but when I want them to convert to the lat, long format I got the error "is not a function"
This is the part of the code that isn't working.
function onEachFeature(feature, layer) {
layer.on({
mouseover: highlightFeature, //defined above -> it works
mouseout: resetHighlight,
click: zoomToFeature
})
latlngBiciSendas.push(feature.geometry.coordinates); // Array
}
function resetHighlight(e) {
geoBS.resetStyle(e.target);
}
function loadBS()
{
geoBS = L.geoJson(bicisendas, {
style: style,
onEachFeature: onEachFeature
}).addTo(mapa);
L.geoJson.coordsToLatLngs(latlngBiciSendas,1,true); <- this function is the problematic one.
alert(latlngBiciSendas.length); The array is loaded correctly
};
In order to pass apply this array to an argument to some functions I need to "reverse" the array, i.e: put in the lat, long order.
I recall I am new to javascript and leaflet as well, I was trying and searching without luck. I don't know if I have syntax errors or the conceptual ones.
Error message: Uncaught TypeError: undefined is not a function
I appreciate any help, thanks