cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

              <!--[if lte IE 8]>
     <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.ie.css" />
<h1>Building Interactive Maps with Leaflet &amp; the Geo&#8203;location API</h1>
<div id="leafletmap"></div>
<i class="fa fa-map-marker"></i>
<button class="pure-button pure-button-primary">Get my location</button>
              @import url(https://yui.yahooapis.com/pure/0.3.0/pure-min.css);
html{background: #111;}
  max-width: 500px;
  margin: 1em auto;
  text-align: center;
  background: #fff;
  border: 1px solid #ccc;
  padding: 0 25px;
  border-radius: 3%;
  height: 300px;
  border: 1px solid #ccc;
  margin: 1.5em;
              var mymap = L.map('leafletmap');
mymap.setView([40.775,-73.972], 15);
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
    attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>',
    maxZoom: 18

$('.pure-button').on('click', function(){
  mymap.locate({setView: true, maxZoom: 15});

mymap.on('locationfound', onLocationFound);
function onLocationFound(e) {
    // e.heading will contain the user's heading (in degrees) if it's available, and if not it will be NaN. This would allow you to point a marker in the same direction the user is pointed. 
Loading ..................