Skip to content

Instantly share code, notes, and snippets.

@russ
Created December 29, 2010 23:15
Show Gist options
  • Save russ/759201 to your computer and use it in GitHub Desktop.
Save russ/759201 to your computer and use it in GitHub Desktop.
$(".map-marker").each(function() {
var title = $(this).data("title")
var lat = $(this).data("lat")
var lng = $(this).data("lng") var marker = new google.maps.Marker({
position: new google.maps.LatLng(lat, lng),
map: map,
title: title });
var infowindow = new google.maps.InfoWindow({
content: $(this).html() });
google.maps.event.addListener(marker, "click", function() {
infowindow.open(map, marker); });
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment