Javascript 传单:强制从图层扩展重新绘制地图
我目前正在开发L.TileLayer类的扩展,我想在initialize方法中调用地图上的重画。我的代码如下所示:Javascript 传单:强制从图层扩展重新绘制地图,javascript,geospatial,leaflet,Javascript,Geospatial,Leaflet,我目前正在开发L.TileLayer类的扩展,我想在initialize方法中调用地图上的重画。我的代码如下所示: L.TileLayer.NewLayerType = L.TypeLayer.extend({ _newLayerType: null, initialize: function(file, options) { var foo = new Foo(file, this, function(scope) { ...
L.TileLayer.NewLayerType = L.TypeLayer.extend({
_newLayerType: null,
initialize: function(file, options) {
var foo = new Foo(file, this, function(scope) {
...
scope.redraw();
});
L.Utils.setOptions(this, options);
},
...
});
问题是,scope.redraw()调用不起作用,在调用scope.\u map.zoomIn()和scope.\u map.zoomOut()之后,任何其他刷新映射的方法也不起作用。重新绘制是否因为范围是图层扩展而不起作用?最好的方法是什么
谢谢只是想知道<代码>类型层?