cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmlicon-personicon-teamoctocatpop-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.

            
              header#header
  h1 MAP
#map-canvas
footer#footer
  small site footer
script(src="https://maps.google.com/maps/api/js?sensor=true")

            
          
!
            
              html, body, #map-canvas
  height: 100%
  margin: 0
  padding: 0
#header
  position: relative
  margin: 0
  padding: .5em 0
  background: #FFF
  text-align: center
  z-index: 1
  &:after
    content:""
    display: block
    position: absolute
    bottom: -1.5em
    left: 50%
    margin-left: -1.8em
    border: 1.8em solid transparent
    border-top: 1.5em solid #fff
    border-bottom-width: 0
    width: 0
    height: 0
#footer
  color: #F4F4F4
  margin: 0
  padding: 1em 0
  background: #424242
  text-align: center
            
          
!
            
              !function() {
  var myMarkers = [
    {
      position: [60.142568, 24.989571],
      title: 'Submarine Vesikko',
      content: '潜水艦 べシッコがあるよ'
    },
    {
      position: [60.145866, 24.989367],
      title: 'Sotamuseon Maneesi',
      content: '呉造兵廠で作られた120mm砲があるよ'
    }
  ];

  function initialize() {
    var myLatlng = new google.maps.LatLng(60.1500745,24.978537);
    
    // Map Options
    var mapOptions = {
      center: myLatlng,
      zoom: 13,
      styles: getMapStyle(),
      mapTypeControl: false,
      scaleControl: false,
      streetViewControl: false,
      rotateControl: false,
      // disabled mouse wheel zoom
      scrollwheel: false
    };
    
    var map = new google.maps.Map(document.getElementById('map-canvas'),
        mapOptions);

    var infowindow;
    // show Information Window Event
    var showInfoWindow = function(markerObj) {
      if(infowindow) {
        infowindow.close();
      }
      var content = '<strong>' + markerObj.getTitle() + '</strong><br />' + markerObj.content;
      infowindow = new google.maps.InfoWindow({
        content: content
      });
      return infowindow.open(map, markerObj);
    };

    // add markers
    for(var i=0, l=myMarkers.length; i<l; i+=1) {
      var markerData = myMarkers[i],
          marker = new google.maps.Marker({
            position: new google.maps.LatLng( markerData.position[0], markerData.position[1] ),
            title: markerData.title,
            content: markerData.content,
            map: map
          });

      google.maps.event.addListener(marker, 'click', function() {
        showInfoWindow(this);
      });
    }
  }
  
  function getMapStyle() {
    return [{
      featureType: 'all',
      elementType: 'labels.icon',
      stylers: [{visibility: 'off'}]
    }, {
      featureType: 'administrative',
      elementType: 'labels.text.fill',
      stylers: [{color: '#444444'}]
    }, {
      featureType:'landscape',
      elementType: 'all',
      stylers: [{color: '#f2f2f2'}]
    }, {
      featureType:'landscape',
      elementType: 'labels.text.fill',
      stylers: [{color: '#56D0BD'}]
    }, {
      featureType: 'poi',
      elementType: 'all',
      stylers: [{visibility: 'off'}]
    }, {
      featureType: 'road',
      elementType: 'all',
      stylers: [{saturation: -100},{lightness: 45}]
    }, {
      featureType: 'road.highway',
      elementType: 'all',
      stylers: [{visibility: 'simplified'}]
    }, {
      featureType: 'transit',
      elementType: 'all',
      stylers: [{visibility: 'off'}]
    }, {
      featureType: 'water',
      elementType: 'all',
      stylers: [{color: '#46bcec'},{visibility: 'on'}]
    }];
  }
  google.maps.event.addDomListener(window, 'load', initialize);
}();
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console