Sha256: c5fb7f4e112926030e617a2c8a48d21e9f86a2153a38e634eb9998e36ab16cf2

Contents?: true

Size: 1.9 KB

Versions: 10

Compression:

Stored size: 1.9 KB

Contents

var google;

function init() {
    // Basic options for a simple Google Map
    // For more options see: https://developers.google.com/maps/documentation/javascript/reference#MapOptions
    // var myLatlng = new google.maps.LatLng(40.71751, -73.990922);
    var myLatlng = new google.maps.LatLng(40.69847032728747, -73.9514422416687);
    // 39.399872
    // -8.224454
    
    var mapOptions = {
        // How zoomed in you want the map to start at (always required)
        zoom: 7,

        // The latitude and longitude to center the map (always required)
        center: myLatlng,

        // How you would like to style the map. 
        scrollwheel: false,
        styles: [
            {
                "featureType": "administrative.country",
                "elementType": "geometry",
                "stylers": [
                    {
                        "visibility": "simplified"
                    },
                    {
                        "hue": "#ff0000"
                    }
                ]
            }
        ]
    };

    

    // Get the HTML DOM element that will contain your map 
    // We are using a div with id="map" seen below in the <body>
    var mapElement = document.getElementById('map');

    // Create the Google Map using out element and options defined above
    var map = new google.maps.Map(mapElement, mapOptions);
    
    var addresses = ['New York'];

    for (var x = 0; x < addresses.length; x++) {
        $.getJSON('http://maps.googleapis.com/maps/api/geocode/json?address='+addresses[x]+'&sensor=false', null, function (data) {
            var p = data.results[0].geometry.location
            var latlng = new google.maps.LatLng(p.lat, p.lng);
            new google.maps.Marker({
                position: latlng,
                map: map,
                icon: 'images/loc.png'
            });

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

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
jekyll-theme-digitalebrain-0.1.7.7 assets/js/google-map.js
jekyll-theme-digitalebrain-0.1.7.6 assets/js/google-map.js
jekyll-theme-digitalebrain-0.1.7.5 assets/js/google-map.js
jekyll-theme-digitalebrain-0.1.7.4 assets/js/google-map.js
jekyll-theme-digitalebrain-0.1.7.3 assets/js/google-map.js
jekyll-theme-digitalebrain-0.1.7.2 assets/js/google-map.js
jekyll-theme-digitalebrain-0.1.7 assets/js/google-map.js
jekyll-theme-digitalebrain-0.1.3 assets/js/google-map.js
jekyll-theme-digitalebrain-0.1.2 assets/js/google-map.js
jekyll-theme-digitalebrain-0.1.1 assets/js/google-map.js