Scale units won't work on the map (iOS)

Hello, I am trying to change the scale units from imperial to metric and vice versa on the Map API. Even though I have the default units set to metric in the designer by default the app always opens with imperial units. Additionally, I cannot toggle between the two using code. For reference I am using an iPhone 7 on iOS 15.7.3. I also live in the United States so that might have something to do with why imperial units are default if the program is accessing my region.
Here is my designer:


And here are all the relevant blocks:

Perhaps a bug perhaps your ListPicker logic is at fault. To find out, temporarily add two Buttons and the following code:

mapScale

What happens on your ios? On my Android the Scale appears and changes properly. :astonished:

If nothing happens, congratulations, you have discovered a bug, if it changes, revise your coding logic. :slight_smile:

I tried it and I can confirm it does not work on my device. In the scenario that you wanted me to test, I received a runtime error indicating that the red "scale units" block was an undefined variable. I believe there is enough evidence to confirm that this is a bug.

OK. Try using a Math 1 in the metric units slot and an 2 in the Imperial slot.

See * Map for a possible work around.

ScaleUnits
Specifies the units used for the scale overlay. 1 (the default) will give metric units (km, m) whereas 2 will give imperial units (mi, ft).

If these values still do not work, this is an ios Bug . Please show the actual Blocks you use. Thanks.

Unfortunately it still does not work.

You need to wait until MIT updates the ios companion to fix the issue. In the meanwhile you can use an Android. A possible fix probably will not be available for several months or more.

You did not share your Blocks as requested, so we cannot determine if something in the way you coded your Project is creating the problem related to the ios map distance scale units. :cry:

I coded my blocks exactly how you had shown in the image on a separate test project, so there should not be an error with the blocks.

Unfortunately, it doesn't look like Apple MapKit, the library we use on iOS to drive the maps, supports changing the units of the scale view. It assumes the units based on the user's locale for the app, or if one isn't set, the system locale. To support this feature on iOS we'd likely have to implement a custom scale view class and handle it that way. I will make a note to update the documentation to clarify that this isn't currently supported on iOS.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.