# Locations Plugin 🌍

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

<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: [February 2, 2024, 2:40pm UTC](https://meta.discourse.org/t/locations-plugin/69742/1022 "2024-02-02T14:40:34Z")

</div>

It’s about the same, 8 seconds or so 🙂

---

<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: [February 2, 2024, 2:41pm UTC](https://meta.discourse.org/t/locations-plugin/69742/1023 "2024-02-02T14:41:59Z")

</div>

OK so that’s server side and not much I can do about it.

Can you look at CPU and memory use when it’s running?

You might have to throw some bigger hardware at it?

---

<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: [February 2, 2024, 2:44pm UTC](https://meta.discourse.org/t/locations-plugin/69742/1024 "2024-02-02T14:44:22Z")

</div>

Thank’s Robert 🙂

Idle most of the time:

 ![Screenshot 2024-02-02 at 14.42.40](https://global.discourse-cdn.com/meta/original/4X/6/c/c/6cc576a93e980e63ef7534ad76cbc3f2e7b11c34.png)

Under load when hitting that URL:

 ![Screenshot 2024-02-02 at 14.41.54](https://global.discourse-cdn.com/meta/original/4X/b/7/0/b7086ba0afe9237505dffc39e15c757b1a5135a3.jpeg)

I only upgrade the hardware last week to double the previous spec, I’ll have to leave it at that 🙂

Thanks again!

---

<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: [February 2, 2024, 2:51pm UTC](https://meta.discourse.org/t/locations-plugin/69742/1025 "2024-02-02T14:51:21Z")

</div>

Ideally we’d have some streaming solution that just sent the clusters and dug into those as you zoomed in.

If anyone wants to fund that I’m available to discuss, but that’s far from a simple job, I suspect - I’m not even sure we can use the Leaflet plugin as is …

PR welcome.

---

<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: [February 2, 2024, 2:52pm UTC](https://meta.discourse.org/t/locations-plugin/69742/1026 "2024-02-02T14:52:40Z")

</div>

Does performance improve the second time you view it?

It would make sense if this was cached at the very least …

---

<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: [February 2, 2024, 2:55pm UTC](https://meta.discourse.org/t/locations-plugin/69742/1027 "2024-02-02T14:55:30Z")

</div>

No, it’s the same every time 🙂

---

<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: [February 2, 2024, 2:56pm UTC](https://meta.discourse.org/t/locations-plugin/69742/1028 "2024-02-02T14:56:09Z")

</div>

OK so in this mode, it’s not being cached at all then 😲

I’m not sure how much influence I can have on that, but it’s using the “Store” so I’m a little surprised …

---

<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: [February 2, 2024, 2:58pm UTC](https://meta.discourse.org/t/locations-plugin/69742/1029 "2024-02-02T14:58:24Z")

</div>

No worries, appreciate you looking at it 😃

---

<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: [February 2, 2024, 3:02pm UTC](https://meta.discourse.org/t/locations-plugin/69742/1030 "2024-02-02T15:02:39Z")

</div>

It’s odd not to cache this at least once a day imho.

but I guess you are unlikely to want to look at it more than once a day, so moot?

Remember that Chatbot can tell you who is nearby a location or specific User.

---

<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: [February 2, 2024, 3:04pm UTC](https://meta.discourse.org/t/locations-plugin/69742/1031 "2024-02-02T15:04:45Z")

</div>

I’m unsure how many times a day our members might look at the map 🙂

Random thought, is the caching a setting that might be off? 🤔

---

<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: [February 2, 2024, 6:38pm UTC](https://meta.discourse.org/t/locations-plugin/69742/1032 "2024-02-02T18:38:44Z")

</div>

About 4 seconds to load ~1800 members on our map using the Nominatim provider and about 3 seconds to load the `/directory_items.json?period=location` query

---

<div class="post-metadata">

### Author: ![fokx](https://avatars.discourse-cdn.com/v4/letter/f/958977/32.png) [@fokx](https://meta.discourse.org/u/fokx)
#### Post date: [February 4, 2024, 4:42am UTC](https://meta.discourse.org/t/locations-plugin/69742/1033 "2024-02-04T04:42:58Z")

</div>

@merefield I made a PR, please review  
[https://github.com/paviliondev/discourse-locations/pull/110](https://github.com/paviliondev/discourse-locations/pull/110)

---

<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: [February 4, 2024, 8:03am UTC](https://meta.discourse.org/t/locations-plugin/69742/1034 "2024-02-04T08:03:48Z")

</div>

Thanks I’ll review!

---

<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: [February 4, 2024, 8:47am UTC](https://meta.discourse.org/t/locations-plugin/69742/1035 "2024-02-04T08:47:45Z")

</div>

I can’t really justify looking at this in detail without funding as your sites are outliers.

One thing you can look into if you have the motivation and time is track down the database queryplan that is running when `/directory_items.json?period=location` is running on your server and share that with the community.

There is an index on the locations\_user table, but it may not be being used, as its basically two large tables being “zipped” together, so PSQL may just give up on using the index whilst performing the INNER join.

The query is simpler these days, though, since the Ember 5 work, so theoretically should be faster.

You could also please investigate how long that query is taking. It might be a serialisation issue not a query performance issue.

Another thing we could look at is simplifying the serialisation as there’s probably a lot of unnecessary data being downloaded.

```plaintext
            "id": 42348,
            "user": {
                "id": 4928,
                "username": "bob",
                "name": "",
                "avatar_template": "/user_avatar/mysite.org/bob/{size}/348_2.png",
                "title": null,
                "trust_level": 2,
                "geo_location": {
                    "lat": "5.5219",
                    "lon": "-0.564",
                    "address": "London, Greater London, England, United Kingdom",
                    "countrycode": "gb",
                    "city": "London",
                    "state": "England",
                    "country": "United Kingdom",
                    "postalcode": "",
                    "boundingbox": [
                        "51.2867601",
                        "51.6918741",
                        "-0.5103751",
                        "0.3340155"
                    ],
                    "type": "administrative"
                }
            }

```

We don’t need two thirds of this. I will accept a PR to cut this down. Or you can fund me to look at this.

Another thing you might want to look at is how you might beef up your PSQL server somehow. Can you migrate to a _much_ faster VPS somehow? However, I think we should do due diligence on the efficiency of code first before you consider this.

If you are prepared to fund some performance tuning work here let me know or PR welcome!

---

<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: [February 9, 2024, 7:11am UTC](https://meta.discourse.org/t/locations-plugin/69742/1036 "2024-02-09T07:11:22Z")

</div>

I have a confusing support request 🙂

I’ve got two “Members Map” options in my burger menu today, and I’m not sure how the second one is getting in there.

> I renamed them all this morning to help me track down where it might be coming from, hence `1` and `2` that you’ll see in this screen shot.

Here’s how it looks:

 ![Screenshot 2024-02-09 at 07.01.05](https://global.discourse-cdn.com/meta/original/4X/3/7/1/3714b2932358920da3353338e80cf85b79b6a24a.png)

`Members Map1` is the one I want to keep, and it got there because I put it there by clicking on Customise:

 ![Screenshot 2024-02-09 at 07.03.18](https://global.discourse-cdn.com/meta/original/4X/6/3/4/634157f61d41501250dbff98c9253e7a8c84f918.png)

The settings for the Locations plugin are set to _not_ add it to the menu. If I toggle this, it appears as the word `Map`, so it’s definitely _not_ this one:

 ![Screenshot 2024-02-09 at 07.04.05](https://global.discourse-cdn.com/meta/original/4X/9/0/d/90d903fc0bd1e18390ac507d0bc3f38b62d9614d.png)

If I customise the `Text` for my Discourse, and search for `Members Map` then I get two results. I renamed these to both `2` and `3` to aid with the trace.

You’ll see here, it’s the `2` one that’s also appearing in my menu.

Does anyone know what `js.directory.map.title` is and how it might be getting in my menu?

 ![Screenshot 2024-02-09 at 07.05.28](https://global.discourse-cdn.com/meta/original/4X/f/1/4/f144a1dc52ffb8ae397ec0d0da4498351f8efa79.png)

The only thought I had was that last year we used to run the [Custom Hamburger Menu Links](https://meta.discourse.org/t/custom-hamburger-menu-links/87644) theme but I removed it when we switched to the new Discourse menu layout. Could something have been left over from that perhaps? 🤔 If so I’ll move this post elsewhere 😊

---

<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: [February 9, 2024, 8:01am UTC](https://meta.discourse.org/t/locations-plugin/69742/1037 "2024-02-09T08:01:42Z")

</div>

See [Locations Plugin 🌍 - #1015 by merefield](https://meta.discourse.org/t/locations-plugin/69742/1015)

Again, PR welcome or you can fund me to improve this.

Workaround for now: don’t add your own entry, or delete the current one with CSS.

---

<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: [February 9, 2024, 9:30am UTC](https://meta.discourse.org/t/locations-plugin/69742/1038 "2024-02-09T09:30:12Z")

</div>

> [@merefield](#):
>
> PR welcome

Ah, right, at least I know I’m not going mad 😃

Thanks Robert!

---

<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: [February 9, 2024, 2:12pm UTC](https://meta.discourse.org/t/locations-plugin/69742/1039 "2024-02-09T14:12:23Z")

</div>

> [@merefield](#):
>
> or delete the current one with CSS

If it helps anyone else, I’ve added this to hide it:

```plaintext
/* Hide the second Users Map link from the site menu - REF: https://meta.discourse.org/t/locations-plugin/69742/1037 */
.sidebar-section-link-wrapper {
     .sidebar-section-link {
         &[data-link-name="users map"] {
         display: none;
         }
     }  
}

```

---

<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: [February 22, 2024, 8:37pm UTC](https://meta.discourse.org/t/locations-plugin/69742/1040 "2024-02-22T20:37:58Z")

</div>

Question: Entire entered addresses used to show up under the topic header next to the map icon. Lately only the map icon shows up but not the address itself. Is this a recent change? Is there a way to have the address show up again? Thanks!

 ![SNAG-0004](https://global.discourse-cdn.com/meta/original/4X/8/3/c/83cf34f0c2b6810b1f3e8eaba78dd8ba7616253a.png)

---

<div class="post-metadata">

### Author: ![fokx](https://avatars.discourse-cdn.com/v4/letter/f/958977/32.png) [@fokx](https://meta.discourse.org/u/fokx)
#### Post date: [May 20, 2024, 6:38am UTC](https://meta.discourse.org/t/locations-plugin/69742/1041 "2024-05-20T06:38:44Z")

</div>

Robert, do you have any plan to support displaying a whole-site map based on all users’ IP addresses?

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

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