I was creating a Vector source from a KML file which I read in. The file had the following LineString in it:
<LineString> <coordinates>-106.048668,36.247039,0 -106.67948647721,40.716490413454,0</coordinates>
</LineString>
After that I created a layer from the vector source. How can I calculate the coordinates from the geometry to get to the coordinates values from the file (106..)?
When using getCoordinates() from geometry of the feature I get:
[-11805283.721064927, 4334667.01649344, 0, -11875506.112730931, 4970613.574512913, 0]
Instead I wanted to get the original coordinates from the file
Use
toLonLat()from OpenLayers packageol/proj.You have a flat array of EPSG:3587 x/y and height coordinates. You would have to decompose that before using
toLonLat().Run the code snipped for the full example