GoogleAdmin: GMaps base layer in Geographic Admin (GeoDjango)

1
2
3
4
5
6
7
8
from django.contrib.gis import admin
from django.contrib.gis.maps.google import GoogleMap

GMAP = GoogleMap(key='abcdefg') # Can also set GOOGLE_MAPS_API_KEY in settings

class GoogleAdmin(admin.OSMGeoAdmin):
    extra_js = [GMAP.api_url + GMAP.key]
    map_template = 'gis/admin/google.html'

More like this

  1. google.html template for GoogleAdmin by jbronn 3 years, 3 months ago
  2. google.js template for GoogleAdmin by jbronn 3 years, 3 months ago
  3. MaxMind(R) GeoIP Lite geolocation models by jbronn 4 years, 6 months ago
  4. MaxMind(R) GeoIP Lite CSV Import by jbronn 4 years, 6 months ago
  5. Admin Save and view next button by ungenio41 1 year, 9 months ago

Comments

marxy (on August 4, 2009):

This works but unfortunately when I save I get a validation error "An error occurred when transforming the geometry to the SRID of the geometry form field".

In my case the Model contains a Point.

Any tips would be appreciated.

#

proppy (on May 27, 2010):

I had the same issue because I was missing PROJ.4 library: http://paste.ubuntu.com/440292/

#

(Forgotten your password?)