Skip to content

Conversation

@Themis3000
Copy link

@Themis3000 Themis3000 commented Dec 6, 2025

Hi there! Just thought I'd drop by and suggest that it may be a good idea to have a "view image" link when a wikimedia tag is available on a node.

An example case on my branch where an image is available. The popup shows a "View image" link.
image

An example of where the "View image" link takes you on wikimedia.
image

And an example of things being totally unchanged if wikimedia tag is not present.
image

To a user not familiar with OSM, the interface on OSM might be confusing and they might not understand an image is available at all. I thought this might help bridge the gap for those users.

What do you think? No hard feelings if it's undesirable to merge, I didn't speak to anyone about this before opening this pull request.

Thank you for your time :)

-Themis

@frillweeman
Copy link
Collaborator

Thanks for this PR! I wonder if we should just replace the stock image with one from wikimedia commons if present, cropped to fit. I'll play around with this including adding some image for ones near me and will try to have this merged tonight.

I made the mistake of working from Dunkin' where their internet is 3 Mbps down and 1 Mbps up.

@Themis3000
Copy link
Author

Themis3000 commented Dec 15, 2025

I thought about that too and looked into it. The nice no-auth api that wikimedia commons has (https://magnus-toolserver.toolforge.org/commonsapi.php) seems to not have the headers to allow cors...

We could however use the wikipedia api, and their api does permit any origin. Here's an example query: https://en.wikipedia.org/w/api.php?action=query&iiprop=url&origin=*&prop=imageinfo&titles=File%3AMinneapolis+SE+University+Ave+%26+SE+12th+Ave+Flock+Camera.jpg&format=json. That'll give us a json response that supplies a link to the image.

It'll be the full sized image. But we can get a thumbnail with some minor tweaks to the url:

original:
https://upload.wikimedia.org/wikipedia/commons/6/6d/Minneapolis_SE_University_Ave_%26_SE_12th_Ave_Flock_Camera.jpg
modified for 300px thumbnail:
https://upload.wikimedia.org/wikipedia/commons/thumb/6/6d/Minneapolis_SE_University_Ave_%26_SE_12th_Ave_Flock_Camera.jpg/300px-Minneapolis_SE_University_Ave_%26_SE_12th_Ave_Flock_Camera.jpg

I've never used vue and didn't really understand how to make a request in a component without adding a dependency (and that seemed like a poor choice), which is why I kept it simple to what I knew. It's rather annoying that there's not an obvious straightforward way to turn the file name directly into the image link without the need for an intermediary request...

I could give it a shot and give you my naive implementation if you'd like to work off of that though :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants