Untitled diff
81 lines
<html>
<html>
<head>
<head>
<title></title>
<title></title>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.css" />
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.css" />
<style>
<style>
#map{
#map{
height: 75%;
height: 75%;
width:75%;
width:75%;
}
}
</style>
</style>
</head>
</head>
<body>
<body>
<script src="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.js"></script>
<script src="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.js"></script>
<div id="map" ></div>
<div id="map" ></div>
<script>
<script>
var map = L.map('map',
var map = L.map('map',
{
{
center: [35.10418, -106.62987],
center: [34.2083, -84.1375],
zoom: 9
zoom: 11
});
});
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png').addTo(map);
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' +
'<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
'Template code by <a href="https://geonet.esri.com/message/402576#402576">Paul Crickard</a>',
}).addTo(map);
function handleFileSelect(evt) {
function handleFileSelect(evt) {
evt.stopPropagation();
evt.stopPropagation();
evt.preventDefault();
evt.preventDefault();
var files = evt.dataTransfer.files; // FileList object.
var files = evt.dataTransfer.files; // FileList object.
var reader = new FileReader();
var reader = new FileReader();
reader.onload = function(event) {
reader.onload = function(event) {
var temp=event.target.result;
var temp=event.target.result;
var text=temp.replace( /\n/g, "," );
var text=temp.replace( /\n/g, "," );
var c=text.split(",");
var c=text.split(",");
for(i=0;i<c.length;i++){
for(i=0;i<c.length;i++){
url1="http://coagisweb.cabq.gov/arcgis/rest/services/locators/CABQ_AddressPoints/GeocodeServer/findAddressCandidates?Street=";
url1="http://gisp2.forsythco.com/arcgis/rest/services/CommonTools/AddressLocatorSingleHouse/GeocodeServer/findAddressCandidates?Street=";
url2=String(c[i]);
url2=String(c[i]);
url3="&outFields=&outSR=4326&f=pjson";
url3="&outFields=&outSR=4326&f=pjson";
url=url1.concat(url2,url3);
url=url1.concat(url2,url3);
var xhReq = new XMLHttpRequest();
var xhReq = new XMLHttpRequest();
xhReq.open("GET", url, false);
xhReq.open("GET", url, false);
xhReq.send(null);
xhReq.send(null);
var serverResponse = xhReq.responseText;
var serverResponse = xhReq.responseText;
var d=JSON.parse(serverResponse);
var d=JSON.parse(serverResponse);
if(typeof d.candidates[0] == 'undefined'){alert("error in address: "+url2);}
if(typeof d.candidates[0] == 'undefined'){alert("error in address: "+url2);}
else{
else{
L.marker([parseFloat(d.candidates[0].location.y),parseFloat(d.candidates[0].location.x)]).addTo(map).bindPopup(url2);
L.marker([parseFloat(d.candidates[0].location.y),parseFloat(d.candidates[0].location.x)]).addTo(map).bindPopup(url2);
}
}
}
}
}
}
var s = reader.readAsText(files[0],"UTF-8");
var s = reader.readAsText(files[0],"UTF-8");
}
}
function handleDragOver(evt) {
function handleDragOver(evt) {
evt.stopPropagation();
evt.stopPropagation();
evt.preventDefault();
evt.preventDefault();
evt.dataTransfer.dropEffect = 'copy'; // Explicitly show this is a copy.
evt.dataTransfer.dropEffect = 'copy'; // Explicitly show this is a copy.
}
}
// Setup the dnd listeners.
// Setup the dnd listeners.
var dropZone = document.getElementById('map');
var dropZone = document.getElementById('map');
dropZone.addEventListener('dragover', handleDragOver, false);
dropZone.addEventListener('dragover', handleDragOver, false);
dropZone.addEventListener('drop', handleFileSelect, false);
dropZone.addEventListener('drop', handleFileSelect, false);
</script>
</script>
</body>
</body>
</html>
</html>