Openlayers is representing the coordenates as longitude,latitude.
Can I change the default format longitude,latitude to latitude,longitude?
By example, this will not work, because I have this array as [lat, lng] and LineString is taking it as [lng,lat]:
a = [
[-21.929054, 64.127985],
[-21.912918, 64.134726]
];
var lineString = new ol.geom.LineString(a);
Best Answer
The order of Lat/Lng is fairly embedded in the framework with no configuration entry. You can have a look at the code on github if you're interested: https://github.com/openlayers/ol3/tree/master/src/ol/geom
Unless you want to rewrite the parts of code that influence this, your only option is to format the data appropriately.
You might try something like this: