# How can I fetch collections or add workflows when the user zooms in/out of the map or drags it around, using Google Maps or Mapbox extensions?

**URL:** <https://community.weweb.io/t/how-can-i-fetch-collections-or-add-workflows-when-the-user-zooms-in-out-of-the-map-or-drags-it-around-using-google-maps-or-mapbox-extensions/10533>\
**Category:** How do I?\
**Created:** [August 30, 2024, 1:01am UTC](https://community.weweb.io/t/how-can-i-fetch-collections-or-add-workflows-when-the-user-zooms-in-out-of-the-map-or-drags-it-around-using-google-maps-or-mapbox-extensions/10533 "2024-08-30T01:01:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![august](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/august/32/10004_2.png) [@august](https://community.weweb.io/u/august)\
**Post date:** [August 30, 2024, 1:01am UTC](https://community.weweb.io/t/how-can-i-fetch-collections-or-add-workflows-when-the-user-zooms-in-out-of-the-map-or-drags-it-around-using-google-maps-or-mapbox-extensions/10533/1 "2024-08-30T01:01:52Z")

</div>

Like what you see on websites like [Airbnb](https://www.airbnb.com.sg/s/San-Diego--California--United-States/homes?_set_bev_on_new_domain=1721273013_EAZjUyZWE5M2M5ZD), where it fetches data for places within the map whenever the user zooms in, zooms out, or moves around the map.

In mapbox, we have “drag end” trigger but how can I trigger when user zooms in/out? how can I create zoom trigger?

---

<div class="post-metadata">

**Author:** ![eric](https://avatars.discourse-cdn.com/v4/letter/e/898d66/32.png) [@eric](https://community.weweb.io/u/eric)\
**Post date:** [October 14, 2024, 4:15pm UTC](https://community.weweb.io/t/how-can-i-fetch-collections-or-add-workflows-when-the-user-zooms-in-out-of-the-map-or-drags-it-around-using-google-maps-or-mapbox-extensions/10533/2 "2024-10-14T16:15:12Z")

</div>

hi, do you guys have solution for this?

---

<div class="post-metadata">

**Author:** ![ryanev](https://avatars.discourse-cdn.com/v4/letter/r/df705f/32.png) [@ryanev](https://community.weweb.io/u/ryanev)\
**Post date:** [October 14, 2024, 4:39pm UTC](https://community.weweb.io/t/how-can-i-fetch-collections-or-add-workflows-when-the-user-zooms-in-out-of-the-map-or-drags-it-around-using-google-maps-or-mapbox-extensions/10533/3 "2024-10-14T16:39:24Z")

</div>

I believe you’d need to create your own Google Maps event “listener” until WeWeb adds it natively to their maps component.

> **[Events  |  Maps JavaScript API  |  Google for Developers](https://developers.google.com/maps/documentation/javascript/events)**

---

<div class="post-metadata">

**Author:** ![eric](https://avatars.discourse-cdn.com/v4/letter/e/898d66/32.png) [@eric](https://community.weweb.io/u/eric)\
**Post date:** [October 15, 2024, 12:47pm UTC](https://community.weweb.io/t/how-can-i-fetch-collections-or-add-workflows-when-the-user-zooms-in-out-of-the-map-or-drags-it-around-using-google-maps-or-mapbox-extensions/10533/4 "2024-10-15T12:47:22Z")

</div>

Hi @ryanev  
thank for your reply  
but Im stuck with implement the GG map in the weweb

I cant wrote a JS code for get the event  
could you show me more on the set the map event?

 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/e/ebeacee5fb1ca09714b8520700580af4812005e2.png)
