Angularjs 角度传单指令-复制层示例
如何使用angular传单指令复制示例? 我理解这个示例,但是当我应用示例源代码的最后一行时Angularjs 角度传单指令-复制层示例,angularjs,ionic-framework,leaflet,angular-leaflet-directive,Angularjs,Ionic Framework,Leaflet,Angular Leaflet Directive,如何使用angular传单指令复制示例? 我理解这个示例,但是当我应用示例源代码的最后一行时 L.control.layers(baseLayers, overlays).addTo(map); 那是我必须适应的 L.control.layers(baseLayers, overlays).addTo($scope); 因为所有地图属性现在都在$scope中 angular.extend($scope,{ defaults: {
L.control.layers(baseLayers, overlays).addTo(map);
那是我必须适应的
L.control.layers(baseLayers, overlays).addTo($scope);
因为所有地图属性现在都在$scope中
angular.extend($scope,{
defaults: {
layers: [streetLayer,sateliteLayer,oceanLayer],
maxZoom: 16,
zoomControl: false,
doubleClickZoom: true,
path: {
weight: 10,
color: '#800000',
opacity: 1
}
}
});
我明白了
TypeError: this._map.on is not a function
at o.Control.Layers.o.Control.extend._initLayout (leaflet.js:9)
at o.Control.Layers.o.Control.extend.onAdd (leaflet.js:9)
at o.Control.o.Class.extend.addTo (leaflet.js:9)
at new <anonymous> (mapController.js:135)
at invoke (ionic.bundle.js:12884)
at Object.instantiate (ionic.bundle.js:12892)
at ionic.bundle.js:17161
at self.appendViewElement (ionic.bundle.js:48243)
at Object.switcher.render (ionic.bundle.js:46441)
at Object.switcher.init (ionic.bundle.js:46361)
TypeError:this.\u map.on不是函数
在o.Control.Layers.o.Control.extend.\u initLayout(传单js:9)
位于o.Control.Layers.o.Control.extend.onAdd(传单js:9)
在o.Control.o.Class.extend.addTo(传单js:9)
新建(mapController.js:135)
调用时(ionic.bundle.js:12884)
在Object.instantiate(IONAL.bundle.js:12892)
在爱奥尼亚束js:17161
在self.appendViewElement(ionic.bundle.js:48243)
在Object.switcher.render(ionic.bundle.js:46441)
在Object.switcher.init(ionic.bundle.js:46361)
你能创建一个plunker/JSFIDLE或类似的东西让我看看吗?谢谢,但我不知道如何将传单和ionic集成到JSFIDLE或类似的东西中…你能创建一个plunker/JSFIDLE或类似的东西让我看看吗?谢谢,但我不知道如何将传单和ionic集成到JSFIDLE或类似的东西中。。。