# Re-Center Map to Geolocation

**URL:** <https://forum.bubble.io/t/re-center-map-to-geolocation/1697>\
**Category:** Need help\
**Created:** [February 21, 2016, 3:26pm UTC](https://forum.bubble.io/t/re-center-map-to-geolocation/1697 "2016-02-21T15:26:27Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![AliFarahat](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/alifarahat/32/189604_2.png) [@AliFarahat](https://forum.bubble.io/u/AliFarahat)\
**Post date:** [February 21, 2016, 3:26pm UTC](https://forum.bubble.io/t/re-center-map-to-geolocation/1697/1 "2016-02-21T15:26:27Z")

</div>

Hello all,

There was a discussion earlier to determine map center address. But we also need method in the workflow to recenter the map to the thing’s geolocation. if you drag the map away from the center there should a workflow to re-center it

![](https://us1.discourse-cdn.com/bubble/original/2X/9/931fd870c808398b4b49fb18965a4d03bfdd8113.JPG)

**Problem**  
 ![](https://us1.discourse-cdn.com/bubble/original/2X/b/b90b58dbd4e1ad13302e8b5621efabaeeb6c8f23.gif)

---

<div class="post-metadata">

**Author:** ![natedogg](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/natedogg/32/79328_2.png) [@natedogg](https://forum.bubble.io/u/natedogg)\
**Post date:** [February 21, 2016, 11:01pm UTC](https://forum.bubble.io/t/re-center-map-to-geolocation/1697/2 "2016-02-21T23:01:16Z")

</div>

If you use the command “Clear markers”, that will do it, as it resets the map to its default defined settings.

I currently use this method in my app.

---

<div class="post-metadata">

**Author:** ![AliFarahat](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/alifarahat/32/189604_2.png) [@AliFarahat](https://forum.bubble.io/u/AliFarahat)\
**Post date:** [February 22, 2016, 8:24am UTC](https://forum.bubble.io/t/re-center-map-to-geolocation/1697/3 "2016-02-22T08:24:58Z")

</div>

I am afraid i had tried that with no success. The thing is the map needs to be reentered and not for the markers to be cleared.

---

<div class="post-metadata">

**Author:** ![NigelG](https://avatars.discourse-cdn.com/v4/letter/n/ea5d25/32.png) [@NigelG](https://forum.bubble.io/u/NigelG)\
**Post date:** [February 22, 2016, 9:34am UTC](https://forum.bubble.io/t/re-center-map-to-geolocation/1697/4 "2016-02-22T09:34:36Z")

</div>

No, you are right, once the map has been moved there seems to be no way to reset it to “initial”. Normally I would expect a group reset to work.

---

<div class="post-metadata">

**Author:** ![AliFarahat](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/alifarahat/32/189604_2.png) [@AliFarahat](https://forum.bubble.io/u/AliFarahat)\
**Post date:** [February 22, 2016, 1:34pm UTC](https://forum.bubble.io/t/re-center-map-to-geolocation/1697/5 "2016-02-22T13:34:54Z")

</div>

Do you think there could be a quick fix for this @emmanuel?

---

<div class="post-metadata">

**Author:** ![natedogg](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/natedogg/32/79328_2.png) [@natedogg](https://forum.bubble.io/u/natedogg)\
**Post date:** [February 22, 2016, 5:12pm UTC](https://forum.bubble.io/t/re-center-map-to-geolocation/1697/6 "2016-02-22T17:12:27Z")

</div>

So yeah, apparently I was wrong. The map wasn’t being re-centered based on the “Clear markers” command in my app, it was re-centered because of how I was dynamically using the map’s center address. 😝

The good news is that I figured out how to do it. But, you’ll actually have to use two maps to accomplish it. This is because apparently, if you try to dynamically change the center address of a map, but the value doesn’t change, the map doesn’t reset.

Anyway, here it is:

Run mode: https://forum\_app2.bubbleapps.io/version-test/re-center\_

Edit mode: [https://bubble.io/page?type=page&name=re-center\_&id=forum\_app2&tab=tabs-1](https://bubble.io/page?type=page&name=re-center_&id=forum_app2&tab=tabs-1)

You’ll want to change Atlanta, GA to whatever dynamic address you want to center in your app. You can change Columbia, SC to any address. It doesn’t matter. It’s only there to change the value of the hidden map so that it can reset back to default.

---

<div class="post-metadata">

**Author:** ![NigelG](https://avatars.discourse-cdn.com/v4/letter/n/ea5d25/32.png) [@NigelG](https://forum.bubble.io/u/NigelG)\
**Post date:** [February 22, 2016, 5:52pm UTC](https://forum.bubble.io/t/re-center-map-to-geolocation/1697/7 "2016-02-22T17:52:20Z")

</div>

That is very complex 🙂

Ok, so having a play …

I put a map inside a group, and reset the group and send the default data.

The map recentres … IF you are in debug mode !!! If you are in normal mode it doesn’t.

I have also got this to work by doing a page navigation to the same page …that recentres. Some of the time.

What it seems not to like is if you recentre before it has “loaded” ?

Anyway. The right button here seems to work.

> **[Bubble Editor - Forum\_app2](https://bubble.io/page?type=page&name=mapcentre&id=forum_app2&tab=tabs-2)**
>
> Build stuff without code and launch a startup without a tech-cofounder! Bubble is a visual programing language. Instead of typing code, use a visual editor to build applications.

---

<div class="post-metadata">

**Author:** ![natedogg](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/natedogg/32/79328_2.png) [@natedogg](https://forum.bubble.io/u/natedogg)\
**Post date:** [February 22, 2016, 6:19pm UTC](https://forum.bubble.io/t/re-center-map-to-geolocation/1697/8 "2016-02-22T18:19:07Z")

</div>

Yes, solving this is very complex indeed! 😂

While there are apparently ways to work around it, it seems the best method to do something like this would be if we had a “re-center map” function like @AliFarahat suggested.

---

<div class="post-metadata">

**Author:** ![NigelG](https://avatars.discourse-cdn.com/v4/letter/n/ea5d25/32.png) [@NigelG](https://forum.bubble.io/u/NigelG)\
**Post date:** [February 22, 2016, 6:43pm UTC](https://forum.bubble.io/t/re-center-map-to-geolocation/1697/9 "2016-02-22T18:43:25Z")

</div>

I think it is a bug. If you reset a repeating group, you get the “default” back. The behavior should be the same, it shoudl return to the initialized state.

But yeah, we need something.

---

<div class="post-metadata">

**Author:** ![emmanuel](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/emmanuel/32/27657_2.png) [@emmanuel](https://forum.bubble.io/u/emmanuel)\
**Post date:** [February 23, 2016, 12:26am UTC](https://forum.bubble.io/t/re-center-map-to-geolocation/1697/10 "2016-02-23T00:26:59Z")

</div>

Can’t you use the ‘Adjust map zoom’ action and click ‘set center and zoom manually’?

> **[Bubble Reference](https://bubble.io/reference#Actions.MapAdjustZoom.manual_setting)**
>
> Full reference for each Bubble element, feature, plugin. Bubble is a visual programing language. Instead of typing code, use a visual editor to build applications.

---

<div class="post-metadata">

**Author:** ![AliFarahat](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/alifarahat/32/189604_2.png) [@AliFarahat](https://forum.bubble.io/u/AliFarahat)\
**Post date:** [February 23, 2016, 7:40am UTC](https://forum.bubble.io/t/re-center-map-to-geolocation/1697/11 "2016-02-23T07:40:12Z")

</div>

I will give that a try and let you know today!

---

<div class="post-metadata">

**Author:** ![NigelG](https://avatars.discourse-cdn.com/v4/letter/n/ea5d25/32.png) [@NigelG](https://forum.bubble.io/u/NigelG)\
**Post date:** [February 23, 2016, 8:49am UTC](https://forum.bubble.io/t/re-center-map-to-geolocation/1697/12 "2016-02-23T08:49:20Z")

</div>

Aha, never seen that before. It works 🙂

---

<div class="post-metadata">

**Author:** ![AliFarahat](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/alifarahat/32/189604_2.png) [@AliFarahat](https://forum.bubble.io/u/AliFarahat)\
**Post date:** [February 24, 2016, 11:40am UTC](https://forum.bubble.io/t/re-center-map-to-geolocation/1697/13 "2016-02-24T11:40:52Z")

</div>

Yep it works! But does not reset the value of the center address. That still remains held in the map element!

---

<div class="post-metadata">

**Author:** ![NigelG](https://avatars.discourse-cdn.com/v4/letter/n/ea5d25/32.png) [@NigelG](https://forum.bubble.io/u/NigelG)\
**Post date:** [February 24, 2016, 12:34pm UTC](https://forum.bubble.io/t/re-center-map-to-geolocation/1697/14 "2016-02-24T12:34:22Z")

</div>

Ah, so map centre is still where it was when you moved it ?

---

<div class="post-metadata">

**Author:** ![AliFarahat](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/alifarahat/32/189604_2.png) [@AliFarahat](https://forum.bubble.io/u/AliFarahat)\
**Post date:** [February 24, 2016, 12:48pm UTC](https://forum.bubble.io/t/re-center-map-to-geolocation/1697/15 "2016-02-24T12:48:47Z")

</div>

No, It recenter fine but the value of the center of map remains the last data centerofmap

---

<div class="post-metadata">

**Author:** ![NigelG](https://avatars.discourse-cdn.com/v4/letter/n/ea5d25/32.png) [@NigelG](https://forum.bubble.io/u/NigelG)\
**Post date:** [February 24, 2016, 12:54pm UTC](https://forum.bubble.io/t/re-center-map-to-geolocation/1697/16 "2016-02-24T12:54:02Z")

</div>

Sorry, that’s what I meant. So if you recenter and then store the address from the centre… It is a different address ?

---

<div class="post-metadata">

**Author:** ![AliFarahat](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/alifarahat/32/189604_2.png) [@AliFarahat](https://forum.bubble.io/u/AliFarahat)\
**Post date:** [February 24, 2016, 1:11pm UTC](https://forum.bubble.io/t/re-center-map-to-geolocation/1697/17 "2016-02-24T13:11:14Z")

</div>

To elaberate more in the situation see below steps. Starting from a fresh page load.

1. Map appears with no centerofmap address for example Value Null
2. You drag the map and a new centerofmap address is captured. for example value A
3. You re-center the map
4. The map still holds Value A

---

<div class="post-metadata">

**Author:** ![NigelG](https://avatars.discourse-cdn.com/v4/letter/n/ea5d25/32.png) [@NigelG](https://forum.bubble.io/u/NigelG)\
**Post date:** [February 24, 2016, 1:20pm UTC](https://forum.bubble.io/t/re-center-map-to-geolocation/1697/18 "2016-02-24T13:20:41Z")

</div>

Thanks for the detail. Didnt want to end up testing everything again myself.

---

<div class="post-metadata">

**Author:** ![AliFarahat](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/alifarahat/32/189604_2.png) [@AliFarahat](https://forum.bubble.io/u/AliFarahat)\
**Post date:** [February 24, 2016, 2:47pm UTC](https://forum.bubble.io/t/re-center-map-to-geolocation/1697/19 "2016-02-24T14:47:40Z")

</div>

no problem @NigelG thanks for the support

---

<div class="post-metadata">

**Author:** ![yves.d](https://avatars.discourse-cdn.com/v4/letter/y/aeb1de/32.png) [@yves.d](https://forum.bubble.io/u/yves.d)\
**Post date:** [March 13, 2025, 6:37pm UTC](https://forum.bubble.io/t/re-center-map-to-geolocation/1697/20 "2025-03-13T18:37:16Z")

</div>

Hi @AliFarahat,

Sorry to dig up this old topic, but how can you add an action when you drag the map in your workflow ?  
And how can you get the location of the new center, like you do in your animation ?

Thank you for your help 🙂
