Skip to content

Instantly share code, notes, and snippets.

@markhillard
Created March 12, 2017 05:36
Show Gist options
  • Select an option

  • Save markhillard/e96ea0d3b6fc93e6b6679c630998b196 to your computer and use it in GitHub Desktop.

Select an option

Save markhillard/e96ea0d3b6fc93e6b6679c630998b196 to your computer and use it in GitHub Desktop.

Revisions

  1. markhillard created this gist Mar 12, 2017.
    7 changes: 7 additions & 0 deletions google-maps-sandbox.markdown
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    Google Maps Sandbox
    -------------------
    Just messing around with the Google Maps JavaScript API.

    A [Pen](http://codepen.io/markhillard/pen/KVNoXz) by [Mark Hillard](http://codepen.io/markhillard) on [CodePen](http://codepen.io/).

    [License](http://codepen.io/markhillard/pen/KVNoXz/license).
    1 change: 1 addition & 0 deletions index.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    <div id="map-canvas"></div>
    31 changes: 31 additions & 0 deletions script.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,31 @@
    var map;

    // initialize map
    function initMap() {
    map = new google.maps.Map(document.getElementById('map-canvas'), {
    zoom: 17,
    center: {
    lat: 32.752357,
    lng: -79.874714
    },
    backgroundColor: '#fcfcfc',
    scrollwheel: true,
    fullscreenControl: true,
    fullscreenControlOptions: true,
    rotateControl: true,
    rotateControlOptions: true,
    tilt: 45
    });

    var marker = new google.maps.Marker({
    map: map,
    position: {
    lat: 32.752357,
    lng: -79.874714
    },
    title: 'Fort Sumter National Monument'
    });
    }

    // load map
    google.maps.event.addDomListener(window, 'load', initMap);
    1 change: 1 addition & 0 deletions scripts
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    <script src="//maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
    1 change: 1 addition & 0 deletions style.css
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    html,body,#map-canvas { height:100%; }