Locations Plugin

(James Hahn II) #223

You’re not wrong @Mittineague. Started in oil and gas when I moved to Texas in 2010. Was working for a company called Drillinginfo, which started as “What if we put the permits on a map and put it online?” … In 1999. Working with raster files and shapefiles is no joke. UT has a legit GIS Center and you can get a certificate in GIS & Remote Sensing at A&M. If this community works out the way I’m thinking it will, I’ll eventually have to invest in more complex development. For now, I’m not looking to run any pull requests. Was just after the best solution for bitkcor. And kinda geeking out on maps… can’t say I saw myself ever saying things like that! ha

Here’s the very rudimentary implimentation I went with last night for anyone that’s curious.

Duplicated a property listing on the site I hope to crush. Lol… If you click Show Map and zoom in enough, you’ll see the “offset wells” these guys are looking to see while evaluating deals. Honestly, it’s just dumb I was able to pull this off so quickly. @angus is a good man.

(David Taylor) #224

@angus this plugin needs an update for some recent changes in core - I’ve made a PR: FIX: Update for changes in Discourse core by davidtaylorhq · Pull Request #29 · angusmcleod/discourse-locations · GitHub

(Angus McLeod) #225

@david Thanks :+1:

@davidkingham This should fix the issue about user locations not being saved.

@jameshahnii There’s a great library of useable leaflet tile layers here: Leaflet Provider Demo

(David Kingham) #226

I wish I had better news, but it did not fix the issue :frowning:

(Rich) #227

Hi @angus we’ve installed this plugin today - fantastic work my good man!!

Can I drop a feature request? Would it be possible to add a setting to the plugin to allow us to set the User Map as the default view when people click ‘Users’ on the hamburger menu, rather than the User List view?



Thanks again mate, great job :clap:

(Rich) #228

And is this the right place to report a bug @angus?

Users are unable to remove a Map Location from their profile.

Steps to replicate:

  1. Add a Map Location to your user profile and click Save
  2. View on map, ensure pin displays
  3. Edit your profile, click the X to delete the location:


  1. Save your profile changes
  2. Reload the page, the Map Location is still there, the pin is also still visible on the map

(Angus McLeod) #229

@Richie I just pushed an update that should clearing the saving of user locations.

@davidkingham Can you double check you’re on the latest version of the plugin at /admin/plugins? I can’t repro the saving of user locations issue on the latest.

@Sudaraka Check out @Richie’s request above. Reckon you could give it a crack?

(Rich) #230

Bug fixed, thanks for the super quick response times @angus :+1:

(Rich) #231

@angus Unsure if this is a bug, by design, or user-error!

When entering latitude and longitude co-ordinates, should we be able to enter the coords, without them being reverese geocoded to the nearest ‘known’ location?


  1. We are arranging a meeting place for drone club members to fly their quadcopters
  2. The meeting place is an open field
  3. We enter the coordinates of the field, the Locations plugin offers a suggestion:

eg. 53.528176, -2.6267689


  1. We click the suggestion
  2. The pin is placed in the wrong field:

The alternative:

When entering the coordinates, if we do NOT click the suggestion and click away so the suggestion disappears, then we click Done:


Then sadly no location is added to the post at all.

Again, unsure if this is a bug or by design?

Our settings:


Thanks once again :slight_smile:

(James Hahn II) #232

This has to be some sort of anomaly because I’ve head great luck with every lat/long I’ve plugged in so far, but when I load up this one it’s off as well… Unless you go straight to OpenStreetMap. Curious.

Cheers mate!


(David Kingham) #233

I was just updating your plugin, once I updated discourse as well it started working, thanks again.

(Rich) #234

It happens on all random locations we’ve tried so far :slightly_frowning_face:

If we enter a street address, it’s fine, but 99% of our club meetup locations are in fields or car parks with no postal address.

Sometimes the marker pins are nearby:


Other times the marker pins are absolutely way off:

If we could enter the co-ordinates and not have to click on the suggested reverse geocoded location, things would be fine.

Is that possible?

Again, if we enter a lat/lng and click away from the reverse geocoded suggestion, then no location is saved in the post.

Entering a lat/lng and it just staying there would be wonderful, and none of our club members would be sent to the wrong meeting place :smiley:


(James Hahn II) #235

That’s a damn shame. Don’t know it’s much help, but we’re using OpenCageData for the map API. They allow you to add min_confidence to your API calls which would dial-in the precision on map placement. Exactly how you integrate custom JSON requests with the Locations Plugin is anybody’s guess at this point. Then again, you might know all about that… Personally, I’ve been up for 2 days trying to figure out how to add attachments to the Custom Wizard plugin. :man_student: :laughing:

(David Kingham) #236

I just noticed that locations saved in the user profile using the locations plugin do not display on the user card. If I type in some random text that doesn’t pull up a location it will display.

(Angus McLeod) #237

@Richie The issue you’re having is that you’re not seeing the coordinates input fields! They should look like this.


There was a bug, now fixed. Please try update the plugin to the latest version and try again.

(Rich) #238

Hi @angus

I installed the update which has indeed now revealed a lat/lng box! And it places the pin perfectly!! Thanks :smiley: :+1:

However, we can now no longer enter a postcode (zip code), as no reverse geocoding ‘suggestions’ are made when we do.

Is this just a setting change? Or has this introduced a new issue?

When editing a user profile and entering a user location the ‘suggestions’ still work fine, but when creating a new thread with postcode or address, no ‘show map’ icon is visible once the thread has been recreated.

To replicate, try Country ‘United Kingdom’ and Postal code: SW19 3AR

Also, the Country drop down list is no longer populated with United Kingdom, despite having that in our Settings. The drop down list keeps asking us to select a country now :slightly_frowning_face:

(Rich) #239

Hi @angus just wondering if you’ve had a chance to look in to these new issues?

Cheers :beers:

(Angus McLeod) #240

@Richie Sorry for the slow reply!

This is by design, as the plugin does not actually support reverse geocoding (yet), so if the user inputs coordinates, the plugin can’t offer suggestions, as that would require reverse geocoding.

That said, I can tweak it so that the Geocoding feature is enabled, even if the lat / lon input fields are there, however if the user actually enters something into those fields, geocoding will be disabled.

Would that suit your needs?

hm, I can’t repro this one. Are you seeing any errors in the console?


Add location on initial load:

(Rich) #241

Hi @angus :slight_smile:

Just confirm, should I be posting bugs here? Or over on github? :thinking:

I agree, and nor should it. If someone enters a lat / lng it should remain exactly at they’ve entered it :+1:

The issue now though, is if someone enters a post code (or even a full address), then no “Show Map” button appears.

But if they enter a lat/lng then the Show Map button does appear.

Eg with lat/lng, the Show Map button is visible:


Eg with Post Code (or address) only, there is NO show map button:


Before your recent bug fix which then revealed the lat/lng box we were able to enter a postcode and it would look up the address and provide us with clickable suggestions. But since we now have the lat/lng options available, the “old” post code method no longer works.

So previously, we had entered just a post code of “LA6 3AS” and suggested an address, which you then clicked on to accept, and then displayed the Show Map button:

In a nutshell, entering just a postcode (or full address) no longer displays the “Show Map” button.

(Rich) #242

And a Feature Request :blush:

Can we display a map icon to the left side of the thread, if a location has been added?

Just to make it really clear which posts have maps in use?

Perhaps the font awesome icon, fa-map-o ?