角度版本:8
package.json 中的版本:
"leaflet": "1.5.1",
"leaflet-draw": "1.0.4",
"leaflet-sidebar-v2": "3.0.3",
"esri-leaflet": "2.3.2",
"leaflet-control-geocoder": "1.10.0"
我有进口传单和其他这样的:
import * as L from 'leaflet';
import 'leaflet-draw';
import * as esri from 'esri-leaflet';
import 'leaflet-sidebar-v2';
import 'leaflet-control-geocoder';
现在我必须使用或传单控制地理编码器来实现这个功能,但如果我写这个:
L.control.geocoder().addTo(map);
角度崩溃。(“typeof Control”类型上不存在属性“geocoder”)我也尝试使用esri-leaflet-geocoder,但它也崩溃了。
任何解决方案?