mapbox / mapbox/mapbox-maps-flutter

Zoom the map programmatically?

Open
#287 3 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

I would like to create my own zoomIn() and zoomOut() buttons on a toolbar, but there does not seem to be an api call into MapboxMap for this. I tried

 mapboxMap.scaleBy(15.0, ScreenCoordinate(x: 10.0, y: 10.0),
          MapAnimationOptions(duration: 2000, startDelay: 0));

following the example provided in your codebase, but it produces PlatformException (PlatformException(0, Not available., null, null)) at line 1803 in your map_interfaces.dart file.

What is the right way to zoom the map programmatically?

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 with the MapboxMap.scaleBy call and map_interfaces.dart at line 1803, then trace the platform implementation behind the reported “Not available” exception. Determine how programmatic zoom is intended to be exposed for toolbar controls, and verify that the documented or implemented path performs zooming without that exception.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.