JSFiddle - React, Tailwind, and code Playground
by Chase Wilson
JavaScript
for (var i = 0; i < spots.length; i++) {
doShitToSpot(spots[i]);
//latlngbounds.extend( spotLatLng );
}
function doShitToSpot(spot){
doShitToSpot.hit = doShitToSpot.hit || 0;
spot.latLng = new google.maps.LatLng(spot.lat, spot.lng);
spot.title = 'Spot #'+ (doShitToSpot.hit++);
var marker = new google.maps.Marker({
position: spot.latLng,
map: map,
title: spot.title
});
google.maps.event.addListener(marker, 'click', function() {
alert(spot.latLng.lat() + ' :: '+ spot.latLng.lng() );
});
}