Why can't I load my basemap from the ArcGIS rest services using leaflet ? do I need to include"the esri-leaflet" package as well to use ArcGIS rest services in leaflet?*
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="leaflet.css"/>
<!--[if lte IE 8]>
<link rel="stylesheet" type="text/css" href="leaflet/leaflet.ie.css"/>
<![endif]-->
<script src="leaflet.js"></script>
<style>
html, body, #map {
height:100%;
}
body {
padding:0;
margin:0;
}
</style>
<title>Getting Started with Leaflet</title>
</head>
<body>
<div id="map"></div>
<script type="text/javascript">
var map=L.map('map',{
center:[52.48,-1.89],
zoom:14
});
L.marker([52.48,-1.89],{
clickable:true
})
.bindPopup('Hello Birmingham!')
.addTo(map);
L.marker([52.48,-1.900],{
clickable:true,
draggable:true,
icon:L.icon({
iconUrl:'images/packtpub.png',
iconAnchor:[32,32],
popupAnchor:[32,10]
})
})
.bindPopup('Hello custom!')
.addTo(map);
L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',{attribution:'© OpenStreetMap contributors'}).addTo(map);
var hydro=L.tileLayer.wms('http://apps.geoportal.icimod.org/icimodarcgis/rest/services/HKH/AnnualSolarRadiation/MapServer',{
format:'image/png',
transparent:true,
attribution:'Contains British Geological Survey materials NERC 2013',
opacity:0.25
});
var soil =L.tileLayer.wms('http://apps.geoportal.icimod.org/icimodarcgis/rest/services/HKH/AnnualSolarRadiation/MapServer',{
format:'image/png',
transparent:true,
attribution:'Contains British Geological Survey materials NERC 2013'});
var firstGroup = L.layerGroup([
L.marker([52.486,-1.890]),
L.marker([52.488,-1.890]),
L.marker([52.490,-1.890]),
L.marker([52.483,-1.890]),
L.marker([52.482,-1.880]),
hydro
]).addTo(map);
var secondGroup = L.layerGroup([
L.marker([52.4846,-1.900]),
L.marker([52.487,-1.890]),
L.marker([52.489,-1.896]),
L.marker([52.484,-1.894]),
L.marker([52.4862,-1.880]),
soil
]);
map.on('click',function(e){
if (map.hasLayer(firstGroup)){
map.removeLayer(firstGroup);
map.addLayer(secondGroup);
} else{
map.removeLayer(secondGroup);
map.addLayer(firstGroup);
}
});
</script>
</body>
</html>