# 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:** 33

<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: [March 25, 2025, 8:59am UTC](https://meta.discourse.org/t/locations-plugin/69742/1144 "2025-03-25T08:59:15Z")

</div>

> [@dsims](#):
>
> When editing a topic to add location, the `TopicLocation` is not created, so it doesn’t appear on the map. Seems due to the `location` custom\_field string not being parsed correctly.

Cannot repro.

For something to appear on the map you need to have searched for, found and selected a specific location and then it will then have a geo location which is required for it to appear on the map.

Just giving something a name and hitting save will not instantiate a geo location and therefore it won’t appear on the map. You must select a specific returned address.

 ![This image is a simple map showing the locations and names of several cities in the United Kingdom, with markers for Oxford, Cambridge, London, Coventry, and others. (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/9/a/1/9a149493e027fce4d0abf665a0bc76b7128edc7f.jpeg)

> [@dsims](#):
>
> When viewing a category, the locations don’t appear in the topic list, because of using the “before category” outlet

Good catch. I note it will still show if the Category has a sub-Category, but that’s not particularly helpful 🙂

This is tricky, we are between a rock and hard place here.

@david would you accept a PR to add a plugin outlet:

`topic-list-after-badges`

because we can’t use `topic-list-after-title` because that will render before the badge, which looks rubbish, and we can’t use `topic-list-before-category` because that’s not rendered always?

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [March 25, 2025, 1:33pm UTC](https://meta.discourse.org/t/locations-plugin/69742/1148 "2025-03-25T13:33:50Z")

</div>

> [@merefield](#):
>
> @david would you accept a PR to add a plugin outlet:
> 
> `topic-list-after-badges`

Sounds reasonable to me. Could you make the PR to illustrate, and we can go from there

---

<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: [March 25, 2025, 2:40pm UTC](https://meta.discourse.org/t/locations-plugin/69742/1149 "2025-03-25T14:40:24Z")

</div>

Kicked that off.

[https://github.com/discourse/discourse/pull/31998](https://github.com/discourse/discourse/pull/31998)

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [March 25, 2025, 4:45pm UTC](https://meta.discourse.org/t/locations-plugin/69742/1150 "2025-03-25T16:45:49Z")

</div>

Merged, thanks @merefield

---

<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: [March 25, 2025, 4:48pm UTC](https://meta.discourse.org/t/locations-plugin/69742/1151 "2025-03-25T16:48:39Z")

</div>

Thank _you_ David!

---

<div class="post-metadata">

### Author: ![dsims](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dsims/32/485916_2.png) [@dsims](https://meta.discourse.org/u/dsims)
#### Post date: [March 26, 2025, 3:34am UTC](https://meta.discourse.org/t/locations-plugin/69742/1152 "2025-03-26T03:34:25Z")

</div>

> [@merefield](#):
>
> > [@dsims](#):
> >
> > When editing a topic to add location, the `TopicLocation` is not created, so it doesn’t appear on the map. Seems due to the `location` custom\_field string not being parsed correctly.
> 
> Cannot repro.

I added a test to confirm, and what I think is the fix:  
[https://github.com/merefield/discourse-locations/pull/124](https://github.com/merefield/discourse-locations/pull/124)

---

<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: [March 26, 2025, 8:22am UTC](https://meta.discourse.org/t/locations-plugin/69742/1154 "2025-03-26T08:22:00Z")

</div>

An excellent contribution, tricky problem, appreciate the work, thanks, merged!

---

<div class="post-metadata">

### Author: ![dsims](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dsims/32/485916_2.png) [@dsims](https://meta.discourse.org/u/dsims)
#### Post date: [March 26, 2025, 1:06pm UTC](https://meta.discourse.org/t/locations-plugin/69742/1155 "2025-03-26T13:06:18Z")

</div>

> [@david](#):
>
> Merged, thanks @merefield

Looks like it got reverted right after in this [DEV: [gjs-codemod] convert admin files to gjs · discourse/discourse@b29e0b6 · GitHub](https://github.com/discourse/discourse/commit/b29e0b6e1b6001890ce92f96448258550f80132b#diff-dda012fea84607e78927c7e3ac6c938ff46f8049cb4c8e48feebe8b3d0b56f76L347)

---

<div class="post-metadata">

### Author: ![dsims](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dsims/32/485916_2.png) [@dsims](https://meta.discourse.org/u/dsims)
#### Post date: [March 26, 2025, 3:06pm UTC](https://meta.discourse.org/t/locations-plugin/69742/1157 "2025-03-26T15:06:58Z")

</div>

You can’t see it on default theme, but I see styling issues (with [isabelle](https://meta.discourse.org/t/isabelle-an-animal-crossing-inspired-theme/145005) at least) on the maps page due to missing markup. Wrapping it with the Discovery::Layout resolved it

 ![issue](https://global.discourse-cdn.com/meta/original/4X/3/7/e/37ebf8120da1a6e71bc0d67efca63a858af72c9e.png) ![fixed](https://global.discourse-cdn.com/meta/original/4X/d/5/1/d51f0b0fa49b0cbb69a6f693d69d5ea168ea5703.png)

[https://github.com/merefield/discourse-locations/pull/125](https://github.com/merefield/discourse-locations/pull/125)

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [March 26, 2025, 4:32pm UTC](https://meta.discourse.org/t/locations-plugin/69742/1158 "2025-03-26T16:32:28Z")

</div>

> [@dsims](#):
>
> Looks like it got reverted right after in this [DEV: [gjs-codemod] convert admin files to gjs · discourse/discourse@b29e0b6 · GitHub](https://github.com/discourse/discourse/commit/b29e0b6e1b6001890ce92f96448258550f80132b#diff-dda012fea84607e78927c7e3ac6c938ff46f8049cb4c8e48feebe8b3d0b56f76L347)

Sorry about that! I had a bit of a nightmare rebasing/merging that gjs PR. New outlets are [now restored](https://github.com/discourse/discourse/commit/f277e0bce55856fb073217676351f3078404121c).

---

<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: [March 26, 2025, 4:37pm UTC](https://meta.discourse.org/t/locations-plugin/69742/1160 "2025-03-26T16:37:29Z")

</div>

Thank you (and well done @dsims for noticing).

I wonder if that was why my tests were passing locally and failing on the PR?! 😅

---

<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: [March 26, 2025, 5:10pm UTC](https://meta.discourse.org/t/locations-plugin/69742/1161 "2025-03-26T17:10:38Z")

</div>

merged, thanks!

---

<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: [March 26, 2025, 5:15pm UTC](https://meta.discourse.org/t/locations-plugin/69742/1162 "2025-03-26T17:15:43Z")

</div>

> [@merefield](#):
>
> I wonder if that was why my tests were passing locally and failing on the PR?! 😅

Yup, that was it, the missing outlets were causing my PR tests to fail … I was like … 🤔 🤔 😅

---

<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: [March 26, 2025, 5:35pm UTC](https://meta.discourse.org/t/locations-plugin/69742/1163 "2025-03-26T17:35:50Z")

</div>

> [@dsims](#):
>
> When viewing a category, the locations don’t appear in the topic list, because of using the “before category” outlet (there is no category outlet when viewing a category topic list).

This is now fixed, merged and checked out:

[https://github.com/merefield/discourse-locations/pull/123/](https://github.com/merefield/discourse-locations/pull/123/)

Let’s hear it for Locations on Topics on _Categories!_ 🍾

PS this uses the new outlets which are very useful and I’m about to apply the same change to another of my plugins … 😉

---

<div class="post-metadata">

### Author: ![thoka](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thoka/32/115652_2.png) [@thoka](https://meta.discourse.org/u/thoka)
#### Post date: [April 1, 2025, 2:35pm UTC](https://meta.discourse.org/t/locations-plugin/69742/1164 "2025-04-01T14:35:03Z")

</div>

Thanks for this great plugin.

We use it to implement a hospitality network.

I hope to get some funding in the future, to pay for more features.

Minor bug report: The general map (all categories) does not use colors of categories for pin names. All pins have the same color.

---

<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: [April 1, 2025, 2:36pm UTC](https://meta.discourse.org/t/locations-plugin/69742/1165 "2025-04-01T14:36:23Z")

</div>

> [@thoka](#):
>
> Minor bug report: The general map (all categories) does not use colors of categories for pin names. All pins have the same color.

Sounds more like a feature request to me, but a nice idea nonetheless, noted!

---

<div class="post-metadata">

### Author: ![thoka](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thoka/32/115652_2.png) [@thoka](https://meta.discourse.org/u/thoka)
#### Post date: [April 1, 2025, 2:37pm UTC](https://meta.discourse.org/t/locations-plugin/69742/1166 "2025-04-01T14:37:47Z")

</div>

Ah, sorry. It seems I misunderstood the documentation.

There will be plenty of feature requests, if you like to hear them, without me having money 😇.

---

<div class="post-metadata">

### Author: ![Roi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/roi/32/130587_2.png) [@Roi](https://meta.discourse.org/u/Roi)
#### Post date: [April 1, 2025, 9:04pm UTC](https://meta.discourse.org/t/locations-plugin/69742/1167 "2025-04-01T21:04:14Z")

</div>

Hm, the search does not work here at the moment. Strange.

Anyway, is it possible to hide the user location and also the user map if not logged into Discourse or maybe also just being TL0?

---

<div class="post-metadata">

### Author: ![nathank](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nathank/32/290039_2.png) [@nathank](https://meta.discourse.org/u/nathank)
#### Post date: [April 2, 2025, 2:59am UTC](https://meta.discourse.org/t/locations-plugin/69742/1168 "2025-04-02T02:59:08Z")

</div>

I’m afraid that isn’t possible right now - although I’d be very keen on it too!

A less than perfect solution is to make sure there are no links to the map reachable by anon, and that the map itself is hidden if someone shares the link; I use this:

```plaintext
// hide user map from anon
.anon div.users-map-container {
    display: none;
}

```

Of course, you won’t stop anyone with good technical skills who knows what they are looking for, but you’ll prevent the casual 99% (equivalent to a cheap bike lock in my mind).

This is the sort of thing that would be appropriate to sponsor for this plugin.

---

<div class="post-metadata">

### Author: ![Roi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/roi/32/130587_2.png) [@Roi](https://meta.discourse.org/u/Roi)
#### Post date: [April 2, 2025, 9:27pm UTC](https://meta.discourse.org/t/locations-plugin/69742/1169 "2025-04-02T21:27:25Z")

</div>

> [@nathank](#):
>
> A less than perfect solution is to make sure there are no links to the map reachable by anon, and that the map itself is hidden if someone shares the link; I use this:

Yeah, thank you. I was aware of the CSS “solution”. But, as you said, not really perfect. And I would guess that search engines crawl and show this information in the search results anyway.

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

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