1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
// concatenate events specific to vector with those from the base
this.EVENT_TYPES =
OpenLayers.Control.DrawFeature.prototype.EVENT_TYPES.concat(
OpenLayers.Control.prototype.EVENT_TYPES
);
OpenLayers.Control.prototype.initialize.apply(this, [options]);
this.callbacks = OpenLayers.Util.extend(
{
done: this.drawFeature,
modify: function(vertex, feature) {
this.layer.events.triggerEvent(
"sketchmodified", {vertex: vertex, feature: feature}
);
},
create: function(vertex, feature) {
this.layer.events.triggerEvent(
"sketchstarted", {vertex: vertex, feature: feature}
);
}
},
this.callbacks
);
this.layer = layer;
var sketchStyle = this.layer.styleMap && this.layer.styleMap.styles.temporary;
if(sketchStyle) {
this.handlerOptions = this.handlerOptions || {};
this.handlerOptions.layerOptions = OpenLayers.Util.applyDefaults(
this.handlerOptions.layerOptions,
{styleMap: new OpenLayers.StyleMap({"default": sketchStyle})}
);
} |
Partager