Google maps subclass of GeoModelAdmin

302 views
Skip to first unread message

Thamsanqa

unread,
Oct 15, 2008, 7:07:07 AM10/15/08
to Django developers
Hi
I see that only open street maps are supported by GeoDjango in
django.contrib.gis.admin through the OSMGeoAdmin class which inherits
from GeoModelAdmin. I have discovered that changing this to use Google
Maps is a matter of modifying the template files in contrib/gis/
templates/gis/admin and then pointing a new class inheriting
GeoModelAdmin to one of them. How can I contribute the modified
templates and subclass to the Django project, that is if there is any
interest in adding this to django ?

Waylan Limberg

unread,
Oct 15, 2008, 9:12:50 AM10/15/08
to django-d...@googlegroups.com
I'm not really sure, nor am I the one to make such a decision, but I
wonder if perhaps something like this hasn't been included because of
issues with Google's licensing. Of course, not everyone is using
GeoDjango in a commercial setting, so your code's still useful.
Perhaps you could post it on djangosnippets.org. However, if I'm wrong
about the licensing issues, a ticket with a patch would be the way to
address inclusion.

--
----
Waylan Limberg
way...@gmail.com

Jacob Kaplan-Moss

unread,
Oct 15, 2008, 9:44:41 AM10/15/08
to django-d...@googlegroups.com
On Wed, Oct 15, 2008 at 8:12 AM, Waylan Limberg <way...@gmail.com> wrote:
> I'm not really sure, nor am I the one to make such a decision, but I
> wonder if perhaps something like this hasn't been included because of
> issues with Google's licensing.

That's exactly why: Google Maps aren't free to use in
non-publicly-accessible areas. Like, say, an admin interface.

Jacob

Benjamin Wohlwend

unread,
Oct 15, 2008, 10:39:22 AM10/15/08
to django-d...@googlegroups.com
Hi,

> That's exactly why: Google Maps aren't free to use in
> non-publicly-accessible areas. Like, say, an admin interface.
>

I'm not sure if this is really the case. The Google Maps API FAQ[1]
says this about the topic:

> As long your site is generally accessible to consumers without
> charge, you may use the Google Maps API. [...] If you charge
> people to place information on your map (e.g. to list their
> homes for sale), but you display this information using the
> Google Maps API on a free part of your site, you'll also meet
> the Google Maps API Terms of Use.

So, as long as the data that is entered with a Google Maps widget in
the admin is available on a public part of the site using the API, the
Google Maps API TOS should be satisfied. There is no sensible way for
GeoDjango to ensure that this limitation is obeyed by the web
developers, though, but I don't see this as a point against including
Google Maps widgets in the admin. Of course, IANAL.

Kind Regards,
Benjamin

[1] http://code.google.com/support/bin/answer.py?answer=55141&topic=10945

Thamsanqa

unread,
Oct 15, 2008, 12:54:37 PM10/15/08
to Django developers
I suppose I can log both a ticket and place it on djangosnippets.org.
Thanks

Justin Bronn

unread,
Oct 15, 2008, 7:27:34 PM10/15/08
to Django developers
> I suppose I can log both a ticket and place it on djangosnippets.org.
> Thanks

This has come up a few times in #geodjango, and I've already written
an example on how to use Google's base layer in the admin. I
distilled it to a few snippets:

http://www.djangosnippets.org/snippets/1144/

It's actually a simple example of how to customize the geographic
admin; I'm not sure about including it SVN.

> > [1]http://code.google.com/support/bin/answer.py?answer=55141&topic=10945

Thanks for finding this informative FAQ entry, I had not seen it
before.

Regards,
-Justin
Reply all
Reply to author
Forward
0 new messages