src.drawFeature.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ol2controls Show documentation
Show all versions of ol2controls Show documentation
OpenLayers 2 Controls plugin for Geoladris
The newest version!
define([ 'ol2/controlRegistry', 'ol2/map' ], function(controlRegistry, map) {
controlRegistry.registerControl('drawFeature', function(message) {
var handler = message.handlerType;
var layer = map.getMap().getLayer(message.editingLayerId);
var drawControl = null;
if (message.handlerType == 'point') {
drawControl = new OpenLayers.Control.DrawFeature(layer, OpenLayers.Handler.Point);
} else if (message.handlerType == 'line') {
drawControl = new OpenLayers.Control.DrawFeature(layer, OpenLayers.Handler.Path);
} else if (message.handlerType == 'polygon') {
drawControl = new OpenLayers.Control.DrawFeature(layer, OpenLayers.Handler.Polygon);
}
return drawControl;
});
});
© 2015 - 2025 Weber Informatics LLC | Privacy Policy