Locations Plugin

  • 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 Likes

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

2 Likes

maybe default could be optionally set as collapsed or expanded. ‘show map’ button could remain as it is while map is collapsed, and button renamed to ‘hide map’ while map is expanded?

2 Likes

how much participation is required to post a feature request?

1 Like

The map location was also raised as a bug because in some instances, parts of the map were being rendered off-screen.

So, I’ve actually gone ahead and broadened the map on both mobile and desktop and made sure it keeps within the bounds of the screen. It still floats. Anything more would need to be funded.

This is slightly fiddly work as I’ve had to move elements around and be careful not to upset any of the numerous map views nor the existing map controls.

I will release it soon, but you can test it here:

git clone https://github.com/paviliondev/discourse-locations -b bigger_topic_map

Let me know if you see any issues.

2 Likes

OK I’ve gone ahead and merged that to expedite feedback. Please let me know of any issues.

2 Likes

it’s a start, thanks. i’ll be giving it a try and will let you know how it goes…

2 Likes

Hi Robert,

Thank you for the update. I really like the bigger map :slight_smile:

Little fix for mobile view (topic and user card):

COMMON CSS

.location-details .location-label-container {
    align-items: baseline;
}

.map-container.small {
        margin-top: 5px;
}

MOBILE CSS

.location-and-website.map-location-enabled .user-location-widget .map-wrapper {
    position: inherit;
}

.location-and-website.map-location-enabled .user-location-widget .map-container.small {
    top: auto;
    width: 100%;
    margin-top: 5px;
}

:warning: Little bug on topic map, when i release dragging on desktop the map close immediately.

3 Likes

Yeah I deliberately left user card map behaviour as before as was out of scope of reported bug. I don’t intend to change that at present.

I noticed the over sensitive map behaviour on touch. I’ll see what I can do when I get chance. It relates to out of bounds click to close I suspect.

2 Likes

@angus @merefield is there a parameter available that I can use to specify the map pin title/legend when adding a location via the Discourse API?

For example, when adding a new topic to our Discourse I currently post this to our forum API in order to add a Location to the topic:

This results in the map pin title/legend being identical to the topic title:

Which in our use case, is often long.

I was wondering if there was pin_legend_title element or something that I could use to pass a different title to the pin, from the discourse topic title? (as I wish to pass a shorter pin/legend title)

Something like this:

:thinking:

1 Like

Anyone else know if this is possible?

1 Like

How to default the map to be shown without first clicking?

1 Like

For the users map, look for location users map default in the Plugin settings and check Default to users map when navigating to 'Users'.

4 Likes

This is better than before! :+1:

Do you think it would be possible, in the future, to include this widened map when we click a user’s location too?

image

3 Likes