Locations Plugin ๐ŸŒ

@merefield What are your thoughts about this requirement?

1๊ฐœ์˜ ์ข‹์•„์š”

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.

3๊ฐœ์˜ ์ข‹์•„์š”

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

3๊ฐœ์˜ ์ข‹์•„์š”

Sure, here: Pavilion

3๊ฐœ์˜ ์ข‹์•„์š”

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

4๊ฐœ์˜ ์ข‹์•„์š”

Iโ€™ve released a significant performance fix that got rid of a duplicate call:

https://github.com/paviliondev/discourse-locations/pull/52

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!:

8๊ฐœ์˜ ์ข‹์•„์š”

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

6๊ฐœ์˜ ์ข‹์•„์š”

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
_application-2f2672bcf25571484a5186c75f87af2bb65928918a5bc5c9932f237dc0636348.js:67085:12
    error _application-2f2672bcf25571484a5186c75f87af2bb65928918a5bc5c9932f237dc0636348.js:67085
    jQuery 16
    success _application-2f2672bcf25571484a5186c75f87af2bb65928918a5bc5c9932f237dc0636348.js:8950
    jQuery 4
1๊ฐœ์˜ ์ข‹์•„์š”

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?

2๊ฐœ์˜ ์ข‹์•„์š”

This is on a topic with a location.

2๊ฐœ์˜ ์ข‹์•„์š”

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)

6๊ฐœ์˜ ์ข‹์•„์š”

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!

2๊ฐœ์˜ ์ข‹์•„์š”

Hi!
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:

   _application-0839e21515af10c83cf59df7b5c45c2f8db9404f82c4186084346bb0a0a9b425.js:63408 
   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

   _ember_jquery- 
   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.

edit:
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}}
      </div>
    {{~/if}}
4๊ฐœ์˜ ์ข‹์•„์š”

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>
                </div>
              <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>
</div>
</div>
</span>
            </h3>
2๊ฐœ์˜ ์ข‹์•„์š”

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

1๊ฐœ์˜ ์ข‹์•„์š”

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?

1๊ฐœ์˜ ์ข‹์•„์š”

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/assets/javascripts/discourse/lib/map-utilities.js.es6 at b76f5c42401db9d30be3499408f913493f1cdcb7 ยท merefield/discourse-locations ยท GitHub.

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

First turn this on:

image

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.

2๊ฐœ์˜ ์ข‹์•„์š”

Could you mock this up? Iโ€™m not clear on exactly what you mean?

1๊ฐœ์˜ ์ข‹์•„์š”

  • map size could be responsive (within layout of threadโ€™s content) with optional height limit
  • positioned below address text, above threadโ€™s content
  • no need โ€˜show mapโ€™ button
2๊ฐœ์˜ ์ข‹์•„์š”

Nice idea. If this came with option to default to collapsed view I would welcome it. PR Welcome.

2๊ฐœ์˜ ์ข‹์•„์š”