Springs Interactive Map

Williford-Spring_banner
var to_ll = function(value,type) { switch (type) { case 'lat': var direction = (value < 0) ? "E" : "W"; break; case 'long': var direction = (value < 0) ? "N" : "S"; break; } var absValue = Math.abs(Math.round(value * 1000000.)); return ((Math.floor(absValue / 1000000)) + '° ' + Math.floor( ((absValue/1000000) - Math.floor(absValue/1000000)) * 60) + '\' ' + ( Math.floor(((((absValue/1000000) - Math.floor(absValue/1000000)) * 60) - Math.floor(((absValue/1000000) - Math.floor(absValue/1000000)) * 60)) * 100000) *60/100000 ) + '" ' + direction) }; $(function() { var map = new GMaps({ div: '#map', lat: 30.29605, lng: -85.41051, zoom: 8, mapTypeId : google.maps.MapTypeId.ROADMAP, styles: [ { stylers: [ { saturation: -63 } ]}, { featureType: "road.local", stylers: [ { visibility: "simplified" } ]}, { featureType: "landscape", stylers: [ { visibility: "off" } ] }, { featureType: "poi", stylers: [ { visibility: "off" } ] }, { featureType: "administrative.neighborhood", stylers: [ { visibility: "off" } ] }, { featureType: "administrative.land_parcel", stylers: [ { visibility: "off" } ] }, { featureType: "road.highway", elementType: "labels", stylers: [ { visibility: "off" } ] }, { featureType: "road.highway", elementType: "geometry", stylers: [ { visibility: "simplified" } ] }, { featureType: "transit", stylers: [ { visibility: "off" } ] } ] }); $.ajax({ url: '//s3.us-east-2.amazonaws.com/nwfwatersgs/hydrologic/springs.json', dataType: 'json', }).done(function(json){ $.each(json.features, function( index, value ) { var latitude = to_ll(value.geometry.coordinates[0],'lat'); var longitude = to_ll(value.geometry.coordinates[1],'long'); map.addMarker({ lat: value.geometry.coordinates[0], lng: value.geometry.coordinates[1], title: value.properties.name, icon: { path: google.maps.SymbolPath.CIRCLE, strokeColor: '#3185c6', strokeWeight: 1, fillColor: '#acd6ef', fillOpacity: 0.5, scale: 7, zIndex: 99 }, infoWindow: { content: '

' + value.properties.name + '


Latitude: '+latitude+'


Longitude: '+longitude+'


Coordinates: ('+value.geometry.coordinates[0]+', '+value.geometry.coordinates[1]+')

' } }); }); }); });