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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

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

Visit your global Editor Settings.


                <script src=""></script>
<div id="buttons">
  <input type="checkbox" name="filter" id="shower" class='chk-btn'>
  <label for='shower'>Shower</label>
  <input type="checkbox" name="filter" id="flush" class='chk-btn'>
  <label for='flush'>Flush Toilet</label>
  <input type="checkbox" name="filter" id="vault" class='chk-btn'>
  <label for='vault'>Vault Toilet</label>
<div id="map"></div>
<div id="campground_info"></div>



                #map {
  width: 500px;
  height: 300px;

/* chk-btn CSS from

input.chk-btn {
  display: none;
input.chk-btn + label {
  border: 1px solid grey;
  background: ghoswhite;
  padding: 5px 8px;
  cursor: pointer;
  border-radius: 5px;
input.chk-btn:not(:checked) + label:hover {
  box-shadow: 0px 1px 3px;
input.chk-btn + label:active,
input.chk-btn:checked + label {
  box-shadow: 0px 0px 3px inset;
  background: #8cc472;


                var map
var markers = []

// start out with filter features set to false, so no filtering happens by default
var filters = {shower:false, vault:false, flush:false}

$(function () {
    $('input[name=filter]').change(function (e) {


var get_set_options = function() {
  ret_array = []
  for (option in filters) {
    if (filters[option]) {
  return ret_array;

var filter_markers = function() {  
  set_filters = get_set_options()
  // for each marker, check to see if all required options are set
  for (i = 0; i < markers.length; i++) {
    marker = markers[i];

    // start the filter check assuming the marker will be displayed
    // if any of the required features are missing, set 'keep' to false
    // to discard this marker
    for (opt=0; opt<set_filters.length; opt++) {
      if (![set_filters[opt]]) {
        keep = false;

var map_filter = function(id_val) {
   if (filters[id_val]) 
      filters[id_val] = false
      filters[id_val] = true

// after the geojson is loaded, iterate through the map data to create markers
// and add the pop up (info) windows
function loadMarkers() {
  console.log('creating markers')
  var infoWindow = new google.maps.InfoWindow()
  geojson_url = ''
  $.getJSON(geojson_url, function(result) {
      // Post select to url.
      data = result['features']
      $.each(data, function(key, val) {
        var point = new google.maps.LatLng(
        var titleText = val['properties']['title']
        var descriptionText = val['properties']['description']
        var marker = new google.maps.Marker({
          position: point,
          title: titleText,
          map: map,
          properties: val['properties']

        var markerInfo = "<div><h3>" + titleText + "</h3>Amenities: " + descriptionText + "</div>"

        marker.addListener('click', function() {

function initMap() {
    map_options = {
      zoom: 10,
      mapTypeId: google.maps.MapTypeId.HYBRID,
      center: {lat: 42.9456, lng: -122.2}
    map_document = document.getElementById('map')
    map = new google.maps.Map(map_document,map_options);

google.maps.event.addDomListener(window, 'load', initMap);