IClient for js 8c,控件selectGraphic如何设置多目标图层?
如下方式只能设置一个图层:
var selectGraphic = new SuperMap.Control.SelectGraphic(MygraphicLayer, {
callbacks : null//callbacks
});
api文档里包括源码里有layer和layers两个属性,想问一下怎么加多图层?下面方法显然不行
var selectGraphic = new SuperMap.Control.SelectGraphic([MygraphicLayer], {
callbacks : null//callbacks
});
从Git上找到的源码,初始化方法,里面只有layer初始化赋值。so,不知道layers怎么搞:
initialize: function(layer, options) {
SuperMap.Control.prototype.initialize.apply(this, [options]);
if(this.scope === null) {
this.scope = this;
}
//this.initLayer(layers);
if(layer){
this.layer = layer;
}
var callbacks = {
click: this.select,
clickout: this.unselect,
over: this.overGraphic,
out: this.outGraphic
};
this.callbacks = SuperMap.Util.extend(callbacks, this.callbacks);
this.handlers = {
graphic: new SuperMap.Handler.Graphic(
this,
this.layer,
this.callbacks,
{
stopDown:false
}
)
};
}