I'm trying to add search bar in sharepoint map using esri leaflet.
It works well in IE, and google chrome...
Now If i use the same script in sharepoint.. I have this error: “Uncaught TypeError: Cannot read propenter code hereerty 'Controls' of undefined”
- the first script is that i use for showing map
- the second script is main file whish i use for import the js files
//Bare de recherche
var results = new L.LayerGroup().addTo(oMap);
var searchControl = new L.esri.Controls.Geosearch().addTo(oMap);
//var searchControl = new L.esri.Geocoding.geosearch().addTo(oMap);
searchControl.on('results', function(data){
results.clearLayers();
for (var i = data.results.length - 1; i >= 0; i--) {
results.addLayer(L.marker(data.results[i].latlng));
}
});
setTimeout(function(){$('.pointer').fadeOut('slow');},3400);
<script type="text/javascript">
document.writeln("<script src='https://cdn-geoweb.s3.amazonaws.com/esri-leaflet/0.0.1-beta.5/esri-leaflet.js'><" + "/script>");
document.writeln("<script src='https://cdn-geoweb.s3.amazonaws.com/esri-leaflet-geocoder/0.0.1-beta.5/esri-leaflet-geocoder.js'><" + "/script>");
document.writeln("<link rel='stylesheet' href='https://cdn-geoweb.s3.amazonaws.com/esri-leaflet-geocoder/0.0.1-beta.5/esri-leaflet-geocoder.css'><" + "/link>");
//Fin de bar de recherche
</script>