[Django] #23137: Error when use OSMapWidget.js

16 views
Skip to first unread message

Django

unread,
Jul 31, 2014, 6:02:14 AM7/31/14
to django-...@googlegroups.com
#23137: Error when use OSMapWidget.js
----------------------------+--------------------
Reporter: koyoyo | Owner: nobody
Type: Bug | Status: new
Component: GIS | Version: 1.6
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
----------------------------+--------------------
I try to create my form with GeoDjango and I didn't found an good example
in document.

So, I use django/contrib/gis/static/gis/js/OSMapWidget.js and found that
have some of bugs.

First, in line 173 (miss .) eg. if geom_name = 'MultiPoint', then
options['geom_type'] will be '''OpenLayers.GeometryMultiPoint'''

{{{
else options['geom_type'] = eval('OpenLayers.Geometry' +
options['geom_name']);
}}}

changed to

{{{
else options['geom_type'] = eval('OpenLayers.Geometry.' +
options['geom_name']);
}}}

Second, line 181 (check is_collection) It is wrong use of function
"isinstanceof". It cannot check constructor isinstanceof constructor.

{{{
is_collection: options['geom_name'] instanceof
OpenLayers.Geometry.Collection,
}}}

changed to

{{{
is_collection: (options['geom_name'].substr(0, 5) == 'Multi' || options[
'geom_type' ] == 'GeometryCollection'),
}}}

Third, in function getControls (line 366, 369, 372) These are not check
for Collection.

{{{
if (this.options.geom_name == 'LineString'' || this.options.geom_name ==
'Unknown') {
if (this.options.geom_name == 'Polygon' || this.options.geom_name ==
'Unknown') {
if (this.options.geom_name == 'Point' || this.options.geom_name ==
'Unknown') {
}}}

changed to

{{{
if (this.options.geom_name == 'LineString' || this.options.geom_name ==
'MultiLineString' || this.options.geom_name == 'Unknown') {
if (this.options.geom_name == 'Polygon' || this.options.geom_name ==
'MultiPolygon' || this.options.geom_name == 'Unknown') {
if (this.options.geom_name == 'Point' || this.options.geom_name ==
'MultiPoint' || this.options.geom_name == 'Unknown') {
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/23137>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Aug 5, 2014, 10:52:36 AM8/5/14
to django-...@googlegroups.com
#23137: Error when use OSMapWidget.js
------------------------+--------------------------------------

Reporter: koyoyo | Owner: nobody
Type: Bug | Status: new
Component: GIS | Version: 1.6
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
------------------------+--------------------------------------
Changes (by timo):

* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0


Old description:

New description:

changed to

changed to

changed to

--

--
Ticket URL: <https://code.djangoproject.com/ticket/23137#comment:1>

Django

unread,
Aug 8, 2014, 10:39:58 AM8/8/14
to django-...@googlegroups.com
#23137: Error when use OSMapWidget.js
------------------------+------------------------------------

Reporter: koyoyo | Owner: nobody
Type: Bug | Status: new
Component: GIS | Version: 1.6
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
------------------------+------------------------------------
Changes (by claudep):

* stage: Unreviewed => Accepted


Comment:

These issues should have been fixed in commit [457c16d0d607]. Could you
please check that they are solving your issues? In that case, we might
consider backporting the patch to 1.6.

--
Ticket URL: <https://code.djangoproject.com/ticket/23137#comment:2>

Django

unread,
Aug 14, 2014, 11:20:13 PM8/14/14
to django-...@googlegroups.com
#23137: Error when use OSMapWidget.js
------------------------+------------------------------------

Reporter: koyoyo | Owner: nobody
Type: Bug | Status: new
Component: GIS | Version: 1.6
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
------------------------+------------------------------------

Comment (by koyoyo):

Sorry for my late, It works. Thanks.

--
Ticket URL: <https://code.djangoproject.com/ticket/23137#comment:3>

Django

unread,
Aug 15, 2014, 4:17:18 AM8/15/14
to django-...@googlegroups.com
#23137: Error when use OSMapWidget.js
------------------------+------------------------------------
Reporter: koyoyo | Owner: nobody
Type: Bug | Status: closed
Component: GIS | Version: 1.6
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
------------------------+------------------------------------
Changes (by claudep):

* status: new => closed
* resolution: => fixed


Comment:

OK, thanks for the feedback. Backported in 1.6 in
[f5e8376288783554e4da39].

--
Ticket URL: <https://code.djangoproject.com/ticket/23137#comment:4>

Reply all
Reply to author
Forward
0 new messages