Opened 14 years ago
Closed 3 years ago
#13926 closed Bug (needsinfo)
GeometryCollections are not visible in OSMGeoAdmin
Reported by: | anonymous | Owned by: | nobody |
---|---|---|---|
Component: | GIS | Version: | 1.7 |
Severity: | Normal | Keywords: | |
Cc: | apasotti@… | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | yes |
Easy pickings: | no | UI/UX: | no |
Description
Geometry collections fail to display in OSMGeoAdmin.
The bug appears in the geodjango_geom.write_wkt function:
geodjango_geom.write_wkt = function(feat){ if (geodjango_geom.is_collection){ geodjango_geom.num_geom = feat.geometry.components.length;} else { geodjango_geom.num_geom = 1;} document.getElementById('id_geom').value = geodjango_geom.get_ewkt(feat); }
If 'feat' is a geometry collection, it does not have a geometry property, but it is an array of type OpenLayers.Feature.Vector.
Attachments (4)
Change History (14)
comment:1 by , 14 years ago
comment:2 by , 14 years ago
The above patch is for django/contrib/gis/templates/gis/admin/openlayers.js
comment:3 by , 14 years ago
Has patch: | set |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:4 by , 14 years ago
Severity: | → Normal |
---|---|
Type: | → Bug |
comment:5 by , 14 years ago
Easy pickings: | unset |
---|---|
Patch needs improvement: | set |
openlayers.patch fails to apply cleanly on to trunk
by , 13 years ago
Attachment: | osm_ol_admin.diff added |
---|
New patch for django/contrib/gis/templates/gis/admin/openlayers.js, should apply on trunk.
comment:6 by , 13 years ago
Cc: | added |
---|---|
UI/UX: | unset |
by , 11 years ago
Attachment: | osm_ol_admin.django-1.5.1.diff added |
---|
Patch updated for the Django 1.5.1 release
by , 11 years ago
Attachment: | osm_ol_admin.django-20130706.diff added |
---|
Patch updated for current Django trunk
comment:7 by , 11 years ago
Thanks for maintaining the patch up-to-date.
With the recent addition (Django 1.6) of GIS-specialized form fields and widgets (#5472), GeoModelAdmin
/OSMGeoAdmin
will become mostly obsolete, and the geometry collections issue should be solved.
I would be interested by any experience on using the new fields/widgets with any GIS project using Django 1.6 and normal ModelAdmin
objects.
comment:8 by , 10 years ago
Version: | 1.2 → 1.7 |
---|
The patch does not appear to be applied in Django 1.7 and geometry collections are not rendered in geomodeladmin
comment:9 by , 10 years ago
GregUK, what about using a normal ModelAdmin
(in lieu of a GeoModelAdmin
)?
comment:10 by , 3 years ago
Resolution: | → needsinfo |
---|---|
Status: | new → closed |
GeoModelAdmin
and OSMGeoAdmin
are deprecated (see 4555aa0a489cb9dcf764edf12339097cdfa5ff84). Please reopen the ticket if you can confirm your issue with admin.ModelAdmin
.
Attempted attaching a patch, but it didn't happen. Here it is:
* openlayers-dist.js 2010-07-12 12:19:47.126525645 -0400
--- openlayers.js 2010-07-12 12:22:44.874936920 -0400
*
* 17,23
! if ({{ module }}.is_collection){ {{ module }}.num_geom = feat.geometry.components.length;}
--- 17,23 ----
! if ({{ module }}.is_collection){ {{ module }}.num_geom = feat.length;}