Django

Code

Ticket #5472 (assigned)

Opened 3 years ago

Last modified 5 months ago

Implement Individual Map Widgets for Geometry Fields

Reported by: p Assigned to: p (accepted)
Milestone: 1.3 Component: GIS
Version: SVN Keywords: openlayers javascript map maps mapping widget forms
Cc: chazen@gmail.com, dbsgeo@gmail.com Triage Stage: Accepted
Has patch: 1 Needs documentation: 0
Needs tests: 1 Patch needs improvement: 0

Description (Last modified by jbronn)

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

olwidget_admin.diff (79.3 kB) - added by yourcelf on 09/17/09 08:54:59.
Initial patch replacing geodjango admin with olwidget
admin_media_img_gis.tar.gz (6.2 kB) - added by yourcelf on 09/17/09 09:05:14.
Binary media files for olwidget (they don't show up in svn diff). Place in django/contrib/admin/media/img/

Change History

09/14/07 15:35:36 changed by p

  • keywords changed from openlayers javascript map maps mapping to sprintsept14 openlayers javascript map maps mapping.
  • needs_better_patch changed.
  • needs_tests changed.
  • needs_docs changed.

09/14/07 16:11:45 changed by p

  • owner changed from nobody to p.

(follow-up: ↓ 4 ) 09/17/07 14:37:39 changed by p

  • status changed from new to assigned.
  • stage changed from Unreviewed to Design decision 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.

(in reply to: ↑ 3 ) 09/19/07 06:58:22 changed by jbronn

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.

09/08/08 12:24:37 changed by springmeyer

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?

06/25/09 11:08:08 changed by christian@karrie.info

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".

09/13/09 10:38:30 changed by jbronn

  • description changed.
  • summary changed from Add OpenLayers support to django.contrib.gis to Implement Individual Map Widgets for Geometry Fields.
  • version changed from gis to SVN.
  • milestone set to 1.2.
  • keywords changed from sprintsept14 openlayers javascript map maps mapping to openlayers javascript map maps mapping widget forms.
  • stage changed from Design decision needed to Accepted.

09/13/09 11:31:51 changed by jbronn

  • description changed.

09/17/09 08:54:59 changed by yourcelf

  • attachment olwidget_admin.diff added.

Initial patch replacing geodjango admin with olwidget

09/17/09 08:59:33 changed by yourcelf

  • has_patch set to 1.
  • needs_tests set to 1.

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.

09/17/09 09:05:14 changed by yourcelf

  • 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/

09/18/09 08:56:01 changed by yourcelf

  • cc set to chazen@gmail.com.

11/23/09 13:35:05 changed by yourcelf

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.

02/15/10 21:17:51 changed by springmeyer

  • cc changed from chazen@gmail.com to chazen@gmail.com, dbsgeo@gmail.com.

02/23/10 18:02:02 changed by ubernostrum

  • milestone deleted.

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

02/24/10 16:15:38 changed by jbronn

  • milestone set to 1.3.

Add/Change #5472 (Implement Individual Map Widgets for Geometry Fields)




Change Properties
Action