#5472 closed New feature (fixed)
Implement Individual Map Widgets for Geometry Fields
Reported by: | Paul Smith | Owned by: | Claude Paroz |
---|---|---|---|
Component: | GIS | Version: | dev |
Severity: | Normal | Keywords: | openlayers javascript map maps mapping widget forms |
Cc: | chazen@…, dbsgeo@… | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
The form provided by GeoDjango for geometry fields (django.contrib.gis.forms.fields.GeometryField
) is just a simple text box that accepts textual representations of geometries. The way admin currently generates its map forms is functional, but not really suited for general-purpose use. In particular, the map widget is generated dynamically by GeoModelAdmin.get_map_widget()
. For better API consistency with the rest of Django, there should be reusable map editing widgets.
Because the geographic admin already uses OpenLayers, the default widgets should be written using it. It should be general enough to make supporting alternative geometry frameworks possible, however, OpenLayers support is the priority.
Doing this will hopefully make fixing related tickets, like #9806 and #11002, easier.
Attachments (2)
Change History (26)
comment:1 by , 17 years ago
Keywords: | sprintsept14 added |
---|
comment:2 by , 17 years ago
Owner: | changed from | to
---|
follow-up: 4 comment:3 by , 17 years ago
Status: | new → assigned |
---|---|
Triage Stage: | Unreviewed → Design decision needed |
comment:4 by , 17 years ago
Replying to p:
It seems like these libraries should be treated the same way as Ajax support has been for Django, that is, out-of-band of the framework. It's arguable that for mapping application, a special case could be made in order to get a simple map up quickly with the KML from the models, which both !GMaps and OpenLayers support.
But we want widgets for the admin and databrowse -- how can these be supported without support for any mapping framework built-in? I agree the feature-set should be minimal but still should be present -- users may then customize and/or extend the JavaScript templates at their discretion, and widgets may be created in the admin and databrowse.
We would not be playing to Django's strength's by excluding any sort of mapping framework.
In that case, it seems a template tag may be more appropriate.
I think it will be very difficult to shoehorn all map creation options into a template tag -- it seems more appropriate to have an object with that type of detail instantiated in the views, and passed into the template.
comment:5 by , 16 years ago
OpenLayers support was added as a built in feature of the admin in r7980.
Should this be closed and re-opened as a ticket for discussion how to integration the OL js into the framework outside the admin?
comment:6 by , 15 years ago
I'm working on a project called "OpenWebGIS" (demo:demo) and using OpenLayers to display and manage Features.
There is also a project called "olwidget".
comment:7 by , 15 years ago
Description: | modified (diff) |
---|---|
Keywords: | widget forms added; sprintsept14 removed |
milestone: | → 1.2 |
Summary: | Add OpenLayers support to django.contrib.gis → Implement Individual Map Widgets for Geometry Fields |
Triage Stage: | Design decision needed → Accepted |
Version: | gis → SVN |
comment:8 by , 15 years ago
Description: | modified (diff) |
---|
by , 15 years ago
Attachment: | olwidget_admin.diff added |
---|
Initial patch replacing geodjango admin with olwidget
comment:9 by , 15 years ago
Has patch: | set |
---|---|
Needs tests: | set |
Just added an initial patch which replaces the Geodjango admin implementation with olwidget (from http://github.com/yourcelf/olwidget ), as discussed in this thread: http://groups.google.com/group/geodjango/browse_thread/thread/5cb91dd1a5867c24/62341910f188bae9
Still missing: tests, documentation, examples.
by , 15 years ago
Attachment: | admin_media_img_gis.tar.gz added |
---|
Binary media files for olwidget (they don't show up in svn diff). Place in django/contrib/admin/media/img/
comment:10 by , 15 years ago
Cc: | added |
---|
comment:11 by , 15 years ago
This patch has grown stale, a lot of bugfixing has happened on the github repository for olwidget (http://github.com/yourcelf/olwidget ). I'll make a new patch here soon.
comment:12 by , 15 years ago
Cc: | added |
---|
comment:13 by , 15 years ago
milestone: | 1.2 |
---|
1.2 is feature-frozen, moving this feature request off the milestone.
comment:14 by , 15 years ago
milestone: | → 1.3 |
---|
comment:15 by , 14 years ago
I have a github branch that implements rich map widgets for geometry fields. It's based on the current admin implementation and the admin has been modified to use widgets from django.contrib.gis.forms.
The github branch is here: https://github.com/brutasse/django/compare/5472-map-widgets
There is also a discussion on the geodjango mailing list: http://groups.google.com/group/geodjango/browse_thread/thread/1f318cbd38411488
The implementation is complete, there is some documentation but the wording can probably be improved by a native english speaker.
I'm not sure how to test the widget functionality. Testing the rendering is easy but not very useful since it's mostly javascript code.
comment:17 by , 14 years ago
Severity: | → Normal |
---|---|
Type: | → New feature |
comment:20 by , 12 years ago
Owner: | changed from | to
---|
I'm currently working on this issue based on floppyforms implementation. I will publish a branch as soon as something usable is ready.
comment:21 by , 12 years ago
Branch here: https://github.com/claudep/django/tree/5472
Tests are still missing, and there are still some rough edges, but it's a start.
comment:22 by , 12 years ago
Needs tests: | unset |
---|
I've just rebased the branch and created a pull request:
https://github.com/django/django/pull/944
Now is the time to review it!
comment:23 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:24 by , 12 years ago
I eventually pushed the patch. This week-end sprint might be an opportunity to fix rough edges if needed.
I think a design decision should be made about the inclusion of OpenLayers support, and for that matter Google Maps or Y! Maps support. It seems like these libraries should be treated the same way as Ajax support has been for Django, that is, out-of-band of the framework. It's arguable that for mapping application, a special case could be made in order to get a simple map up quickly with the KML from the models, which both GMaps and OpenLayers support. In that case, it seems a template tag may be more appropriate.