1.0.4 • Published 10 years ago

googlemap v1.0.4

Weekly downloads
22
License
WTFPL
Repository
github
Last release
10 years ago

googlemap

Simple class which makes Google Maps out of HTML attributes.

Documentation

Sample data and HTML markup (latitude and longitude are required for each item):

[
    {
        "latitude": 55.944083,
        "longitude": -3.161833,
        "title": "Arthurs Seat"
    },
    {
        "latitude": 51.507752,
        "longitude": -0.12793,
        "title": "Nelsons Column"
    }
]
<div id="map" data-markers='{{ markers }}'></div>

Simple example:

var mapCanvas = document.getElementById('map');

new GoogleMap(mapCanvas);

Marker click event callbacks:

var mapCanvas = document.getElementById('map');

new GoogleMap(mapCanvas, {
    markerClickCallback: function (marker, data) {
        return window.location = 'http://www.google.co.uk?q=' + data.title;
    }
});
1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago