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 includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

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

              
                <link rel="stylesheet" type="text/css" href="https://unpkg.com/snazzy-info-window@1.1.1/dist/snazzy-info-window.min.css" media="screen" />

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

<!--API KEY for development only-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&language=de&region=de"></script>
<script src="https://unpkg.com/snazzy-info-window@1.1.1/dist/snazzy-info-window.min.js"></script>
              
            
!

CSS

              
                /* for preview only */

body, html {
	margin: 0;
	box-sizing: border-box;
}

@import url("https://fonts.googleapis.com/css?family=Noto+Sans:400,700");

/* CSS begins here */

#map {
	height: 600px;
	width: 100%;
}

.si-content {
	width: 140px;
}

.si-content h4 {
	margin-top: 0px;
	margin-bottom: 10px;
	font-family: "Noto Sans", sans-serif;
	font-weight: 700;
}

.si-content p {
	margin-top: 0px;
	margin-bottom: 0px;
	font-family: "Noto Sans", sans-serif;
	font-weight: 400;
	line-height: 1.4;
}
              
            
!

JS

              
                $(document).ready(function() {
  $(function() {
    var office = new google.maps.LatLng(52.49159, 13.395);
    var coffee = new google.maps.LatLng(52.4897097, 13.3959);
    var map = new google.maps.Map($("#map")[0], {
      zoom: 16,
      center: new google.maps.LatLng(52.497, 13.396),
      styles: [
        {
          elementType: "geometry",
          stylers: [
            {
              color: "#f5f5f5"
            }
          ]
        },
        {
          elementType: "labels.icon",
          stylers: [
            {
              visibility: "off"
            }
          ]
        },
        {
          elementType: "labels.text.fill",
          stylers: [
            {
              color: "#616161"
            }
          ]
        },
        {
          elementType: "labels.text.stroke",
          stylers: [
            {
              color: "#f5f5f5"
            }
          ]
        },
        {
          featureType: "administrative.land_parcel",
          elementType: "labels.text.fill",
          stylers: [
            {
              color: "#bdbdbd"
            }
          ]
        },
        {
          featureType: "poi",
          elementType: "geometry",
          stylers: [
            {
              color: "#eeeeee"
            }
          ]
        },
        {
          featureType: "poi",
          elementType: "labels.text.fill",
          stylers: [
            {
              color: "#757575"
            }
          ]
        },
        {
          featureType: "poi.park",
          elementType: "geometry",
          stylers: [
            {
              color: "#e5e5e5"
            }
          ]
        },
        {
          featureType: "poi.park",
          elementType: "labels.text.fill",
          stylers: [
            {
              color: "#9e9e9e"
            }
          ]
        },
        {
          featureType: "road",
          elementType: "geometry",
          stylers: [
            {
              color: "#ffffff"
            }
          ]
        },
        {
          featureType: "road.arterial",
          elementType: "labels.text.fill",
          stylers: [
            {
              color: "#757575"
            }
          ]
        },
        {
          featureType: "road.highway",
          elementType: "geometry",
          stylers: [
            {
              color: "#dadada"
            }
          ]
        },
        {
          featureType: "road.highway",
          elementType: "labels.text.fill",
          stylers: [
            {
              color: "#616161"
            }
          ]
        },
        {
          featureType: "road.local",
          elementType: "labels.text.fill",
          stylers: [
            {
              color: "#9e9e9e"
            }
          ]
        },
        {
          featureType: "transit.line",
          elementType: "geometry",
          stylers: [
            {
              color: "#e5e5e5"
            }
          ]
        },
        {
          featureType: "transit.station",
          elementType: "geometry",
          stylers: [
            {
              color: "#eeeeee"
            }
          ]
        },
        {
          featureType: "water",
          elementType: "geometry",
          stylers: [
            {
              color: "#c9c9c9"
            }
          ]
        },
        {
          featureType: "water",
          elementType: "labels.text.fill",
          stylers: [
            {
              color: "#9e9e9e"
            }
          ]
        }
      ]
    });

    // icon for office marker

    var imageOffice = {
      url:
        "https://uploads-ssl.webflow.com/5b05ed948ee27f736bbe9315/5bd8be2551cc3d4596ee6e3c_marker-office-animated.svg",
      anchor: new google.maps.Point(60, 100),
      scaledSize: new google.maps.Size(120, 120)
    };

    // icon for coffee marker

    var imageCoffee = {
      url:
        "https://uploads-ssl.webflow.com/5b05ed948ee27f736bbe9315/5bd8c0707089347718fd15bd_marker-coffee-animated.svg",
      anchor: new google.maps.Point(60, 100),
      scaledSize: new google.maps.Size(120, 120)
    };

    // office marker

    var markerOffice = new google.maps.Marker({
      animation: google.maps.Animation.DROP,
      map: map,
      position: office,
      icon: imageOffice,
      draggagle: true
    });

    // coffee marker

    var markerCoffee = new google.maps.Marker({
      animation: google.maps.Animation.DROP,
      map: map,
      position: coffee,
      icon: imageCoffee,
      draggagle: true
    });

    // infowindow for office marker

    var infoOffice = new SnazzyInfoWindow({
      marker: markerOffice,
      backgroundColor: "rgba(255,255,255,0.9)",
      placement: "left",
      offset: {
        top: "-55px",
        left: "-55px"
      },
      padding: "30px",
      pointer: "8px",
      content:
        '<div id="content">' +
        "<h4>Office</h4>" +
        " <p>Lust auf einen ☕ ?</br>" +
        " ☎️ +49 175 11 38 245</br>" +
        " Gneisenaustraße 89</br>" +
        " 10961 Berlin</p>" +
        "</div>",
      border: {
        width: "0px",
        color: "white"
      },
      borderRadius: "8px",
      fontColor: "black",
      shadow: {
        h: "0px",
        v: "3px",
        blur: "20px",
        spread: "0px",
        opacity: 0.2,
        color: "#000"
      }
    });

    // infowindow for coffee marker

    var infoCoffee = new SnazzyInfoWindow({
      marker: markerCoffee,
      backgroundColor: "rgba(255,255,255,0.9)",
      placement: "right",
      offset: {
        top: "-55px",
        left: "55px"
      },
      padding: "30px",
      pointer: "8px",
      content:
        '<div id="content">' +
        "<h4>Chapter One</h4>" +
        " <p>Bester ☕ in Xberg !</br>" +
        " <p>... Lass uns reden 🍰</br>" +
        " Mittenwalder Str. 30</br>" +
        "</div>",
      border: {
        width: "0px",
        color: "white"
      },
      borderRadius: "8px",
      fontColor: "black",
      shadow: {
        h: "0px",
        v: "3px",
        blur: "20px",
        spread: "0px",
        opacity: 0.2,
        color: "#000"
      }
    });

    // media query closes infowindow on mobile devices

    var deviceWidth = window.matchMedia("(max-width: 600px)");

    function myFunction(deviceWidth) {
      if (deviceWidth.matches) {
        infoOffice.close();
        infoCoffee.close();
      } else {
        infoOffice.open();
        infoCoffee.open();
      }
    }

    // media query recenter map on mobile devices

    google.maps.event.addDomListener(window, "resize", function() {
      var zoom;
      var mobileLatLng;

      if (window.matchMedia("(max-width: 600px)").matches) {
        zoom = 15;
        mobileLatLng = new google.maps.LatLng(52.49168, 13.39541);
      } else {
        zoom = 16;
        mobileLatLng = new google.maps.LatLng(52.49159, 13.395);
      }
      map.setCenter(mobileLatLng);
      map.setZoom(zoom);
    });

    // attach listener function on state changes
    deviceWidth.addListener(myFunction);
    // call listener function at run time
    myFunction(deviceWidth);

    // polyline points

    var officeToCoffee = [
      { lat: 52.49159, lng: 13.395 },
      { lat: 52.4917036, lng: 13.39449218 },
      { lat: 52.49142924, lng: 13.39439026 },
      { lat: 52.48960661, lng: 13.393886 },
      { lat: 52.48940409, lng: 13.39589766 },
      { lat: 52.48971114, lng: 13.39598349 },
      { lat: 52.4897226, lng: 13.3959282 }
    ];

    // polyline options

    var simplePolyline = new google.maps.Polyline({
      path: officeToCoffee,
      geodesic: true,
      strokeColor: "#0176FF",
      strokeOpacity: 0.5,
      strokeWeight: 6
    });

    // polyline draws

    simplePolyline.setMap(map);
  });
});

// DONE 🦋

              
            
!
999px

Console