[Django] #21606: OSMWidget overrides map position passed to widget constructor

49 views
Skip to first unread message

Django

unread,
Dec 13, 2013, 8:47:07 AM12/13/13
to django-...@googlegroups.com
#21606: OSMWidget overrides map position passed to widget constructor
----------------------------+----------------------------
Reporter: jgoclawski | Owner: nobody
Type: Bug | Status: new
Component: GIS | Version: 1.6
Severity: Normal | Keywords: gis, osmwidget
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
----------------------------+----------------------------
When you pass `default_lon` or `default_lat` in `attrs` dictionary to
`OSMWidget` constructor, it doesn't work as expected. Passed values are
overriden by those fixed in the `OSMWidget` class.

The defaults are: `default_lon = 5`, `default_lat = 47` and you cannot
change them, unless you create a a new widget class derived from
`OSMWidget`.

Example:

If you want to set e.g. `map_width`, you can do this with the
`BaseGeometryWidget`:


{{{
coordinates = forms.PointField(widget=widgets.BaseGeometryWidget(
attrs={'map_width': 100}
))
}}}

and it is used instead of default '''600''' value declared in
`BaseGeometryWidget`.

But if you wanted to set `OSMWidget`'s default_lon or default_lat, you
would expect this should work:


{{{
coordinates = forms.PointField(widget=widgets.OSMWidget(
attrs={'default_lon': 11,
'default_lat': 12}
))
}}}

Well... it doesn't work. You will get a map rendered with `default_lon =
5`, `default_lat = 47`.


I'm preparing a GitHub pull request solving this issue.

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

Django

unread,
Dec 13, 2013, 8:51:23 AM12/13/13
to django-...@googlegroups.com
#21606: OSMWidget overrides map position passed to widget constructor
--------------------------------+--------------------------------------
Reporter: jgoclawski | Owner: jgoclawski
Type: Bug | Status: assigned
Component: GIS | Version: 1.6
Severity: Normal | Resolution:

Keywords: gis, osmwidget | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

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

* owner: nobody => jgoclawski
* needs_docs: => 0
* status: new => assigned
* needs_tests: => 0
* needs_better_patch: => 0


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

Django

unread,
Dec 13, 2013, 9:45:22 AM12/13/13
to django-...@googlegroups.com
#21606: OSMWidget overrides map position passed to widget constructor
--------------------------------+--------------------------------------
Reporter: jgoclawski | Owner: jgoclawski
Type: Bug | Status: assigned
Component: GIS | Version: 1.6
Severity: Normal | Resolution:

Keywords: gis, osmwidget | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

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

* has_patch: 0 => 1


Comment:

Link to the Github branch with a fix for this issue:
https://github.com/jgoclawski/django/commits/ticket_21606

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

Django

unread,
Dec 13, 2013, 9:54:28 AM12/13/13
to django-...@googlegroups.com
#21606: OSMWidget overrides map position passed to widget constructor
--------------------------------+--------------------------------------
Reporter: jgoclawski | Owner: jgoclawski
Type: Bug | Status: assigned
Component: GIS | Version: 1.6
Severity: Normal | Resolution:

Keywords: gis, osmwidget | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

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

Comment (by jgoclawski):

GitHub pull request: https://github.com/django/django/pull/2072

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

Django

unread,
Dec 13, 2013, 11:25:17 AM12/13/13
to django-...@googlegroups.com
#21606: OSMWidget overrides map position passed to widget constructor
--------------------------------+--------------------------------------
Reporter: jgoclawski | Owner: jgoclawski
Type: Bug | Status: assigned
Component: GIS | Version: 1.6
Severity: Normal | Resolution:
Keywords: gis, osmwidget | Triage Stage: Accepted

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

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

* stage: Unreviewed => Accepted


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

Django

unread,
Dec 14, 2013, 8:06:45 AM12/14/13
to django-...@googlegroups.com
#21606: OSMWidget overrides map position passed to widget constructor
-------------------------------------+-------------------------------------
Reporter: jgoclawski | Owner:
Type: Bug | jgoclawski
Component: GIS | Status: assigned
Severity: Normal | Version: 1.6
Keywords: gis, osmwidget | Resolution:
Has patch: 1 | Triage Stage: Ready for
Needs tests: 0 | checkin
Easy pickings: 0 | Needs documentation: 0
| Patch needs improvement: 0
| UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by claudep):

* stage: Accepted => Ready for checkin


Comment:

Just waiting an answer about the commit
https://github.com/jgoclawski/django/commit/cc3ddbf9718d

--
Ticket URL: <https://code.djangoproject.com/ticket/21606#comment:5>

Django

unread,
Dec 14, 2013, 9:43:53 AM12/14/13
to django-...@googlegroups.com
#21606: OSMWidget overrides map position passed to widget constructor
-------------------------------------+-------------------------------------
Reporter: jgoclawski | Owner:
Type: Bug | jgoclawski
Component: GIS | Status: closed
Severity: Normal | Version: 1.6
Keywords: gis, osmwidget | Resolution: fixed

Has patch: 1 | Triage Stage: Ready for
Needs tests: 0 | checkin
Easy pickings: 0 | Needs documentation: 0
| Patch needs improvement: 0
| UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Claude Paroz <claude@…>):

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


Comment:

In [changeset:"2ddf1fc50f8fbb26ce5c6b9115111564bf21248c"]:
{{{
#!CommitTicketReference repository=""
revision="2ddf1fc50f8fbb26ce5c6b9115111564bf21248c"
Fixed #21606 -- Fixed default_lat and default_lon override in OSMWidget
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/21606#comment:6>

Reply all
Reply to author
Forward
0 new messages