Template talk:Slippymap

From OpenStreetMap Wiki
Jump to navigation Jump to search

Slippymap just shows "map is loading" in preview mode and mobile view

iriman (talk) 15:02, 24 October 2020 (UTC)

Thank you for the bug report. I did not notice that yet. I opened a ticket at phab:T266654. --Tigerfell This user is member of the wiki team of OSM (Let's talk) 10:59, 28 October 2020 (UTC)

Cyclosm?

How one may use cyclosm layer? Mateusz Konieczny (talk) 00:45, 25 January 2021 (UTC)

After this is solved, https://wiki.openstreetmap.org/w/index.php?title=Tag:cycleway:both%3Dlane&diff=2098431&oldid=2098423 should be reverted and fixed Mateusz Konieczny (talk) 00:46, 25 January 2021 (UTC)
Seems this needs to be added analog to this: https://wiki.openstreetmap.org/w/index.php?title=Wiki:Maps&diff=2024029&oldid=1912679 --MalgiK (talk) 02:00, 25 January 2021 (UTC)
see https://wiki.openstreetmap.org/w/index.php?title=Talk:Slippy_Map&oldid=prev&diff=2095535 --Tigerfell This user is member of the wiki team of OSM (Let's talk) 11:02, 25 January 2021 (UTC)
Thanks for the prepared pull request, lets see when it is merged. So, the parameter will be cyclosm. --MalgiK (talk) 16:36, 25 January 2021 (UTC)

Zoom limit?

Resolved: It seems that the issue no longer exists, because the template source code has been changed. maro21 21:57, 3 June 2023 (UTC)

Is there a zoom limit here? It doesn't display zoom 19, maximum is 18 for the default layer. If there is a limit, it should be mentioned in the documentation. But I'd prefer it to be enabled. Some features are displayed only on zoom 19. maro21 21:37, 8 April 2021 (UTC)

Seems to be an error in the extension. I reported it at https://phabricator.wikimedia.org/T279770. --Tigerfell This user is member of the wiki team of OSM (Let's talk) 11:39, 9 April 2021 (UTC)
Thanks! I hope they will fix it soon. Is the error on MediaWiki or Leaflet side? maro21 17:19, 10 April 2021 (UTC)
It is on both sides. Leaflet by default does not show zoom levels above 18. MultiMaps extension does not overwrite the default even though there is a setting for that (maxzoom).
I doubt that it will be fixed soon. The main developer of the extension is not very active on this extension. Changing things on Wikimedia is a lengthy process for me, because I would need to set up a testing environment again and ask others to review and merge my code. Lastly, OWG only adds updates of extensions when they update MediaWiki itself. At certain times there is no MediaWiki update for months. --Tigerfell This user is member of the wiki team of OSM (Let's talk) 11:37, 11 April 2021 (UTC)

Humanitarian style rendering

Seems down for the moment (see Template:Slippymap#Examples, anybody knows the cause?--MalgiK (talk) 12:55, 1 October 2022 (UTC)

osm.org seems to use tile-{s}.openstreetmap.fr/hot/.... However, I could not find out when or why this was changed. --Tigerfell This user is member of the wiki team of OSM (Let's talk) 22:42, 4 October 2022 (UTC)
I think they changed it with this commit dating back to 2015 --Marcor (talk) 10:21, 10 November 2022 (UTC)
Thanks for your replies, i still don't understand the issue.
For osm.org the Humanitarian style rendering works well, see: https://www.openstreetmap.org/#map=18/34.8/-111.76460&layers=H
But for the wiki it doesn't work{{slippymap |lat=34.8 |lon=-111.76460 |zoom=18 |width=200 |height=200 |layer=humanitarian |marker=no}}:

Do we need for fixing the wiki issue an open ticket at hotosm/HDM-CartoCSS / openstreetmap/operations / openstreetmap/openstreetmap-website or is just some another settings for this wiki needed?--MalgiK (talk) 11:25, 10 November 2022 (UTC)
if you look at the console of your browser you will see that the Slippymap template looks for tiles at "https://tile.openstreetmap.fr/hot/{z}/{x}/{y}.png" and receives a 404 HTTP error code because the correct URL is "https://tile-{a,b,c}.openstreetmap.fr/hot/{z}/{x}/{y}.png" (e.g. https://tile.openstreetmap.fr/hot/14/3105/6500.png returns the error while https://tile-a.openstreetmap.fr/hot/14/3105/6500.png returns a correct image file); I think the problem is on the Wiki side (maybe in the multimaps extension, which is called by the slippymap template). --Marcor (talk) 13:57, 10 November 2022 (UTC)
Interessting, i can follow this. So the link of the wiki misses the {a,b,c}-parameter in front of openstreetmap.fr/hot. On the page Wiki:Maps#Slippy_maps below of the map there is a comment "The list of layers is defined in https://github.com/openstreetmap/chef/blob/master/cookbooks/wiki/templates/default/mw-ext-MultiMaps.inc.php.erb and it is occasionally updated to match the list of featured tile layers." The content of this github chef erb file, doesn't use the {a,b,c}-parameter. Is this perhaps the place where it could be solved?--MalgiK (talk) 17:40, 10 November 2022 (UTC)
I think you are right; let's wait that some admin reads this conversation and unravels the doubt once for all :) --Marcor (talk) 22:25, 10 November 2022 (UTC)
@Marcor and MalgiK: All that you wrote is correct (except for the link to the 2015 code change because the current configuration worked in June 2019 when I added that extension to the wiki). A ticket needs to be filed at openstreetmap/operations because it is a configuration issue. There is a conflict with ticket 749 proposing to replace that extension. That is why I did not put any efforts into fixing this issue. (Margin note: The URL for tiles of the main map needs to have the {a,b,c} part removed as requested by Firefishy.) --Tigerfell This user is member of the wiki team of OSM (Let's talk) 23:34, 10 November 2022 (UTC)

The parameter "layer=*" seems not working for the new used Extension:Kartographer at all

See title, any ideas to fix this? —Preceding unsigned comment added by MalgiK (talkcontribs) 09:36, 23 January 2023

You can add this functionality to Kartographer by yourself or pursue somebody to do it for us. https://github.com/openstreetmap/chef/pull/552 should contain enough links to dive into the topic. I obviously gave up. --Tigerfell This user is member of the wiki team of OSM (Let's talk) 22:16, 24 January 2023 (UTC)
@Tigerfell: I wonder if phab:T362531 might finally result in a fix for this issue. – Minh Nguyễn 💬 13:31, 15 April 2024 (UTC)

Option "text"

Resolved: Option "text" was implemented to Slippymap --Chris2map (talk) 21:11, 3 June 2023 (UTC)

@Tigerfell: Triggered by this edit, I discovered the "text" option of Kartographer. In order to keep the function and display independent of the development of Kartographer and the LUA module in the wiki, I tested a workaround. What do you think of this? – You can also choose the alignment with align=left or align=right (or if you don't specify, center as the default).

Preview – compare with Key:addr:*#What_to_add

{{User:Chris2map/Sandbox
|testslippymap=yes
|align=left
|text=[https://www.openstreetmap.org/#map=19/52.49832/13.43601 OpenStreetMap.org/#map=19/52.49832/13.43601]
|lat=52.49832
|lon=13.43601
|zoom=17
|width=250
|height=250
|marker=no
}}
(Sandbox has been altered. See old version - permalink)
(Code supplement for Template:Slippymap)
{{#if:{{{text|}}}|
<div style="background-color:#f8f9fa;{{#if:{{{align|}}}|float:{{{align|}}}}};margin:auto;width:{{#expr:{{{width|400}}}+6}}px;">
  {{#invoke:Slippymap|slippymap|{{{lat|51.3432699}}}|{{{lon|0.52700328}}}|{{{height|400}}}|{{{width|400}}}|{{{zoom|12}}}|{{{marker|}}}}}
  <div style="background-color:#f8f9fa;border:1px solid #c8ccd1;border-top:none;margin-top:-8px;width:100%;">
    <div style="padding:0 6px 6px 6px;">{{{text|}}}</div></div></div>
| {{#invoke:Slippymap|slippymap|{{{lat|51.3432699}}}|{{{lon|0.52700328}}}|{{{height|400}}}|{{{width|400}}}|{{{zoom|12}}}|{{{marker|}}}}}
}}

--Chris2map (talk) 18:32, 15 February 2023 (UTC)

I would change Module:Slippymap instead. Template:Slippymap currently just forwards all inputs to the module. I think that changing the template would just make it more complicated to understand. Per default, Kartographer aligns the maps on the side where the lines of text end (i. e. float:right for LTR languages). This did not match the conventions of this wiki, so I made the module overwrite the default. I used Template:Sandbox and Module:Sandbox/Tigerfell to show what I propose
Test 1: {{Sandbox|alignment= left |text= OpenStreetMap.org/#map=19/52.49832/13.43601 |lat= 52.49832 |lon= 13.43601 |zoom= 17 |width= 250 |height= 250 |marker= no }}
Test 2 (some inputs missing): {{Sandbox|alignment= |text= |lat= 52.49832 |lon= 13.43601 |zoom= 17 |width= 250 |height= 250 |marker= no }}
Does that match your expectations? --Tigerfell This user is member of the wiki team of OSM (Let's talk) 14:52, 17 February 2023 (UTC)
Yes! That leaves no wish unfulfilled. Thanks for paying attention to it so quickly! --Chris2map (talk) 19:25, 17 February 2023 (UTC)

@Chris2map and Tigerfell: I changed the module to look one frame up at the page that transcludes {{Slippymap}} for the arguments, so {{Slippymap}} itself no longer needs to explicitly pass through anything. This makes the module code cleaner and should make it easier to add support for more options in the future. – Minh Nguyễn 💬 04:49, 3 March 2023 (UTC)

@Minh Nguyen: The template now uses Module:Slippymap/sandbox instead of Module:Slippymap. Is that intended? --Tigerfell This user is member of the wiki team of OSM (Let's talk) 10:54, 5 March 2023 (UTC)
@Tigerfell: Whoops, I meant to make that change to Template:Slippymap/sandbox but got my tabs mixed up. – Minh Nguyễn 💬 16:55, 6 March 2023 (UTC)
It does not seem to work with Template:Place anymore, see Category:Pages with broken maps. --Tigerfell This user is member of the wiki team of OSM (Let's talk) 11:27, 5 March 2023 (UTC)
@Tigerfell: Fixed. – Minh Nguyễn 💬 17:00, 6 March 2023 (UTC)

Vector alternative

{{Vector map}} is a new alternative to this template that embeds a vector map powered by MapLibre GL JS instead of a raster map powered by Leaflet. Please see the documentation for usage examples and guidelines on when to use that template instead of this one. – Minh Nguyễn 💬 19:47, 3 June 2023 (UTC)