Last active
August 29, 2015 13:56
-
-
Save aaronlidman/8908291 to your computer and use it in GitHub Desktop.
IRC problem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
var map = L.mapbox.map('map', 'examples.map-9ijuk24y') | |
.setView([38.9880463, -76.9442844], 15), | |
markers; | |
$.getJSON("jsonRetrieval.php", function (data) { | |
markers = L.geoJson(data, { | |
onEachFeature: onEachFeature | |
}).addTo(map); | |
}); | |
function onEachFeature(feature, layer) { | |
layer.bindPopup('this is popup text'); | |
} | |
markers.on('click', function(e){ | |
console.log(e); | |
}); | |
map.on('click',function(e){ | |
document.getElementById('info').innerHTML = ''; | |
}); | |
//Get coordinates from click | |
var click = document.getElementById('click'), | |
mousemove = document.getElementById('mousemove'); | |
map.on('click', function(e) { | |
//window[e.type].innerHTML = e.containerPoint.toString() + ', ' + e.latlng.toString(); | |
var latLong = e.latlng.toString(); | |
var replaceLatLng = latLong.replace("LatLng", ""); | |
var replaceLeftParen = replaceLatLng.replace("(",""); | |
var replaceRightParen = replaceLeftParen.replace(")",""); | |
var removeSpace = replaceRightParen.replace(" ", ""); | |
var positionArray = removeSpace.split(","); | |
document.getElementById("requiredlatitude").value = positionArray[0]; | |
document.getElementById("requiredlongitude").value = positionArray[1]; | |
}); | |
$(document).ready(function() { | |
$('#addEventMenu').sidr({ | |
name: 'sidr-left', | |
side: 'left' | |
}); // initialize left side menu | |
}); | |
//initilize date | |
$(function() { | |
$( "#requiredstartDate" ).datepicker(); | |
$( "#requiredendDate" ).datepicker(); | |
$( "#requiredstarttime" ).timepicker({ | |
timeFormat: "hh:mm:ss TT"//, | |
//controlType: 'select' | |
}); | |
$( "#requiredendtime" ).timepicker({ | |
timeFormat: "hh:mm:ss TT"//, | |
//controlType: 'select' | |
}); | |
}); | |
//REQUIRED vs OPTIONAL | |
function checkrequired(which){ | |
var pass=true | |
if (document.images){ | |
for (i=0;i<which.length;i++){ | |
var tempobj=which.elements[i] | |
if (tempobj.name.substring(0,8)=="required"){ | |
if (((tempobj.type=="text"||tempobj.type=="textarea")&&tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s"&&tempobj.selectedIndex==-1)){ | |
pass=false | |
break | |
} | |
} | |
} | |
} | |
if (!pass){ | |
alert("One or more of the required elements are not completed. Please complete them, then submit again!") | |
return false | |
} | |
else | |
return true | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment