Sharon Schwartz
Sharon Schwartz

Reputation: 21

Cesium - Display map scale

I am building a web app using angular. I am using cesium map. I am new to this material and a bit confused. How can I display or calculate the map scale in meters?

Upvotes: 2

Views: 3851

Answers (2)

Eran Pinhas
Eran Pinhas

Reputation: 98

First of all, it can be implemented simply by creating some kind of div, that by every change of the map view calculates the coordinates of its edges. and from these coordinate you are able to calculate the distance using this calculation.

And there is solution for this made by alberto-acevedo here. it contains compass, navigator and distance scale.

Upvotes: 0

emackey
emackey

Reputation: 12383

Cesium is typically used as a 3D globe, or in "Columbus View" mode (a 3D view of a flat Earth projection, with altitude applied to it). In both of these views, the camera is a "perspective" camera, meaning objects that are farther away appear smaller. You can tilt the camera to look at the horizon, and see short distances in the foreground taking the same amount of screen space as huge distances in the background.

For these reasons, Cesium does not offer an out-of-the-box map scale widget. However, you can still measure specific distances in real-world units in Cesium.

Upvotes: 2

Related Questions