Comment (by timgraham):
Claude, could you confirm there is value in keeping this ticket open given
it hasn't seen activity in 6 years?
--
Ticket URL: <https://code.djangoproject.com/ticket/11634#comment:6>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by claudep):
The reporter was right and the issue might still be accurate (we have some
similar center conversion code in OLMapWidget.js).
However, I'm not so much interested in fixing this, as I'd like to see
openlayer.js disappear. But that would mean deprecating `GeoModelAdmin` as
a whole and I'm not sure we can do this now without loosing some
functionalities.
--
Ticket URL: <https://code.djangoproject.com/ticket/11634#comment:7>
Comment (by rlaager):
Since I marked #11094 as a duplicate of this one, I wanted to copy over
this work-around that might be useful to people (as it was for me):
[https://code.djangoproject.com/ticket/11094?replyto=4#comment:4 jbronn
wrote in #11094 comment 4]:
> The `default_lon` and `default_lat` are not working for you because
`OSMGeoAdmin` uses a different projection system than `GeoModelAdmin`.
Specifically, `OSMGeoAdmin` uses the so-called "Google" projection
(SRID=900913) and `GeoModelAdmin` uses WGS84 (SRID=4326). As such, just
transform your `default_lon` and `default_lat` values to 900913:
> {{{
> >>> from django.contrib.gis.geos import Point
> >>> pnt = Point(lon, lat, srid=4326)
> >>> pnt.transform(900913)
> >>> default_lon, default_lat = pnt.coords
> }}}
These days, I would use 3857 instead of 900913 in the .transform().
--
Ticket URL: <https://code.djangoproject.com/ticket/11634#comment:8>
* status: new => closed
* resolution: => invalid
Comment:
`GeoModelAdmin` and `OSMGeoAdmin` are deprecated (see
4555aa0a489cb9dcf764edf12339097cdfa5ff84).
--
Ticket URL: <https://code.djangoproject.com/ticket/11634#comment:9>