Where is Scalebar accurate in 3.x JS API?

931
3
Jump to solution
12-19-2017 01:43 PM
by Anonymous User
Not applicable

So, my question is, where is the Scalebar accurate for in 3.x API? Both if it's in the map DIV or if external. 3.x docs do not mention Scalebar 3.23 

In the 4.x docs ScaleBar is described beautifully: ScaleBar 4.6  It is valid for where it actually is, on the map, literally underneath it.  And if it's external outside the map element it's valid for the map's center.

On a sidenote, does Esri have plans to integrate a variable scalebar for global-scale projected maps to the API? Or indicate direction via graticule? I've noticed many in GIS are creating maps with inaccurate north or scalebar. ArcMap is cumbersome to deal with for north and scalebar in these cases which is part of why this happens. Some of the best articles on this are recent Esri articles:

Does every map need a north arrow and scale bar? | ArcGIS Blog  

Choosing the best way to indicate map scale | ArcGIS Blog  

Back to the issue of scale bars | ArcGIS Blog  

I propose adding support for variable scalebars and graticules, and other ways of dealing with this, both in Desktop and the API. Or even for a way of showing Tissot's indicatrix. Because, it matters.  

A public service announcement for us all, to remember to indicate projection and datum on map title blocks on printed maps and in viewer documentation. And if north is true, and if not, declination etc. What realization the datum is, transformations, scales of data and analysis, etc. And even scalebar units, etc.

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
BjornSvensson
Esri Regular Contributor

Kevin MacLeod
The 3x Scalebar is documented at https://developers.arcgis.com/javascript/3/jsapi/scalebar-amd.html

When the scalebar is inside the map, the actual location of the scalebar is used to calculate the scale.
When the scalebar is positioned outside the map div the following values are used:
* If the scalebar is above the map, the upper border of the map is used.
* If the scalebar is below the map, the lower border of the map is used.
* If the scalebar is positioned next to the map, its vertical location is used. 

View solution in original post

3 Replies
BjornSvensson
Esri Regular Contributor

Kevin MacLeod
The 3x Scalebar is documented at https://developers.arcgis.com/javascript/3/jsapi/scalebar-amd.html

When the scalebar is inside the map, the actual location of the scalebar is used to calculate the scale.
When the scalebar is positioned outside the map div the following values are used:
* If the scalebar is above the map, the upper border of the map is used.
* If the scalebar is below the map, the lower border of the map is used.
* If the scalebar is positioned next to the map, its vertical location is used. 
by Anonymous User
Not applicable

I see now. For some reason I was looking at them both and landed in examples and thought maybe it differed between 3.x-4.x. Thanks Bjorn.  I have an idea.... perhaps when the user floats their mouse over the scalebar, a tooltip for the cursor appears, explaining this is the area where it's accurate for. Or something else "discoverable".  Users in this case don't know what they don't know and inaccurate assumptions are probably being made based on this every minute somewhere. So my idea, make it more discoverable in terms of user interface. Thoughts?

0 Kudos
BjornSvensson
Esri Regular Contributor

Kevin, 3x Scalebar differs from the 4x ScaleBar in this aspect - which you might have noticed in their API References.

The change we made for 4x was to use the actual location of the scale bar to calculate the scale (when the scale bar is inside the map). I think this makes it less confusing. I think this works better than 3x in most cases. The exception is when users are looking at a map where the scale is very different from one location to another, for example when zoomed out to the whole world.  In those cases, we might change the behavior in a future release to not be visible (when it's not reasonably correct).  This would also be consistent with SceneView/3D where currently the ScaleBar does not display (since almost all the time, it would be incorrect for most of the map).