mapbox / mapbox/mapbox-gl-geocoder

Disable flyTo if geocoding is triggered programmaticly (keep animation for input)

Open
#396 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

auto-triaged enhancement
Dominant language
JavaScript
Stars
388
Forks
181
PR merge metrics
No merged PRs in 30d

Description

Hi,

I'm triggering geocoder.query(""); on map load. However, the animation is very laggy, as it tries to animate while the rest of the page load. Therefore, we wish to disable the flyTo, but only on the geocode.query trigged on map load.

This is how we are triggering it:

map.on('load', function() {
	$("#map").css("pointer-events", "none");
  
  geocoder.query('Bali');
});

I know of map.jumpTo, however I can't seem to figure out to solely apply this on the map load query. Any suggestions?

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 at the map load handler and the geocoder.query('Bali') entry point, then trace how query-triggered map animation is selected. No files or tests are mentioned in the issue. Done means programmatic queries can suppress flyTo while queries triggered by user input retain animation.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.