Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can I have access to events like onMoveEnd? #38

Open
AnEpicName opened this issue Jan 13, 2023 · 6 comments
Open

Can I have access to events like onMoveEnd? #38

AnEpicName opened this issue Jan 13, 2023 · 6 comments

Comments

@AnEpicName
Copy link

I need to update the data on my map if it possible at the end of, for example, the camera movement, to avoid getting too much data from my API. I've already done this in web by using onDragEnd but I can't find a simple way to do this in this plugin. I basically need something like these Events, or the equivalent for the camera position.

Is there a way to do this? I found mapboxMap.addListener() but I'm not sure about how it works and if it can listen to those events.

@gtsl-2
Copy link

gtsl-2 commented Feb 22, 2023

I think you can do it with below code in latest version.

MapWidget (
  onMapIdleListener :  (mapIdleEventData) {
      // any function
  }
)

@AlbertoNoris
Copy link

AlbertoNoris commented Jun 24, 2023

I think you can do it with below code in latest version.

MapWidget (
  onMapIdleListener :  (mapIdleEventData) {
      // any function
  }
)

keep in mind that onMapIdleListener returns when the map is idle so when the map is loaded for the first time it will take some seconds to fire. Then when the scroll ends it will fire pretty fast.

@deandreamatias-worldline

Currently has a bug on Android devices that not trigger onMapIdleListener when move camera

@emmanuelvr
Copy link

The README says that listening for events is supported, but it doesn't seem like so. I also need to be able to listen for events like touchstart, but I can't find a way to do it. Hopefully someone from Mapbox will help us.

@emmanuelvr
Copy link

emmanuelvr commented Jan 22, 2024

I managed to implement a similar functionality by wrapping the MapWidget in a GestureDetector and using the coordinateForPixel method.

@sKY02644
Copy link

I managed to implement a similar functionality by wrapping the MapWidget in a GestureDetector and using the coordinateForPixel method.

can you sure sample code of how you implemented it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants