User:Yurik/Maplink blogpost

From Meta, a Wikimedia project coordination wiki

Zoom, pan, and interact with knowledge: Wikipedia offers editors a map service[edit]

Interactive maps are coming to Wikimedia projects. Here's how you can find out more.[edit]

The Wikimedia Foundation's Interactive team, part of the Discovery department, is working on building services for Wikimedia projects to provide new ways to learn and share.  

One way we are doing this is with interactive maps: where people can zoom, pan, and interact with points of interest, to further enrich the way our readers learn about the world. Interactive maps allow editors to tell compelling stories like animal migration, natural disasters or climate change. 

After a year of development and extensive testing with the Wikivoyage communities, we are beginning to enable interactive maps for Wikipedia. 

As of today all Wikimedia projects have access to the interactive map <maplink> feature. All projects except for Wikipedia have the <mapframe> feature as well. What does this mean? You can add hyperlinks to full-screen maps on all projects and embedded maps in all Wikimedia projects with the exception of Wikipedia. Wikipedia's are next, don't worry! 

Both features use the Wikimedia mapping service and the syntax is the same. The difference is that one produces a hyperlink to a map while the other embeds an interactive map in the article page itself. 

Maplink[edit]

The maplink feature <maplink> allows editors to create a link to a full-screen map. Editors can position the map, define a zoom level, add location markers and more.

Editors can enrich the map with some overlays of different styles, defined in GeoJSON. For example, an editor may highlight an area of a map with a semi-transparent polygon and points of interest, together with popups that may contain wiki text and images.

These maps may even contain highlighted regions and popups with information using the geoshapes service. This service makes it possible to draw interesting overlays on top of an interactive map. If the Open Street Maps community has defined a region and assigned it a Wikidata ID, that region can be drawn on the map using that ID. Or you can use Wikidata Query Service (via SPARQL language), to query for those IDs and draw them on the map, shade them and add popup information.

Here's an example of the <maplink> syntax.

<maplink zoom="13" longitude="-122.3995" latitude="37.8103" text="click '''me'''" />

You can see how this feature works in this example or in the animation below.

A short screen recording showing the Maps feature <maplink>.

Mapframe[edit]

<mapframe> enables editors to place an embedded interactive map in an article. Similar to adding an image to a wiki page you can add a caption, define a size, and adjust the alignment.

<mapframe text="Downtown [[wikipedia:San Francisco|San Francisco]]" width=250 height=250 zoom=13 longitude=-122.3988 latitude=37.8013 />

Soon you’ll be able to add maps to all projects, but right now the feature is enabled on Wikivoyage, Meta-Wiki, Mediawiki.org and the Catalan, Hebrew, and Macedonian Wikipedias. You can see a demonstration of the map frame feature on MediaWiki.org or in the animation below.

What's next?[edit]

We wanted to give interested editors a chance to test these tools and provide feedback as we gradually roll out the service to more projects. Editors can start adding maplinks to articles now on all Wikimedia Projects and mapframes to the projects listed.

Questions? Please learn more about the interactive maps project. We also have documentation for the how to use the service, and please leave your feedback to help us improve.