User:DTankersley (WMF)/misc/how to: maps/code samples

Code Samples for creating maps with <maplink>Edit

1. Just a link with coordinatesEdit

The easiest way to add a new link to a map for Estes Park is adding the following code in the page:

<maplink latitude="40.377117" longitude="-105.525514" />

This displays a <maplink> that will automatically convert the latitude and longitude into degrees, minutes and seconds.

2. A link with custom textEdit

You can also add in custom text to display something like this:
Estes Park, CO

3. A link with custom text without a map iconEdit

If you would prefer your map link to display without the map icon, you can edit your code to be something like this:
<maplink latitude="40.377117" longitude="-105.525514" text="An interactive map of Estes Park, CO" class="no-icon" />

4. Set a custom zoom level for the map, once it's openedEdit

Let's now set a zoom level for the interactive map, since you might want to display your map closer into the city:
<maplink latitude="40.377117" longitude="-105.525514" text="An interactive map of Estes Park, CO" zoom="15" />


BUG REPORT: using text with frameless shouldn't show frame Edit

As reported in phab:T151703#2825105

 
Colorado State Capital with a town hall marker, article link and image. Repeating for longer caption: Colorado State Capital with a town hall marker, article link and image. Colorado State Capital with a town hall marker, article link and image. Colorado State Capital with a town hall marker, article link and image. Colorado State Capital with a town hall marker, article link and image. Colorado State Capital with a town hall marker, article link and image.