mapbox / mapbox/mapbox-maps-flutter

Scale bar settings not updating correctly

Open
#157 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Dart
Stars
380
Forks
204
PR merge metrics
No merged PRs in 30d

Description

Description:
When updating the scale bar settings on a Mapbox map using the following code:

await mapboxMap?.scaleBar.updateSettings(ScaleBarSettings(
        // position: scaleBarPosition,
        enabled: true,
        textSize: 22,
        height: 60,
        marginBottom: 20,
        marginLeft: 20,
        marginTop: 40,
        marginRight: 40,
      ));
t = await mapboxMap?.scaleBar.getSettings();
print("scaleBar.getSettings: ${t?.textSize}");

The expected result is that the textSize property of the scale bar settings is updated to 22. However, when retrieving the scale bar settings using mapboxMap?.scaleBar.getSettings(), the textSize property returns null.

Steps to reproduce:

  1. Update the scale bar settings using the code above.
  2. Retrieve the scale bar settings using mapboxMap?.scaleBar.getSettings().
  3. Observe that the textSize property returns null.

Expected result:
The textSize property of the scale bar settings should be updated to 22.

Actual result:
The textSize property of the scale bar settings returns null.

same for height ...

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with ScaleBarSettings and the scaleBar.updateSettings/getSettings calls shown in the report. Check why textSize and height do not round-trip, then verify that getSettings returns 22 and 60 after the update.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter
Domain
mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.