Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource


Babel is required to process package imports. If you need a different preprocessor remove all packages first.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


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.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.


              <div class="container">
  <div class="center-objs">
    <div id="map"></div>
    <div id="new-parent">


              .container {

.center-objs {
  margin:0 auto;
#map {
  width: 600px;
  background: lightgrey;


              //Creat Layer
var baseMap = new L.TileLayer('http://{s}{z}/{x}/{y}.png');

var baseMapIndex = {
  "Map": baseMap

// Create the map
var map = new'map', {
    center: new L.LatLng(39.7392, -104.9903),
    zoom: 10,
    maxZoom: 18,
    zoomControl: false, // Disable the default zoom controls.
    layers: baseMap

// Point style
var stationStyle = {
  opacity: 0.9,
  fillOpacity: 0.7

// Callback to create overlay layer
/* Creating a layer from a async call probably will be a common task.  
 * Refactor out the function to make a layer, you can use this function with multiple layers. 
function createPointOverlay(data, layerName, style) {
  var overlay = L.geoJson(data, { // Make the layer from the JSON and grab the handle.
    pointToLayer: function (feature, latlng) {
    return L.circleMarker(latlng, style); 
  overlay.addTo(map); // Add the data to the map, now you can see the point layer.
  control.addOverlay(overlay, layerName); // Add the layer to the Layer Control.

// Get GeoJSON data
/* Break it down and KISS.  Get the data and call a function upon completion.
 * We use a anonymous function to call the createOverlay function.  This is because the callback only has 
 * the signature with submitting one object, the JSON object.  Once called it passes to the actual function with the
 * customisation that we wanted.  This allows you to use this with multiple JSON objects served from AWS. 
$.getJSON("", function (data) { createPointOverlay(data, "Light Rail Stations", stationStyle) });

// Create the control and add it to the map;
var control = L.control.layers(baseMapIndex); // Grab the handle of the Layer Control, it will be easier to find.