Locations Plugin

Thank you @m4ur1c3! :+1:


Got it, thanks.

Don’t forget this is free software. That’s quite a requirement. :). It’s often burden enough to support plugins to remain compatible with the latest version of Discourse.

We might consider a funded project to deliver such an enhancement but it would be quite involved.

We might use some post level markup scheme.


@merefield What are your thoughts about this requirement?

1 Like

Stefan apologies for not getting back to you. That’s a more practical consideration and quite a nice idea. I’ll consider it when I have some downtime. It won’t happen for a while though as have client work atm. Funding will always help to get stuff implemented/sooner.


No worries, I had thought it might have slipped through. Should I open a feature request somewhere?


Sure, here: Feature Request


Done! :heavy_check_mark::blue_heart: @everyone Please support this feature request! :+1: :blush:


I’ve released a significant performance fix that got rid of a duplicate call:

So the User Map should become responsive much sooner.

PS thanks to @Richie for pointing out the scalability challenge and helping me with the testing.

Here’s his impressive User Map to prove you can get this working for over 500 people!:


Thanks for the continued development of the plugin @merefield :slight_smile:


When I click on a marker on the map then the redirection raise an error in the browser console :

TypeError: "u is undefined"
    navigatedToPost _application-2f2672bcf25571484a5186c75f87af2bb65928918a5bc5c9932f237dc0636348.js:9981
    routeTo _application-2f2672bcf25571484a5186c75f87af2bb65928918a5bc5c9932f237dc0636348.js:9898
    routeTo _discourse-custom-wizard-05c36c40f360683b056c7ad300041bc66902371a17c22f1686fa56420a8af7c1.js:1655
    afterModel _application-2f2672bcf25571484a5186c75f87af2bb65928918a5bc5c9932f237dc0636348.js:69656
    jQuery 12
    success _application-2f2672bcf25571484a5186c75f87af2bb65928918a5bc5c9932f237dc0636348.js:8950
    jQuery 4
    error _application-2f2672bcf25571484a5186c75f87af2bb65928918a5bc5c9932f237dc0636348.js:67085
    jQuery 16
    success _application-2f2672bcf25571484a5186c75f87af2bb65928918a5bc5c9932f237dc0636348.js:8950
    jQuery 4
1 Like

Outside of support period at moment but will take a look at next one.

Which map are you referring to - just tried the User map on a recent build and it works fine?


This is on a topic with a location.


New feature time! :tada:

Restricted search by country

I’ve added the ability to restrict search by the default country. This is default OFF.

Here is the new setting next to the existing related one:

This means your users, for example, will no-longer get addresses coming up in strange countries, if all they need is a single one, ie your site scope is country specific.

Credit to @Richie for proposing and funding this feature, thanks Rich!

(FYI this was stealth released a while back but not promoted)


I really like this feature! Thank you! :slightly_smiling_face:

One thing I don’t understand and no found any documentation for it. The location_user_profile_format.

I use location iq and it generate the addresses too long (street + city + county + state + country + postalcode). If I use the address format then I can restrict these parameters. Is that right?

So if I only want to display postalcode + city + street then I can do it with this setting?

I try to use the (address: number ) parameters but it doesn’t work for me. I think I am missed something :confused: It works great but too much unnecessary information in the addresses.

If you have time to add any instruction to set up this I really appreciate! :blush: Thank you!


I’m trying this amazing plugin. Seems a very solid piece of work!

The purpose of my use if having trade locations displayed on a trading category.

I have several questions:

  1. I checked location user avatar but my avatar isn’t displayed on the map. Am I missing something?

  2. location map marker category color: is it possible to change the icon shape? When I choose a colored marker, it’s a bit too round for my taste, I like the default shape.
    image image

  3. location user profile format: How do I find a list of geolocation attributes? I tried setting “address”, but the location field in the user preference was still plain text, with no location selector. :thinking:

  4. Is it possible to show the location under the topic name on the topic list? So the users will see at first glance where the sale is located (it’s quite important since it’s an international forum)

  5. If I click on the marker, I have an error:


    With this console output:

   TypeError: Cannot read property 'refresh' of undefined
   _ember_jquery-d0ba1603b80181031290e4bd850857d41d63bc4a081d7b4bf16d4e1a4e355a22.js:36991 Error while 
   processing route: topicBySlugOrId Cannot read property 'refresh' of undefined TypeError: Cannot read 
   property 'refresh' of undefined

   d0ba1603b80181031290e4bd850857d41d63bc4a081d7b4bf16d4e1a4e355a22.js:38545 Uncaught TypeError: Cannot read property 'refresh' of undefined

I don’t have custom theme components and as for the plugins, I only use procourse installer, data explorer and discourse locations.

I managed to do the 4.:

By adding this code to the the template list/topic-liste-item.raw:

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

Same issue here:


html code:

<h3 class="location-and-website">
              <div class="user-profile-location"><svg class="fa d-icon d-icon-map-marker-alt svg-icon svg-string" xmlns="http://www.w3.org/2000/svg"><use xlink:href="#map-marker-alt"></use></svg> France</div>
                <div class="user-profile-website">
                  <svg class="fa d-icon d-icon-globe svg-icon svg-string" xmlns="http://www.w3.org/2000/svg"><use xlink:href="#globe"></use></svg>
                    <a href="http://canapin.dev" rel="noopener " target="_blank">canapin.dev</a>
              <span id="ember29" class="ember-view">  <div id="ember31" class="user-location-and-website-outlet replace-location ember-view"><!----><div class="user-profile-website">
  <svg class="fa d-icon d-icon-globe svg-icon svg-string" xmlns="http://www.w3.org/2000/svg"><use xlink:href="#globe"></use></svg>
    <span title="http://canapin.dev">canapin.dev</span>

I think this issue is because location and website in one class. After I start use users location map feature this fixed.

1 Like

instead of a ‘Show Map’ button at the top of a thread, i’d prefer the map be responsive and already maximized within the constraints of the thread’s content. has something like this been considered?

Sorry @Canapin for slowness in response

This is just for the User Map I believe.

The logic to define the shape is here: discourse-locations/map-utilities.js.es6 at b76f5c42401db9d30be3499408f913493f1cdcb7 · paviliondev/discourse-locations · GitHub.

It might be a nice enhancement to allow this to be customised. PR accepted.

First turn this on:

Then there will be a new setting appearing in User Profile:


I wouldn’t worry at this stage about the more complex settings. Users just need to start typing and select the appropriate search result.

Well done for finding a solution :slight_smile:

It has been reported before. I will have a look this soon.

1 Like

Could you mock this up? I’m not clear on exactly what you mean?