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

<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: [January 29, 2022, 3:06am UTC](https://meta.discourse.org/t/locations-plugin/69742/753 "2022-01-29T03:06:14Z")

</div>

Check the setting `location users map limit`. If it’s lower than the number of users who have added their location, the ones after the limit number will not be shown on the map.

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [January 29, 2022, 10:51am UTC](https://meta.discourse.org/t/locations-plugin/69742/754 "2022-01-29T10:51:57Z")

</div>

That was it. Thanks. 😄

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [February 13, 2022, 12:48pm UTC](https://meta.discourse.org/t/locations-plugin/69742/755 "2022-02-13T12:48:50Z")

</div>

Some of my users encounter a rate limit with the default provider (nominatim) that makes them wait one minute before trying again.

Weirdly, I don’t come across any kind of limit.

See: [The location field in profile is kind of broken - Forum Feedback - Unicyclist.com](https://unicyclist.com/t/the-location-field-in-profile-is-kind-of-broken/272949)

1. Any idea why I don’t encounter any limit whereas some users encounter it? I tried writing long locations’ names while typing fast.
2. What would be your second choice for the **location\_geocoding\_provider** setting (for a free usage)?
3. What’s the **location\_geocoding\_debounce** setting?

* * *

I see that in nominatim’s [usage policy](https://operations.osmfoundation.org/policies/nominatim/) that “ **Auto-complete search** This is not yet supported by Nominatim and you must not implement such a service on the client side using the API.”

There is no auto-completion in the location button on a new topic, but there is one in the custom user field:

![image](https://global.discourse-cdn.com/meta/original/3X/0/b/0bdb8d4e18619ed307b3c75e1507557b53ec6c83.png)

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

![chrome_tOtNSZ2dXy](https://global.discourse-cdn.com/meta/original/3X/2/c/2c9091b1541cc35b6f20027acc1e14a50eae37bf.gif)

1. Is this a forbidden usage? 🤔

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [February 13, 2022, 3:26pm UTC](https://meta.discourse.org/t/locations-plugin/69742/756 "2022-02-13T15:26:58Z")

</div>

> [@Canapin](#):
>
> Is this a forbidden usage?

Yes, and no. Mostly no. It can be against GDPR, if the location comes automatically without user’s action AND the site is driven by a company or community, meaning not a private person, AND it is not needed.

But… geo-location is really unaccurate. I don’t know how things are in France but in Finland all operators act countrywide so every time my IP changes, changes my location and everytime it points to wrong city.

And IP is not considered as personal data, but more or less as public data that cannot use to identify a single person.

But in use of the plugin geo-location isn’t forbidden, prohibited or unlegal, because an user wants to show it. And using IP as source of location is never unlegal.

There can be some more moral issues, though. But it depends of forum.

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [February 13, 2022, 6:05pm UTC](https://meta.discourse.org/t/locations-plugin/69742/757 "2022-02-13T18:05:49Z")

</div>

I may misunderstand how the plugin works actually. I’ll have to read all this topic. Thanks for your reply. 🙂

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [February 13, 2022, 11:32pm UTC](https://meta.discourse.org/t/locations-plugin/69742/758 "2022-02-13T23:32:39Z")

</div>

You can only use Nominatim for testing. For production use I would recommend

> **[OpenCage - Easy, Open, Worldwide, Affordable Geocoding and Geosearch](https://opencagedata.com/)**
>
> Easy-to-use forward and reverse geocoding API. Worldwide coverage. Affordable, predictable pricing. GDPR-compliant, made with open data, and trusted by thousands of developers

---

<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 28, 2022, 2:00pm UTC](https://meta.discourse.org/t/locations-plugin/69742/759 "2022-02-28T14:00:55Z")

</div>

Just following this up from last month, apologies, I’d somehow missed any notifications to replies 🤦‍♂️

> [@Richie](#):
>
> Does anyone what’s causing the text on my user map to be so small? 🤔

> [@merefield](#):
>
> what version of Leaflet is it using?

Our other site, which is displaying the larger text is using Leaflet v1.5.1

I see the Locations plugin was 1.3.4 and is now 1.7.1, which means the version isn’t an issue.

> [@merefield](#):
>
> FYI on it’s own it does NOT explain the differences observed above

Agreed.

Just to remind people, the text is so small on our Locations map that it’s unreadable.

Example with screen shots here: [Locations Plugin 🌍 - #736 by Richie](https://meta.discourse.org/t/locations-plugin/69742/736)

> [@merefield](#):
>
> Do you have the source code for the javascript call for non-Locations Plugin map? It might show why there’s a difference

Thanks Robert @merefield yes I do have access to the source of the other site where the text is larger but on the same basemap.

The difference I believe is that there is an additional parameter being passed:

`tileSize: 512`

It’s applied in this context:

```plaintext

// Attribution
var mbAttr = 'Map &copy; <a href="https://www.openstreetmap.org/">OpenStreetMap</a>, Imagery © <a href="https://www.mapbox.com/">Mapbox</a>, Content &copy; <a href="https://GreyArro.ws/">Grey Arrows Drone Club</a>',
	mbUrl = 'https://api.mapbox.com/styles/v1/mapbox/{id}/tiles/{z}/{x}/{y}?access_token=<%=Variabs.GlobalVariables.strOpenStreetMapKey%>',
	mbMaxZoom = '20'
;

// Basemaps
var
	// Full list: https://gis.stackexchange.com/a/244797/145060
	// Full list: https://docs.mapbox.com/help/troubleshooting/migrate-legacy-static-tiles-api/#which-classic-styles-are-being-deprecated
	// Full list: https://docs.mapbox.com/api/maps/#mapbox-styles
	dark = L.tileLayer(mbUrl, { id: 'dark-v10', maxZoom: mbMaxZoom, attribution: mbAttr, tileSize: 512, zoomOffset: -1 }),
	road = L.tileLayer(mbUrl, { id: 'outdoors-v11', maxZoom: mbMaxZoom, attribution: mbAttr, tileSize: 512, zoomOffset: -1 }),
	satellite = L.tileLayer(mbUrl, { id: 'satellite-v9', maxZoom: mbMaxZoom, attribution: mbAttr, tileSize: 512, zoomOffset: -1 }),
	hybrid = L.tileLayer(mbUrl, { id: 'satellite-streets-v11', maxZoom: mbMaxZoom, attribution: mbAttr, tileSize: 512, zoomOffset: -1 })
;
```

Therefore, I think I have a feature request 🙂

Please can we add a `tileSize` to the plugin settings?

Unless I can somehow pass the desired tilesize in the `Map tile layer uri ` setting? 🤔

---

<div class="post-metadata">

### Author: ![Don](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/don/32/228726_2.png) [@Don](https://meta.discourse.org/u/Don)
#### Post date: [May 20, 2022, 1:43pm UTC](https://meta.discourse.org/t/locations-plugin/69742/760 "2022-05-20T13:43:02Z")

</div>

Hello,

I noticed an issue with composer location button I think.  
Discourse version [a6abf8d07a](https://github.com/discourse/discourse/commits/a6abf8d07a3dbf50a9d8684a87dfb22a1b0dffc6)

 ![Screenshot 2022-05-20 at 14.55.30](https://global.discourse-cdn.com/meta/original/4X/6/6/8/6688410b5e862aa3f39b7183a9394c0e974fd56f.png)

Thank you 🙂

---

<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: [May 20, 2022, 4:43pm UTC](https://meta.discourse.org/t/locations-plugin/69742/761 "2022-05-20T16:43:23Z")

</div>

Thanks @Don I can repro, although it doesn’t seem to stop the show, I’ll take a look v soon

---

<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: [May 21, 2022, 8:21am UTC](https://meta.discourse.org/t/locations-plugin/69742/762 "2022-05-21T08:21:02Z")

</div>

It’s due to a breaking change from this commit in core: [FIX: Use CSS transition to make room for composer (#16750) · discourse/discourse@9ea8a4a (github.com)](https://github.com/discourse/discourse/commit/9ea8a4a9afac12cd2e31b9e2f994425cf1b21866)

I’ve pushed a fix together with some minor formatting tweaks to improve the L&F:

[https://github.com/paviliondev/discourse-locations/pull/67](https://github.com/paviliondev/discourse-locations/pull/67)

---

<div class="post-metadata">

### Author: ![Don](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/don/32/228726_2.png) [@Don](https://meta.discourse.org/u/Don)
#### Post date: [May 21, 2022, 9:05am UTC](https://meta.discourse.org/t/locations-plugin/69742/763 "2022-05-21T09:05:32Z")

</div>

Thank you Robert 🙂 I am really appreciate you fix this so quickly out of maintenance time. I will update soon and update this post as well how it works. 🙂

Works fantastic thanks again! 🙂

---

<div class="post-metadata">

### Author: ![Ben\_Evans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ben_evans/32/211617_2.png) [@Ben\_Evans](https://meta.discourse.org/u/Ben_Evans)
#### Post date: [June 14, 2022, 4:38am UTC](https://meta.discourse.org/t/locations-plugin/69742/764 "2022-06-14T04:38:21Z")

</div>

Hi. Anyone know if it’s possible somehow to add a location to a map by dropping a pin with this plugin?

The locations of some communities are in places that are hard to identify without the use of coordinates, which might put some users off adding a location. 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: [June 14, 2022, 6:35am UTC](https://meta.discourse.org/t/locations-plugin/69742/765 "2022-06-14T06:35:59Z")

</div>

I was sure someone requested this before but it’s not on the current list afaics.

Feature requests can be made here: [Pavilion](https://thepavilion.io/w/feature-request/steps/step_1)

But please note we are usually busy enough maintaining the plugins that new features are rare without someone sponsoring the work.

We would also welcome PRs. This is an especially good feature to add.

---

<div class="post-metadata">

### Author: ![Don](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/don/32/228726_2.png) [@Don](https://meta.discourse.org/u/Don)
#### Post date: [July 4, 2022, 9:48am UTC](https://meta.discourse.org/t/locations-plugin/69742/766 "2022-07-04T09:48:31Z")

</div>

Hello,

I noticed an issue with location under topic title. If a user remove a previously added location from `/preferences/profile`  
Then it will show an empty location under topic title instead of remove it.

 ![Screenshot 2022-07-04 at 11.41.30](https://global.discourse-cdn.com/meta/original/4X/b/9/b/b9b2907674abf91e22a064710e06171d2a2cefb3.png)

Thank you 🙂

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [August 15, 2022, 7:39pm UTC](https://meta.discourse.org/t/locations-plugin/69742/767 "2022-08-15T19:39:13Z")

</div>

Hi!

I’ve modified `list/topic-list-item.raw` template to display the location on the topic list:

 ![image](https://global.discourse-cdn.com/meta/original/4X/5/2/6/526321e6a2d7cd7781dbe05746fb2aba6a52a2f6.png)

```handlebars
    {{#if topic.location}}
      <div class="title-location">
        {{d-icon 'map-marker-alt'}} {{location-format topic.location opts}}{{location-label-container}}
      </div>
    {{/if}}

```

But I think my condition isn’t properly written, because if I disable the plugin, the topic list loop breaks.

What would be the correct way to check if the topic location exists in the handlebars template?

---

<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: [August 15, 2022, 8:08pm UTC](https://meta.discourse.org/t/locations-plugin/69742/768 "2022-08-15T20:08:54Z")

</div>

> [@Canapin](#):
>
> `list/topic-list-item.raw`

Overriding this seems a bit extreme, why not use connectors?:

`topic-list-after-title` OR  
`topic-list-before-category`

Take a look at [An interesting strategy for passing properties via raw template plugin outlets](https://meta.discourse.org/t/an-interesting-strategy-for-passing-properties-via-raw-template-plugin-outlets/210054)

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [August 15, 2022, 8:42pm UTC](https://meta.discourse.org/t/locations-plugin/69742/769 "2022-08-15T20:42:05Z")

</div>

> [@merefield](#):
>
> Overriding this seems a bit extreme, why not use connectors?:

Because I didn’t find the right ones (or maybe they didn’t exist at the time I modified the template, about 2 years ago) 😅

Will probably be easier this way, I’ll give it a try, thanks!

* * *

Uh… Can’t achieve to use these connectors.

> **Boring stuff I've tried and looked at**
>
> I’ve read [Developing Discourse Themes & Theme Components](https://meta.discourse.org/t/developer-s-guide-to-discourse-themes/93648#handlebars-templates-21).
> 
> Assuming this is how we add HTML code in a connector:
> 
> ```xml
> <script type="text/x-handlebars" data-template-name="/connectors/topic-above-post-stream/test">
> <div style="height: 200px; width: 200px;background: red"></div>
> </script>
> 
> ```
> 
> I tried
> 
> ```xml
> <script type="text/x-handlebars" data-template-name="/connectors/topic-list-after-title/test">
> <div style="height: 200px; width: 200px;background: red"></div>
> </script>
> 
> ```
> 
> But it didn’t work. Is that because `topic-list-item` is a `.hbr` and not a `.hbs` file?
> 
> I used [(deprecated) Plugin outlet locations theme component](https://meta.discourse.org/t/plugin-outlet-locations-theme-component/100673) but the outlets inside the topic list don’t show up.
> 
> ![image](https://global.discourse-cdn.com/meta/original/4X/f/f/9/ff910c2a50fdb1cffa8e53337b7bb5918cb7991e.png)
> 
> I also looked at this [What is the difference between raw.hbs handlerbar files and only .hbs handlerbar files?](https://meta.discourse.org/t/what-is-the-difference-between-raw-hbs-handlerbar-files-and-only-hbs-handlerbar-files/58565).

Or maybe I just need to create a theme component with an additional file, like this [https://github.com/discourse/discourse-topic-thumbnails/blob/main/javascripts/discourse/connectors/topic-list-before-link/topic-thumbnail.hbr](https://github.com/discourse/discourse-topic-thumbnails/blob/main/javascripts/discourse/connectors/topic-list-before-link/topic-thumbnail.hbr)?

But here, new connectors are created, while `topic-list-after-title` and `topic-list-before-category` already exist… So I’m a bit puzzled here.

---

<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: [August 24, 2022, 9:34pm UTC](https://meta.discourse.org/t/locations-plugin/69742/770 "2022-08-24T21:34:35Z")

</div>

Maybe this helps?:

![image](https://global.discourse-cdn.com/meta/original/4X/1/d/d/1ddb9e1ea20367ec026eea39d06a3ac2445a0609.png)

![image](https://global.discourse-cdn.com/meta/original/4X/6/e/9/6e956038fcd064c2d48cd230fffac26f3475f774.png)

```plaintext
{{context.topic.location.street}}

```

![image](https://global.discourse-cdn.com/meta/optimized/4X/f/2/2/f22c2e9de1bbb85bc1a2f419ec040d222b7811b3_2_690x66.png)

or even better:

```plaintext
{{location-format context.topic.location}}

```

which leads to:  
 ![image](https://global.discourse-cdn.com/meta/optimized/4X/5/0/1/501a93f442d70c2668004fa23eea15a5528a7929_2_690x37.png)

which you can then refine with CSS (eg move to new line).

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [August 24, 2022, 10:42pm UTC](https://meta.discourse.org/t/locations-plugin/69742/771 "2022-08-24T22:42:38Z")

</div>

Yup, perfect, thanks a lot Robert!

[https://github.com/Canapin/topic-list-locations](https://github.com/Canapin/topic-list-locations)

So, for those who are interested, this theme component simply adds the locations to the topic list.

 ![](https://global.discourse-cdn.com/meta/original/4X/7/0/d/70ded77fbe9275b703753c3cd9feff191257fc5a.png)

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [August 26, 2022, 10:25pm UTC](https://meta.discourse.org/t/locations-plugin/69742/772 "2022-08-26T22:25:18Z")

</div>

Using the outlet is way more elegant, but there is an issue.

The outlet location is just after the topic title… And before the badges div (where it shows the dot indicating unread messages or new topics). The result:

 ![image](https://global.discourse-cdn.com/meta/original/4X/1/6/b/16b56ffc66ab11f11fce65b6934d041455d222c4.png)

I see no easy solution to fix this, even with CSS (I tried stuff).

I also feel that asking for a new outlet in #Contribute > Feature wouldn’t be interesting enough to be added to Discourse.

* * *

Edit: I made it so the badge is next to the location. That will do.

![image](https://global.discourse-cdn.com/meta/original/4X/c/8/6/c865509fda6179a77aed6c77cba094c0fb8d9d6c.png)

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

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