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.

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.

HTML

              
                    <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&signed_in=true"></script>

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

              
            
!

CSS

              
                 html, body, #map-canvas {
        height: 100%;
        margin: 0px;
        padding: 0px
      }

/*
Style A Google Maps on your website with the style of your website.

Here a quick example I did for a local physiotherapist (http://kine.sarabernaert.be/contact/).
Parameters I personalised:
- pointer (own image)
- zoom control (position)
- mapcontrol (street, sattelite, ..): disabled
- map colors

Sources to tweak your own map:
- https://developers.google.com/maps/documentation/javascript/
> all parameters you can put your hand on
- https://snazzymaps.com
>  nice website to give easily the color style a personal touch 
-  http://stackoverflow.com/questions/8879544/google-maps-zoom-control
> when the (zoom) controls are displayed distorted, read this thread
*/
              
            
!

JS

              
                var MY_MAPTYPE_ID = 'style_KINESB';

function initialize() {
  var featureOpts = [
    {
        "featureType": "administrative",
        "elementType": "labels.text.fill",
        "stylers": [
            {
                "color": "#444444"
            }
        ]
    },
    {
        "featureType": "landscape",
        "elementType": "all",
        "stylers": [
            {
                "color": "#f2f2f2"
            }
        ]
    },
    {
        "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": "road.arterial",
        "elementType": "labels.icon",
        "stylers": [
            {
                "visibility": "off"
            }
        ]
    },
    {
        "featureType": "transit",
        "elementType": "all",
        "stylers": [
            {
                "visibility": "off"
            }
        ]
    },
    {
        "featureType": "water",
        "elementType": "all",
        "stylers": [
            {
                "color": "#81BDD6"
            },
            {
                "visibility": "on"
            }
        ]
    }
];
  var myGent = new google.maps.LatLng(51.039266,3.635942);
  var Kine = new google.maps.LatLng(51.038817,3.610724);
  var mapOptions = {
    zoom: 13,
     mapTypeControl: false,
    zoomControl: true,
    zoomControlOptions: {
        style: google.maps.ZoomControlStyle.LARGE,
        position: google.maps.ControlPosition.LEFT_TOP,
      mapTypeIds: [google.maps.MapTypeId.ROADMAP, MY_MAPTYPE_ID]
    },
    mapTypeId: MY_MAPTYPE_ID,
    scaleControl: false,
    streetViewControl: false,
    center: myGent
  }
  var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
  
  var styledMapOptions = {
    name: 'style_KINESB'
  };

var image = 'http://kine.sarabernaert.be/wp-content/uploads/dynamik-gen/yyy/media/KINE_LOGO_85px_pin.svg';
  var marker = new google.maps.Marker({
      position: Kine,
      map: map,
animation: google.maps.Animation.DROP,
      title: 'Kinesitherapeute Sara Bernaert - Schepenstraat 53, Gent',
icon: image
  });

  var customMapType = new google.maps.StyledMapType(featureOpts, styledMapOptions);

  map.mapTypes.set(MY_MAPTYPE_ID, customMapType);

}

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

              
            
!
999px

Console