// Trigger a drag feature
DragFeatureInteraction.prototype.handleDownEvent = function(event) {
var map = event.map;
var feature = map.forEachFeatureAtPixel(event.pixel,
function(feature, layer) {
return feature;
});
if (feature) {
this.coordinate_ = event.coordinate;
this.feature_ = feature;
}
return !!feature;
};
// Handle drag feature
DragFeatureInteraction.prototype.handleDragEvent = function(event) {
var map = event.map;
var feature = map.forEachFeatureAtPixel(event.pixel, function(feature, layer) {
return feature;
});
var deltaX = event.coordinate[0] - this.coordinate_[0];
var deltaY = event.coordinate[1] - this.coordinate_[1];
var geometry = /** @type {ol.geom.SimpleGeometry} */
(this.feature_.getGeometry());
geometry.translate(deltaX, deltaY);
this.coordinate_[0] = event.coordinate[0];
this.coordinate_[1] = event.coordinate[1];
};
// Handle map movement
DragFeatureInteraction.prototype.handleMoveEvent = function(event) {
if (this.cursor_) {
var map = event.map;
var feature = map.forEachFeatureAtPixel(event.pixel,
function(feature, layer) {
return feature;
});
var element = event.map.getTargetElement();
if (feature) {
if (element.style.cursor != this.cursor_) {
this.previousCursor_ = element.style.cursor;
element.style.cursor = this.cursor_;
}
} else if (this.previousCursor_ !== undefined) {
element.style.cursor = this.previousCursor_;
this.previousCursor_ = undefined;
}
}
};
// Un-trigger drag feature
DragFeatureInteraction.prototype.handleUpEvent = function(event) {
this.coordinate_ = null;
this.feature_ = null;
return false;
};
This means that there is no current attribute I can give my features that will make them unselectable. Is there a nice way that we could add this to the platform? If not, I still would like a way to restrict the user from editing a layer