0

is there a way to get the map scale on openlayers 3 the map change zoom level ?

i found a site that converts from map distance to scale

zoomlevel : 20 to map scale : 1:50000.

https://www.maptools.com/scale_calculator

is there a way in openlayers to get the map scale using the zoom level as map distance

  • Did you solve your problem? – Morteza Malvandi May 20 '18 at 12:24
  • i already solve my that problem but not using map scale. – gray May 21 '18 at 7:19
  • can you provide us your idea how you solved ?? – atanu Aug 17 at 11:03
1

The easy thing you can do is to display a scale line, as demonstrated in this example.

var scaleLineControl = new ol.control.ScaleLine();

Computing a correct fractional scale is quite complicated, because you would have to take into account the resolution of your screen, which of course differs from one device to another. This control did exist for OpenLayers 2.

1

As far as I know, it doesn´t exist something like this, you can have a scale bar that tells you based on the width of the bar how much it corresponds on the map.

Please check the example in OpenLayers4 and the tutorial for OL3

https://openlayers.org/en/latest/examples/scale-line.html

http://student.ifip.tuwien.ac.at/geoweb/2013/ol_workshop/doc/controls/scaleline.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.