How to add a scale indication

1013
3
05-01-2020 03:13 AM
AnatBen_Israel
New Contributor II

Hi,

I'm using ArcGIS SDK for Qt, with qml GUI and C++ logic, displaying an offline raster map, using SceneView (not MapView).

I want to display a small scale bar at the corner like this:

How can I tell the correct distance\value?

Is there anything already prepared for that or do I have to draw and measure myself?

Thanks

Tags (1)
0 Kudos
3 Replies
LucasDanzinger
Esri Frequent Contributor

This is something that should be possible by accessing MapView::mapScale and MapView::unitsPerDIP. We have been wanting to add this as a ready-to-use ArcGIS Runtime Toolkit component for some time, but have not gotten to it yet. 

In the meantime, here is a pure QML example that might get you on the right track - https://community.esri.com/thread/201990-scale-bar#comment-715878 

Also, here is the iOS swift implementation of their Scalebar toolkit component. Since we share the same common design of the Runtime API, much of the logic should be the same - arcgis-runtime-toolkit-ios/Scalebar.swift at master · Esri/arcgis-runtime-toolkit-ios · GitHub 

0 Kudos
AnatBen_Israel
New Contributor II

Hi, Thanks for the help. But what if I have a SceneView and not a MapView? Both of the link you mentioned refer to a MapView which I don't have since I need to 3D options.

0 Kudos
LucasDanzinger
Esri Frequent Contributor

Sorry I missed that detail.

I'm not sure a 3D scale bar would give you the results you are after. Due to the nature of 3D, the camera viewpoint (heading, pitch, height, roll, etc) would mean that a given screen length in pixels would have different geographic length depending where on the screen you are looking.

For example, consider looking at the full globe - 3 cm in the center 0,0 would be much different real world length than 3 cm at edge. Another scenario is to consider looking at an observer view from the top of a building down across the city scape - 3 cm close to your current camera would be much different than 3 cm across the horizon.

There is some similar discussion here for ArcGIS Pro Scenes & Scale Bars - Scale bar in ArcgisPro layout  "Scale is continuous and changing across a 3D view, so the traditional idea of scale bars don’t work in scenes - things that are far away are at a different scale than things that are closer."

0 Kudos