Pen Settings

HTML

CSS

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

JavaScript

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

Behavior

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.

HTML

            
              <head>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.mapbox.com/mapbox.js/v2.2.2/mapbox.js'></script>
<link href='https://api.mapbox.com/mapbox.js/v2.2.2/mapbox.css' rel='stylesheet' />
</head>

<div id="map">
</div>


<!-- embed responsive iframe --> 
<!-- ======================= -->

<div id="Iframe-Map" class="set-margin set-padding set-border set-box-shadow center-block-horiz">
  <div class="responsive-wrapper 
     responsive-wrapper-wxh-600x480"
     style="-webkit-overflow-scrolling: touch; overflow: auto;">

    <iframe src="https://a.tiles.mapbox.com/v4/alxfyv.no7iba2k/attribution,zoompan,zoomwheel,geocoder,share.html?access_token=pk.eyJ1IjoiYWx4Znl2IiwiYSI6ImNpZnd5Z2t5ajR1dHBvZWtyZG5rcjZ4dHEifQ.anuqlmgtxdbBwV6PS9PtuQ"> 
      <p style="font-size: 110%;"><em><strong>ERROR: </strong>  
An &#105;frame should be displayed here but your browser version does not support &#105;frames. </em>Please update your browser to its most recent version and try again.</p>
    </iframe> 
  </div>
</div>

            
          
!

CSS

            
              #map {
  display: block;
  position: absolute;
  top:0;
  bottom: 0;
  height: 400px;
  width: 100%;
}

/* CSS for responsive iframe */
/* ========================= */

/* outer wrapper: set max-width & max-height; max-height greater than padding-bottom % will be ineffective and height will = padding-bottom % of max-width */

#Iframe-Map {
  display: none;
  max-width: 600px;
  max-height: 480px; 
  overflow: hidden;
}

/* inner wrapper: make responsive */
.responsive-wrapper {
  position: relative;
  height: 0;    /* gets height from padding-bottom */
  
  /* put following styles (necessary for overflow and scrolling handling on mobile devices) inline in .responsive-wrapper around iframe because not stable in CSS:
    -webkit-overflow-scrolling: touch; overflow: auto; */
  
}
 
.responsive-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  
  margin: 0;
  padding: 0;
  border: none;
}

/* padding-bottom = h/w as % -- sets aspect ratio */
/* YouTube video aspect ratio */
.responsive-wrapper-wxh-650x315 {
  padding-bottom: 56.25%;
}
.responsive-wrapper-wxh-600x480 {
  padding-bottom: 80%;
}

/* at mobile device sizes suppress Mapbox map which is not mobile friendly and display responsive iframe map instead. */
@media only screen and (max-width: 736px) {
  #map {
    display: none;
  }
  #Iframe-Map {
    display: block;
  }
}

/* general styles */
/* ============== */
.set-border {
  border: 5px inset #4f4f4f;
}
.set-box-shadow { 
  -webkit-box-shadow: 4px 4px 14px #4f4f4f;
  -moz-box-shadow: 4px 4px 14px #4f4f4f;
  box-shadow: 4px 4px 14px #4f4f4f;
}
.set-padding {
  padding: 40px;
}
.set-margin {
  margin: 30px;
}
.center-block-horiz {
  margin-left: auto !important;
  margin-right: auto !important;
}


            
          
!

JS

            
              
L.mapbox.accessToken = 'pk.eyJ1Ijoib2MzMjUiLCJhIjoiMTAxYjUxYmM4NWYxZjg2YjVhNTM3MjJmZDdhNTBjNTQifQ.d8Pqb9XknZ25-TcGqKUy3w';

// Construct a bounding box for this map that the user cannot
// move out of
var southWest = L.latLng(-57.136239, -180),
    northEast = L.latLng(84.267172, 180),
    bounds = L.latLngBounds(southWest, northEast);

var map = L.mapbox.map('map', 'oc325.nd00japh', {
maxBounds: bounds,
 maxZoom: 19,
    minZoom: 2,
//restrict zooming levels
    // These options apply to the tile layer in the map.
    tileLayer: {
        // This map option disables world wrapping. by default, it is false.
        continuousWorld: false,
        // This option disables loading tiles outside of the world bounds.
        noWrap: true
 }
}).setView([40, 0], 2);

map.featureLayer.on('click', function(e) {
        map.panTo(e.layer.getLatLng());
    });//centers on marker when clicked
  
map.on('popupopen', function(centerMarker) {
        var cM = map.project(centerMarker.popup._latlng);
        cM.y -= centerMarker.popup._container.clientHeight/2
        map.setView(map.unproject(cM),13, {animate: true});
    });

 // zoom the map to that bounding box
map.fitBounds(bounds);

            
          
!
999px

Console