Opened 17 years ago

Last modified 11 years ago

#5472 closed

Implement Individual Map Widgets for Geometry Fields — at Version 7

Reported by: Paul Smith Owned by: Paul Smith
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 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, easier.

Change History (7)

comment:1 by Paul Smith, 17 years ago

Keywords: sprintsept14 added

comment:2 by Paul Smith, 17 years ago

Owner: changed from nobody to Paul Smith

comment:3 by Paul Smith, 17 years ago

Status: newassigned
Triage Stage: UnreviewedDesign 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 comment:4 by jbronn, 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 springmeyer, 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 christian@…, 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 jbronn, 15 years ago

Description: modified (diff)
Keywords: widget forms added; sprintsept14 removed
milestone: 1.2
Summary: Add OpenLayers support to django.contrib.gisImplement Individual Map Widgets for Geometry Fields
Triage Stage: Design decision neededAccepted
Version: gisSVN
Note: See TracTickets for help on using tickets.
Back to Top