# Locations Plugin 🌍

**URL:** https://meta.discourse.org/t/locations-plugin/69742
**Category:** Plugin
**Tags:** paid-support
**Created:** [10 september 2017 om 10:36 UTC](https://meta.discourse.org/t/locations-plugin/69742 "2017-09-10T10:36:41Z")
**Posts on this page:** 20
**Page:** 8

<div class="post-metadata">

### Author: ![omarfilip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/omarfilip/32/208019_2.png) [@omarfilip](https://meta.discourse.org/u/omarfilip)
#### Post date: [3 november 2020 om 19:15 UTC](https://meta.discourse.org/t/locations-plugin/69742/630 "2020-11-03T19:15:57Z")

</div>

> [@Richie](#):
>
> Not sure where else Discourse uses it though

Heh - yes - I didn’t want to go that route specifically for that reason. 🙂

---

<div class="post-metadata">

### Author: ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)
#### Post date: [3 november 2020 om 19:16 UTC](https://meta.discourse.org/t/locations-plugin/69742/631 "2020-11-03T19:16:20Z")

</div>

I’ve changed mine…

It produces this effect:

 ![image](https://global.discourse-cdn.com/meta/original/3X/e/f/ef6c5044f49e48f0511e89cd39bf80c36110a15a.jpeg)

---

<div class="post-metadata">

### Author: ![omarfilip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/omarfilip/32/208019_2.png) [@omarfilip](https://meta.discourse.org/u/omarfilip)
#### Post date: [3 november 2020 om 19:20 UTC](https://meta.discourse.org/t/locations-plugin/69742/632 "2020-11-03T19:20:33Z")

</div>

The unintended consequence is found in the Users List:

 ![Loading map](https://global.discourse-cdn.com/meta/original/3X/a/6/a69d2299aef970c19fc44f16193898d5597d8484.png)

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [8 november 2020 om 07:53 UTC](https://meta.discourse.org/t/locations-plugin/69742/633 "2020-11-08T07:53:32Z")

</div>

Sorry for the delay.

There’s no API for this afaics.

It’s just taking the value from the title:

> <https://github.com/merefield/discourse-locations/blob/c947297e8177f751b0f92dc15c52baecd6d4d75f/assets/javascripts/discourse/widgets/map.js.es6#L93>

---

<div class="post-metadata">

### Author: ![ckshen](https://avatars.discourse-cdn.com/v4/letter/c/ad7895/32.png) [@ckshen](https://meta.discourse.org/u/ckshen)
#### Post date: [26 november 2020 om 07:39 UTC](https://meta.discourse.org/t/locations-plugin/69742/635 "2020-11-26T07:39:04Z")

</div>

Has anyone come across this before? that the map just occupies only a portion of the map space? It always displayed just fine, until we updated the plugin.

> **[SF Bay Area, NorCal, Tahoe](https://www.hungryonion.org/c/regions/san-francisco-bay-area/9/l/map)**
>
> The home for knowledgeable and fun discussions of all things culinary in Northern California and Reno-Tahoe. Hole-in-the-walls, farm-to-table, spectacular produce- we got them all.

 ![image](https://global.discourse-cdn.com/meta/original/3X/a/7/a72f2a8f8f8e6213b5948de2b0ec056437284dfa.jpeg)

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [26 november 2020 om 09:48 UTC](https://meta.discourse.org/t/locations-plugin/69742/636 "2020-11-26T09:48:33Z")

</div>

Does this resolve if you remove the Layouts plugin?

---

<div class="post-metadata">

### Author: ![ckshen](https://avatars.discourse-cdn.com/v4/letter/c/ad7895/32.png) [@ckshen](https://meta.discourse.org/u/ckshen)
#### Post date: [27 november 2020 om 09:07 UTC](https://meta.discourse.org/t/locations-plugin/69742/637 "2020-11-27T09:07:29Z")

</div>

Oddly, the map doesn’t show up (all blank) when I remove the layouts plugin. I was originally thinking it might be a CSS issue but the issue persists after I removed all CSS.

Which is real odd, because your map at Pavilion looks just fine.

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [27 november 2020 om 09:19 UTC](https://meta.discourse.org/t/locations-plugin/69742/638 "2020-11-27T09:19:17Z")

</div>

Cannot repro. Check for a Theme clash?

---

<div class="post-metadata">

### Author: ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)
#### Post date: [27 november 2020 om 09:33 UTC](https://meta.discourse.org/t/locations-plugin/69742/639 "2020-11-27T09:33:48Z")

</div>

Latest update to core seems to have killed this stone dead:

 ![image](https://global.discourse-cdn.com/meta/original/3X/5/3/537c1e064d5f3f18915fc201da0fe46f1020d408.png)

Clicking the user map, or the map icon on a user card causes a self inflicted dos 😔

 ![dead](https://global.discourse-cdn.com/meta/original/3X/d/7/d74994092d93ca880afe5f12188a7b0b73b9d5a1.png)

It then just keeps going, killing the browser stone dead within a handful of seconds:

 ![dead2](https://global.discourse-cdn.com/meta/original/3X/9/b/9bc54910f79e26a4780639228bef368696ad1650.png)

Same on the user map page:

 ![dead3](https://global.discourse-cdn.com/meta/original/3X/f/9/f974a7f2c7dbe6d0fbec14f86660eb665599c90c.png)

I’ve had to disable the plugin completely this morning.

---

<div class="post-metadata">

### Author: ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)
#### Post date: [27 november 2020 om 09:41 UTC](https://meta.discourse.org/t/locations-plugin/69742/640 "2020-11-27T09:41:22Z")

</div>

Related perhaps?

> [@Why is location plugin using so much CPU?](https://meta.discourse.org/t/whats-using-all-the-cpu-cycles/171478):
>
> I rebuilt the container with the latest test-passed from today, and suddenly all the CPU cycles are used up. The site becomes real slow. The server pretty much only has Discourse running. What’s this openvpn user running the Ruby/ unicorns? Is it the same as the Discourse unicorns? Assuming this is intended and desired, how can I free up some cpu cycles so the site doesn’t run so slow? Sidekiq is showing barely anything running in the background. No users are on other than me.

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [27 november 2020 om 09:43 UTC](https://meta.discourse.org/t/locations-plugin/69742/641 "2020-11-27T09:43:52Z")

</div>

Sorry, not going to get much time to look at this right now, moving house and outside the support period double whammy.

I would first check this is not something else which is impacting the server, it may not be Locations at all …

I cannot presently see anything going wrong with Locations on current build, there’s nothing in logs.

Please take a look at what might be stealing performance.

---

<div class="post-metadata">

### Author: ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)
#### Post date: [27 november 2020 om 09:54 UTC](https://meta.discourse.org/t/locations-plugin/69742/642 "2020-11-27T09:54:20Z")

</div>

> [@merefield](#):
>
> I would first check this is not something else which is impacting the server, it may not be Locations at all …

I’d say it’s probably the 4,000+ network calls being made to `map.json` every time someone tries to view a users location 😃

> [@merefield](#):
>
> not going to get much time to look at this right now

No worries, I’ve disabled the plugin for now.

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [27 november 2020 om 12:07 UTC](https://meta.discourse.org/t/locations-plugin/69742/645 "2020-11-27T12:07:15Z")

</div>

Working fine on my instance. Just updated. Noticed a load of uncached resources at first. Fine now. To do with redis upgrade?

---

<div class="post-metadata">

### Author: ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)
#### Post date: [27 november 2020 om 13:46 UTC](https://meta.discourse.org/t/locations-plugin/69742/646 "2020-11-27T13:46:22Z")

</div>

> [@merefield](#):
>
> To do with redis upgrade?

I genuinely don’t know 🤷‍♂️

Would that cause the thousands and thousands of network calls though?

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [27 november 2020 om 13:47 UTC](https://meta.discourse.org/t/locations-plugin/69742/647 "2020-11-27T13:47:00Z")

</div>

Every single avatar for all the users in scope? (for example). Every piece of map required.

---

<div class="post-metadata">

### Author: ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)
#### Post date: [27 november 2020 om 13:47 UTC](https://meta.discourse.org/t/locations-plugin/69742/648 "2020-11-27T13:47:34Z")

</div>

No, sorry, I meant, would it cause the thousands of network calls per minute to `map.json` that I was seeing?

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [27 november 2020 om 13:48 UTC](https://meta.discourse.org/t/locations-plugin/69742/649 "2020-11-27T13:48:31Z")

</div>

A 429 that’s being ignored, perhaps? If an asset is needed again, but denied, it may still go after it.

Yeah, not sure about the 200’s … what provider are you using?

---

<div class="post-metadata">

### Author: ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)
#### Post date: [27 november 2020 om 13:52 UTC](https://meta.discourse.org/t/locations-plugin/69742/650 "2020-11-27T13:52:15Z")

</div>

When I clicked on a user card, then on the map icon for that single user, it instantly started firing hundreds and hundreds of network calls to map.json

Over 1,000 calls to `map.json` were sent in under 60 seconds, just from my browser alone.

To the point where my desktop PC browser locked up completely and when I opened my discourse on my phone I instantly got the “slow down, too many requests from this IP” message.

---

<div class="post-metadata">

### Author: ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)
#### Post date: [27 november 2020 om 13:52 UTC](https://meta.discourse.org/t/locations-plugin/69742/651 "2020-11-27T13:52:55Z")

</div>

> [@Richie](#):
>
> Over 1,000 calls to `map.json` were sent in under 60 seconds

Probably more, but my browser died at that point 😆

---

<div class="post-metadata">

### Author: ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)
#### Post date: [27 november 2020 om 13:57 UTC](https://meta.discourse.org/t/locations-plugin/69742/652 "2020-11-27T13:57:41Z")

</div>

I tried again.

Same thing - kills itself instantly:

 ![image](https://global.discourse-cdn.com/meta/original/3X/f/d/fdc5f618e5348d017cc66e8025ce518014d93b45.png)

And:

 ![image](https://global.discourse-cdn.com/meta/original/3X/1/3/13ed5c6831c767c8cdea5177a2ed9dbc352d8553.jpeg)

etc.

On the off chance it was browser related, I tried Chrome instead of firefox.

Chrome seems to handle the issue slightly better and it got to over 10,000 network requests to map.json in under sixty seconds, at which point my entire PC started locking up - not just the browser:

 ![image](https://global.discourse-cdn.com/meta/original/3X/6/a/6a907135c725d5cab48fe24af9446527eb17bdde.png)

Don’t worry about it @merefield I’ve turned it off again 🙂

[Vorige pagina](https://meta.discourse.org/t/locations-plugin/69742.md?page=7)

[Volgende pagina](https://meta.discourse.org/t/locations-plugin/69742.md?page=9)
