Select to view content in your preferred language

Scale bar on map view

6673
7
07-23-2014 02:22 PM
forestknutsen1
MVP Regular Contributor

I just looked around the API for a method in the class com.esri.android.map.MapView for a method for adding a scale bar to the map view. All I see is a getScale() method. Is there an easy way to add a scale bar to the map view that I am missing?

I guess I could make one up from the get scale method and then use a fragment....  

0 Kudos
7 Replies
GSauers
Frequent Contributor

I also am looking for a solution to add a scale bar to my map. Any one have any progress with this?

Thanks.

0 Kudos
forestknutsen1
MVP Regular Contributor

As near as I could tell one would have to make up a custom one. We felt like we did not need it that bad. But I must say I was surprised that something was not in the API. One would think this is a basic thing esri would want to put in...... ??

0 Kudos
_ukaszKolek
Deactivated User

We create custom scale bar for our apps on iOS and Android.

If you want to know how it looks check our app:

Geoportal Mobile - Android Apps on Google Play

0 Kudos
GSauers
Frequent Contributor

Thank you for the example Kolek, I am looking for a scale that shows like 2 inches = 5 km, so the users know how much area they are looking at.

It seems like I will have to do some custom work to get this working.

Thanks again.

0 Kudos
MichaelDavis3
Frequent Contributor

We've done something like this in our iOS apps.  We figure out the DPI of the device's screen and then create a one-inch long rectangle.  Then we hook into the zoom/pan events and update scale text to display "1in = XXXft" (or whatever) based on a geodetic measure of the extent of the rectangle on the map.

It works pretty well.

jinyingmin2
New Contributor

Hello.

I have worked on the map scale bar using ArcGIS android SDK 10.2.

Normally there no found the solution for display scale bar what you want.

But I found the example associated with this issue.

You can check this url and apply the sample.

http://stackoverflow.com/questions/12964608/how-to-add-a-map-scale-in-mapview-on-android.

this is not the sample for ArcGIS android SDK, but you can change it in order to the SDK.

if you want to know more details, I could provide my program.

forestknutsen1
MVP Regular Contributor

Very cool. Thanks taking the time to reply. At this time we are not using a scale bar in the application.

0 Kudos