Geodestic measures in OL 5?

863 views Asked by At

This example, url below, uses OL-3 with an option to do geodestic measures uses "var wgs84Sphere = new ol.Sphere(6378137);"

http://www.rhone-mediterranee.eaufrance.fr/milieux-aquatiques/poissons/js/openlayers-v3.19.1/examples/measure.html

How can I set the same variable ("wgs84Sphere") to be used by OL version 5?!

1

There are 1 answers

0
cabesuon On BEST ANSWER

ol/Sphere no longer exists in OpenLayers 5, if you want to measure use ol/sphere methods getArea and getDistance.

Follow the link to see this and some use examples: https://github.com/openlayers/openlayers/releases/tag/v5.0.0