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

= Code Samples for creating maps with

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

2. A link with custom text
You can also add in custom text to display something like this:



3. A link with custom text without a map icon
If you would prefer your map link to display without the map icon, you can edit your code to be something like this:



4. Set a custom zoom level for the map, once it's opened
Let's now set a zoom level for the interactive map, since you might want to display your map closer into the city:



BUG REPORT: using text with frameless shouldn't show frame
As reported in T151703 <mapframe text="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." latitude="39.73939" longitude="-104.98491" zoom="17" width="300" height="350" frameless> {     "type": "Feature", "properties": { "marker-symbol": "town-hall", "marker-color": "46ea5f", "marker-size": "medium", "title": "Colorado State Capital", "description": ""}, "geometry": { "type": "Point", "coordinates": [-104.98485267162323, 39.73928364167763] } }