Opened 6 years ago

Last modified 3 years ago

#8972 assigned New feature

Add ability to delete selected vector features within the Geodjango/OpenLayers Admin map interface

Reported by: springmeyer Owned by: jbronn
Component: GIS Version: 1.0
Severity: Normal Keywords: OpenLayers, admin, vector editing
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: no
Easy pickings: no UI/UX: no


This feature has been needed for some time, and was recently requested. See:

I've started a basic patch that adds a javascript function to allow multiple features to be selected in the map interface, deleted from view, and removed from the save method.

I've tested this so far when editing multipolygon data in the admin.

A known issue I'm hoping others may have a solution to:

Currently, an OL javascript error occurs on line 948 of OpenLayer.js after successfully deleting a feature. This do not seem to cause any problems in saving the correct geometry or in continuing to use the select control. This is the firebug output:

object is undefined
selectFeature()(undefined)OpenLayers.js (line 948)
clearSelectedFeatures()()277 (line 327)
javascript:geodjango_geometry.clearSelectedFeatures()()()javascri...eatures() (line 1)
[Break on this error] this.feature=null;this.dragControl.deact...ply(this.selectControl,[this.feature]);}

Attachments (2)

ol_admin_delete_selected.diff (2.2 KB) - added by springmeyer 6 years ago.
Patch against SVN HEAD to allow the deletion of multiple features within the geodjango enabled admin interface
ol_admin_delete_selected.2.diff (2.1 KB) - added by springmeyer 6 years ago.

Download all attachments as: .zip

Change History (11)

Changed 6 years ago by springmeyer

Patch against SVN HEAD to allow the deletion of multiple features within the geodjango enabled admin interface

Changed 6 years ago by springmeyer

comment:1 Changed 6 years ago by jbronn

  • Needs documentation unset
  • Needs tests unset
  • Owner changed from springmeyer to jbronn
  • Patch needs improvement unset

comment:2 Changed 6 years ago by springmeyer

I've tested this patch more and put a bit more thought into this. I think that because the patch is not yet ready for two main reasons:

1) Multiple selection of features is desirable but tricky from a UI perspective and needs careful implementation so that the SelectFeature control and the ModifyFeature controls don't conflict. Current this patch only allows multi-select when the pan/hand tool is used and not the editing/modify tool.

2) This patch also needs more testing to ensure that the correct features are deleted from the selectedFeatures array and written into the id_geometry textarea to allow editing and drawing to continue without null value error in the main OL library.

So, I'll post another once I've had a chance to look into these issues in more detail.

comment:3 Changed 5 years ago by anonymous

  • milestone post-1.0 deleted

Milestone post-1.0 deleted

comment:4 Changed 5 years ago by Alex

  • Triage Stage changed from Unreviewed to Accepted

comment:5 Changed 5 years ago by jbronn

  • milestone set to 1.1
  • Status changed from new to assigned

comment:6 Changed 5 years ago by jbronn

  • milestone changed from 1.1 to 1.2

comment:7 Changed 4 years ago by ubernostrum

  • milestone 1.2 deleted

1.2 is feature-frozen, moving this feature request off the milestone.

comment:8 Changed 3 years ago by julien

  • Easy pickings unset
  • Needs tests set
  • Severity set to Normal
  • Type set to New feature

comment:9 Changed 2 years ago by aaugustin

  • UI/UX unset

Change UI/UX from NULL to False.

Add Comment

Modify Ticket

Change Properties
<Author field>
as assigned
The owner will be changed from jbronn to anonymous. Next status will be 'assigned'
The ticket will be disowned. Next status will be 'new'
as The resolution will be set. Next status will be 'closed'

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.