我正在尝试使用 esri 传单在共享点地图中添加搜索栏。
它在 IE 和谷歌浏览器中运行良好...
现在,如果我在 sharepoint 中使用相同的脚本.. 我有这个错误:“Uncaught TypeError: Cannot read propenter code hereerty 'Controls' of undefined”</p>
- 第一个脚本是我用来显示地图的
- 第二个脚本是我用来导入 js 文件的主文件
//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>