Skip to content

Instantly share code, notes, and snippets.

@tomviner
Forked from seb-thomas/gist:4285197
Created December 14, 2012 12:41
Show Gist options
  • Save tomviner/4285213 to your computer and use it in GitHub Desktop.
Save tomviner/4285213 to your computer and use it in GitHub Desktop.
with if?
$.getJSON('media/js/markers.json', function(data){
$.each(data.markers, function(i, marker){
if (...) {
map.addMarker({
id: i,
tags: marker.tag,
lat: marker.latitude,
lng: marker.longitude,
infoWindow: {
content: '<h2>' + marker.name + '</h2><p>' + marker.address + '</p>'
}
});
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment