Talk:Slippy Map MediaWiki Extension

From OpenStreetMap Wiki
Jump to navigation Jump to search

Discuss Slippy Map MediaWiki Extension here:


Please enable marker support!

As it is 2014 now, please enable marker support. It should be simple to add a marker="1" (just a yes/no switch) to place a marker in the middle of a map (the coordinates that are given as lat/lon parameters!). It is boring to use slippymap with any kind of event and the location where the event takes place isn't shown anywhere on the map!

- /al 12:36, 8 April 2014 (UTC)

Marker functionality seems like an obvious thing to add, but we have to think about the right syntax trends to be setting with such things. But anyway... more generally there's a question about merging with other efforts, and better maintained more feature-rich MediaWiki extensions. Particularly Extension:Maps. I think Firefishy was keen to deploy that one instead of my old thing. Not sure what the blockers are. Needs some testing out probably. I shall ask him. -- Harry Wood (talk) 11:54, 9 April 2014 (UTC)

Move Code Subversion?

Can we move this code to osm svn? I would love to hack on it. - Firefishy 01:06, 26 February 2008 (UTC)

Yeah that would probably better. Currently this page has exactly the code that is deployed on this wiki, except that DIV is written in upper case (to bypass the spam filter). So you can just copy and paste the code out of here and into a new file. But yeah, coding in the wiki is a bit sub-optimal. ...mind you, I don't have SVN check-in access. -- Harry Wood 10:42, 26 February 2008 (UTC)

OSM Wiki Upgrade

I'm planning on upgrading the OSM-Wiki's version of the SlippyMap extension to the version available from http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/SlippyMap/ within the next few days.

I haven't yet resolved how to handle the parameter passing change.

-- Firefishy 11:29, 24 September 2008 (UTC)

Overview?

An overview of what this extension is/does might prove useful -- Wiggypedia 23:01, 16 February 2009

I supposed the fundamental descriptive sentences have ended up a bit further down the page. There we go. I've fixed it. -- Harry Wood 23:31, 16 February 2009 (UTC)

Proposals for improvement

I made some tests to use Slippy Map in a MediaWiki template at Wikivoyage. There were some problems to consider for further extension programming.

There is only one way to use Slippy Map in a template: Using the #tag magic word. But there are design problems with #tag.

 {{#tag:extensionFunction | textInbetween | arg1 = value1 | arg2 = value2 ...}}

works like

 <extensionFunction arg1 = "value1" arg2 = "value2" ...>textInbetween</extensionFunction>

You must have a text like textInbetween to use arguments. Therefore you can not produce the new syntax because textInbetween cannot be given. (See also MediaWiki bug 2257).

There is only a tricky way if we work with the old syntax like:

{{#tag:slippymap | h={{{h|300}}} {{!}} w={{{w|450}}} {{!}} z={{{z|12}}} {{!}} ... }}

{{!}} is a template to produce a pipe.

1. I propose to give support to the old syntax also in the future.

Additional proposal:

2. You should not use p tags in the (x)html code because p has a top and bottom margin which sizes depend on the individual skin. You used p to arrange the buttons panel.

3. It is now impossible to use more than one map. I think a rewriting/change of the JavaScript scripts would help.

4. An additional parameter should be useful to produce a static instead of a dynamic map.

--Unger 18:10, 7 April 2009 (UTC)

Try whacking in two pipe chars right next to eachother at the beginning like this:
{{#tag:slippymap||lat="51.485"|lon="-0.15"|z="11"|w="300"|h="300"|layer="mapnik"}}
This can also work in a template, for passing in numbered parameters. Something like this:
{{#tag:slippymap||lat="{{{1}}}"|lon="{{{2}}}"|z="{{{3}}}"|w="{{{4}}}"|h="{{{5}}}"|layer="mapnik"}}
Other replies...
1) Hopefully I've answered that problem for you. I hope so because I've only just changed it to abolish the old syntax!
2) OK I'll try to remove p tags
3) Yep. Got that on the todo list
4) Currently the Simple image MediaWiki Extension caters for that, although it could be interesting to add an option to the slippy map extension to just supress slippiness (while still support all the marker/polyline stuff we might add) It could also be interesting to merge the two extensions, so that static/slippy is the first option to choose in some kind of interface (an interface which would also give a nice way of choosing where to centre the map etc)
-- Harry Wood 18:36, 7 April 2009 (UTC)
Thank you for your hints. I checked the usage of double pipes yesterday, too -- without any success. The problem was that it is not allowed to use spaces (at least in MediaWiki v 1.13). This syntax rule is unusually in the MediaWiki syntax. I think this is a MediaWiki implementation/documentation fault. The use of apostrophes is not necessary.You can also write
{{#tag:slippymap||lat={{{1}}}|lon={{{2}}}|z={{{3}}}|w={{{4}}}|h={{{5}}}|layer=mapnik}}
Any space behind or before the pipes and equal signs give troubles.
It would be useful to merge both extensions. --Unger 05:25, 8 April 2009 (UTC)


Add new layer

It is possible add OpenLayers.Layer.OSM.CycleMap? Thanks! -- hanoj 16:12, 26 June 2009 (UTC)

DONE. It now supports layer=cycle -- Harry Wood 11:15, 29 June 2009 (UTC)

Avoid "..more OSM coming soon" where possible

I think the "... more OSM coming soon" image should be avoided as much as possible. The endusers want to see a map. They don't care about technical things, why it is nice to rerender a special tile. If I view openstreetmap with the enduser glasses I get angry when I often see big areas with the "more OSM" image.
What is the real reason for this? Is it harddisc space? Mmmh, harddisc space is quite cheap today, so I don't think so. So isn't it possible to render the complete map once. If a tile is marked dirty it is rerendered. But during the rerendering process the old tile is shown. So we could get rid of the "...more OSM"-tile.
What do you think?--WanMil 11:27, 28 September 2009 (UTC)

The Slippy Map MediaWiki extension is an OpenLayers invocation pointing at the same tile URLs as used on the main OpenStreetMap.org homepage. The tile rendering system is quite complicated. It's documented here: Slippy Map#Tile rendering, including an explanation of what the "more OSM" image means. The tile rendering and tile serving infrastructure was initially set-up primarily for the purposes of the OpenStreetMap homepage, but is increasingly used elsewhere on other websites and mobile apps. OpenStreetMap offer no guarantees about this service, but we do now have a draft Tile usage policy. If you have technical suggestions relating to this tile rendering/serving set-up, I guess Talk:Slippy Map would be a more appropriate place, although other Contact channels would probably be better (You can usually chat with the server administrators on IRC, or just email the mailing list) . -- Harry Wood 11:46, 28 September 2009 (UTC)
Thanks for your answer. The Talk:Slippy_Map#More_OpenStreetMap_coming_soon... page you proposed already contains a question from me without any answer. So I'll have to use your other suggestions. --WanMil 15:42, 28 September 2009 (UTC)

Highlighting objects

Hello,

it would be cool if we could add some attribute to the slippymap to highlight objects in the map itself. Something like this. The syntax could be something like:

<slippymap ... node="id">
<slippymap ... way="id">
<slippymap ... relation="id">

What do you think about this?

--Hanska 17:37, 10 January 2010 (UTC)

Does query-to-map help you ? Lulu-Ann

Broken?

It looks like slippymap is broken. It is blank at least on this page and on WikiProject United States. Nakor 23:55, 13 June 2010 (UTC)

  • Sept 2012: Still suffering from non-unique id name breaking two-on-one page,
The Snares <slippymap lat="-48.05" lon="166.55" z="11" layer="mapnik" w="300" h="200" /> Bounty Islands <slippymap lat="-47.757" lon="179.04" z="13" layer="mapnik" w="300" h="200" />
-- Hamish 07:52, 15 September 2012 (BST)









Maps on Wikivoyage

Hello all! Wikivoyage is a wiki travel guide by Wikimedia. We already have the Slippy Map extension installed, but would like to go further:

Each article has a list of POI (Point Of Interest: latitude + longitude + name + others). We can show the POIs on a local OSM map like this.

Now, we would like to embed this map into the wiki article, and it sounds like Slippy Map may help.

Any idea how we should proceed? Any help would be very appreciated. Thanks a lot! Sisikottos (talk) 03:03, 8 April 2013 (UTC)

Maximum zoom

This extension limits the zoom level to 17. But nowadays Mapnik allows zoom levels up to 19, and the Humanitarian OSM Team Map allows zoom levels up to 20. --Jgpacker (talk) 18:34, 22 May 2014 (UTC)

Current information?

Is this page still providing current information or are there other map embedding extensions activated in the OSM wiki (e.g. [1])? In particular, does anybody know how to embed a map with a marker on a wikipage? --Dieterdreist (talk) 09:25, 29 April 2019 (UTC)

An overview of relevant map extensions is available from MediaWiki extension. I keep that page updated as good as I can. Simple image MediaWiki Extension used to be able to do that AFAIK, but the tile provider FOSSGIS cancelled the service without notice and was unwilling to help us, so Harry Wood figured out some use of https://maps.wikimedia.org and I guess they do not support markers.
AFAIK there is currently no option of displaying a marker in a map, but I plan on bringing w:mw:Extension:MultiMaps to this wiki which can do that (all relevant links at MediaWiki extension). --Tigerfell This user is member of the wiki team of OSM (Let's talk) 19:50, 29 April 2019 (UTC)
@Dieterdreist: Now there is mw:Extension:MultiMaps providing a slippy map with a marker using Template:Slippymap. --Tigerfell This user is member of the wiki team of OSM (Let's talk) 17:43, 11 September 2019 (UTC)
@Tigerfell: great, thank you very much, works as required. --Dieterdreist (talk) 08:27, 16 September 2019 (UTC)