iClient js目前不支持。
但是可以自己实现,下载iClient js源码,扩展handler或者重写相关方法即可,
比如重写SuperMap.Handler.Point的modifyFeature方法,该方法在鼠标移动等事件时在图层上绘制点,鼠标移动事件及modifyFeature方法源码如下:
/**
* Method: move
* Handle mousemove and touchmove. Adjust the geometry and redraw.
* Return determines whether to propagate the event on the map.
*
* Parameters:
* evt - {Event} The browser event
*
* Returns:
* {Boolean} Allow event propagation
*/
move: function (evt) {
if(!this.touch // no point displayed until up on touch devices
&& (!this.mouseDown || this.stoppedDown)) {
this.modifyFeature(evt.xy);
}
return true;
},
/**
* Method: modifyFeature
* Modify the existing geometry given a pixel location.
*
* Parameters:
* pixel - {<SuperMap.Pixel>} A pixel location on the map.
*/
modifyFeature: function(pixel) {
if(!this.point) {
this.createFeature(pixel);
}
var lonlat = this.layer.getLonLatFromViewPortPx(pixel);
if(this.control.snap){
lonlat=this.control.snap.beginSnap(lonlat);
}
this.point.geometry.x = lonlat.lon;
this.point.geometry.y = lonlat.lat;
this.callback("modify", [this.point.geometry, this.point, false]);
this.point.geometry.clearBounds();
this.drawFeature();
},
iClient js GitHub地址:https://github.com/SuperMap/iClient-JavaScript-Classic