Leaflet.draw
HTML
<script src="http://leaflet.github.com/Leaflet.draw/lib/leaflet/leaflet.js"></script>
<link rel="stylesheet" href="http://leaflet.github.com/Leaflet.draw/lib/leaflet/leaflet.css">
<input type="hidden" id="url" name="url" value="'. $datafile. '">
<div id="map"></div>
CSS
#map {
height: 340px;
}
JavaScript
imageUrl='';
$('#forms').on('submit',function(e) {
$.ajax({
url:'fun.php',
data:$('#forms').serializeArray(),
type:'GET',
success:function(result){
$('#downloads').html(result);
$(".nodata").appendTo("div#map");
//window.url=document.getElementById("url").value;
//raster = L.imageOverlay(imageUrl, [[-3.00, 31.00], [0.50, 35.00]]);
//window.imageUrl='$datafile';
$("a.next").appendTo("div#map");
$("a.prev").appendTo("div#map");
// $(".legend").appendTo("div#map");
$("#legendcont").appendTo("div#map");
window.revisedURL =document.getElementById("url").value;
alert(revisedURL);
//document.getElementById("forms").reset();
}
});
e.preventDefault(); //=== To Avoid Page Refresh and Fire the Event "Click"===
});
</script>
var imageUrl='';
var grayscale = L.tileLayer('https://{s}.tiles.mapbox.com/v3/{id}/{z}/{x}/{y}.png', {
id: 'examples.map-20v6611k',
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>, ' +
'Imagery © <a href="http://mapbox.com">Mapbox</a>'}),
streets = L.tileLayer('https://{s}.tiles.mapbox.com/v3/{id}/{z}/{x}/{y}.png', {
id: 'examples.map-i86knfo3',
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>, ' +
'Imagery © <a href="http://mapbox.com">Mapbox</a>'}),
satellite = L.tileLayer('http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer\
/tile/{z}/{y}/{x}', {
attribution: '© <a href="http://www.esri.com/">Esri </a>' + 'i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, \
and the GIS User Community'}),
kml = omnivore.kml('ea.kml'),
raster = L.imageOverlay(imageUrl, [[-3.00, 31.00], [0.50, 35.00]]); ...