-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Embed Hitchmap in Hitchwiki #95
Comments
Beware of having the same functionality in multiple issues, just reference #38 Hitchmap is pretty heavy to embed, the interface would probably be pretty bad in the small square. Iframes are generally discouraged in mobile interfaces. How about using a static image that links to the Hitchmap view? Hitchmap can render an svg of all spots in a bounding box, then we just need to find a server that can provide the background map |
Yes, there are a few options to get OpenStreetMap (OSM) map images with a specified center point, zoom level, and custom size. Here are some popular options: 1. OSM Static Map ServicesSome servers allow you to create static map images without needing to set up your own tile server.
2. Mapbox Static Images APIMapbox provides access to OSM-based maps and supports static map generation with various styling options. Example URL format:
This API requires a Mapbox account and an access token. 3. StaticMap APIThis service provides a free API endpoint to generate static maps using OSM tiles. It's commonly used for quick map generation. Example:
4. Using Your Own Tile ServerIf you need more control or high-volume requests, setting up a local OSM tile server with Leaflet and Leaflet Image plugins allows you to generate static images programmatically. This setup is more complex but suitable for scalable or offline use cases. Among these, staticmap.openstreetmap.de and Mapbox are widely used for quick OSM-based images with center point and zoom level settings. |
I'd first implement #38, use staticmap.openstreetmap.de for images on Hitchwiki, and make the image clickable so it links to the place on Hitchmap. We can worry about actually displaying spots on the image later. |
I couldn't find a nice library to display a static OSM map, so I asked ChatGPT to write one. Seems to work fine: https://github.com/bopjesvla/tiny-static-map I'd use this as the "image", and wrap it with a link to the right place/zoom level on Hitchmap. |
The easiest way to go about is to add the map tag to the allowed tags on Mediawiki, then run a script on every page that replaces map tags with a hyperlinked map. To allow a new HTML tag on a wiki, the process generally depends on the wiki software you're using. Here’s a basic guide for some popular wiki platforms:
Security Note: Enabling additional HTML tags can pose a security risk, especially for tags like <script>, <iframe>, and others that can be exploited. |
We wanna introduce iframes on all city pages in hitchwiki to make this work from our side we need the following:
This is how it looks like before this issue was tackled:
The text was updated successfully, but these errors were encountered: