Harry Wood
home
>
maps
>
examples
> mapstraction >
Mapstraction Simple Leaflet
Mapstraction Simple Leaflet
Using Mapstraction to invoke leaflet, which weirdly defaults to the MapQuest's OpenStreetMap tile server (example at bottom of
the first mapstraction tutorial
)
<html> <head> <title>Mapstraction Simple Leaflet Example</title> <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.5/leaflet.css" /> <!--[if lte IE 8]> <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.5/leaflet.ie.css" /> <![endif]--> <script src="http://cdn.leafletjs.com/leaflet-0.5/leaflet.js"></script> <script src="https://raw.github.com/mapstraction/mxn/master/source/mxn.js?(leaflet)" type="text/javascript"></script> <style type="text/css"> #map { height: 200px; } </style> </head> <body> <div id="map"></div> <script type="text/javascript"> var map = new mxn.Mapstraction('map', 'leaflet'); var latlon = new mxn.LatLonPoint(51.50733, -0.12769); map.setCenterAndZoom(latlon, 10); </script> <p>Don't forget the credits:<br> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors</p> </body> </html>
view directly
Home
Blog
About
Maps
Other
Contact