Skip to content

Instantly share code, notes, and snippets.

@neuman
Created March 12, 2015 22:22
Show Gist options
  • Save neuman/090436e5dae5f99a5808 to your computer and use it in GitHub Desktop.
Save neuman/090436e5dae5f99a5808 to your computer and use it in GitHub Desktop.
$( document ).ready(function() {
var map = new GMaps({
el: '#map',
lat: -12.043333,
lng: -77.028333
});
var locations = $(".location-data");
locations.each( function( key, value ) {
map.addMarker({
lat: $(this).data('latitude'),
lng: $(this).data('longitude'),
title: $(this).html(),
click: function(e) {
alert('You clicked in this marker');
}
});
});
map.fitZoom();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment