Locations Plugin

(Rich) #263

Another feature request, this time from some of our club members :slight_smile:

You’ll recall we often arrange meetings in fields and pub car parks which don’t reverse geocode nicely, hence needing a lat/lng sometimes.

Well, some of our members often use what3words as it’s on 3m accuracy which is ideal for our club meetups.

It’d be great to be able to enter what3words and populate the lat/lng from them :+1:

(Angus McLeod) #264

That would be awesome! You can help translate it here: https://www.transifex.com/civically/discourse-locations

You can change this text in Customize > Text Content > enter “user.map_location.warning”.

You could achieve this by pairing this plugin with my Custom Wizard plugin. You’ll see an example of just that when you sign up for an account on my sandbox.

What3words is cool. However, this is not a priority as an additional feature. I want to bed down the existing functionality first.

@Richie I’ll take a look at your bug on the weekend.

(Keven Naphtali) #265

Hey Angus,

I was looking at the css of the locations map, wondering if I could style markers differently depending on which category they come from. Do you see a way that this is possible currently without any modifications to the plugin?

The changes you made to the coordinates only locations work great. Brilliant.

(Rich) #266

D’oh!! Thanks :blush:

Thanks @angus, it’s confusing quite a few people!

Cheers :+1:

(Jeremie Leroy) #267

Hi @angus,

i have all the plugins updated but on the maps, when you click on the pin point, it leads to the wrong URL’s.

Example :
if you click any pinpoint on the map here : Offres - Français à Londres

or here : Sortir - Activités - Français à Londres

am’ i the only one with this behavior?

(Angus McLeod) #268

I’ve just pushed an update that should address this. Let me know how it goes.

(Jeremie Leroy) #269

:+1: great :clap:.

Thanks a lot

(Rich) #272

Hey @angus

I’m unable to add a minus value here?

(Mittineague) #273

The “0 to 2000000000” indicates the value should be positive. And because it is 2000000000 instead of 360, it suggests it is a database type limitation.

A work-around should be to give a positive only value eg.
360 - 2.46 = 357.54

(Rich) #274

Interesting… but then that is no longer a valid set of Latitude / Longitude co-ordinates?

(Rich) #275

And has something changed on this plugin recently re user locations?

Users are currently unable to remove an existing Map Location from their profile? :thinking:

They can change it with no problems, but they can’t remove it?

(Mittineague) #276

It may not be the typical way to express it, but I don’t see why it wouldn’t be correct. (for longitude, not latitude). If you go around in a circle far enough you’re back where you started.

What happened when you tried it?

(Rich) #277

The map didn’t change :frowning:

(Angus McLeod) #278

@Richie Thanks for your reports.

I’ve pushed a fix for the issue with removing user locations.

I’ve also pushed a fix to allow for minus values in the location map center coordinates settings.

I’ve also merged in @Sudaraka’s work that adds the user map location to the user card!



(Rich) #279

Dear @angus and @Sudaraka

Thank you guys, this is simply fantastic work, it really is!

I installed the update this morning and sure enough, the user cards now display the “Map Location” value perfectly:

Similarly, I am now also able to enter the centre lat/lng points for the UK in the admin panel:


And last but not least, users are able to remove a Map Location from their profile and successfully save the changes.

What can I say…?

Thank you once again gentlemen, my life is now complete :bowing_man:

(Keven Naphtali) #280

What is the correct way to control the zoom of the main topic map: location map zoom, location map marker zoom, or location map expanded zoom. None of these settings seem to have any effect on my main topic map (I’d like it to be a little more zoomed in at the beginning). One of them does effect the zoom of the individual maps on the topic page, but I can’t remember which at this time. Are my markers causing the zoom level automatically?

I would just like the zoom level so that the whitespace at the top won’t appear.

(Angus McLeod) #281

The relevant setting is location map zoom, but yes, the default zoom is overridden if there are markers it’s trying to fit. In that case it uses the inbuilt zoom functionality of leaflet.js.

That said, I agree it’s not ideal. I have the same issue on my sandbox: Angus’ Sandbox

I’ll take a look at the issue this weekend.

(Keven Naphtali) #282

Awesome. Thanks. Ability to control the leaflet marker clustering distance would be a nice feature as well. As well as custom css tags for location markers originating from different categories.

(Kartik Singhal) #283

This setting doesn’t seem to be working since the recent update/upgrade (performed through Discourse admin interface):

The following UI doesn’t change even after swapping the location input fields toggle several times:

Anyone else facing the issue? @angus can you take a look when you get a chance?

(Rich) #284

Hey @k4rtik

I just checked my Discourse and we are still able to add location co-ordinates:

So out of interest, I unticked the “Enable location input fields” and refreshed.

Strangely enough, even with it unticked and saved, I was still able to add location co-ords to a new post.

I’m guessing there is a bug somewhere which means this value is not actually being changed in the background and it’s left “stuck” on whatever the previous 0 / 1 value was?

@angus can you replicate?