admin.txt 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. .. _ref-gis-admin:
  2. ======================
  3. GeoDjango's admin site
  4. ======================
  5. .. module:: django.contrib.gis.admin
  6. :synopsis: GeoDjango's extensions to the admin site.
  7. ``GeoModelAdmin``
  8. =================
  9. .. class:: GeoModelAdmin
  10. .. attribute:: default_lon
  11. The default center longitude.
  12. .. attribute:: default_lat
  13. The default center latitude.
  14. .. attribute:: default_zoom
  15. The default zoom level to use. Defaults to 18.
  16. .. attribute:: extra_js
  17. Sequence of URLs to any extra JavaScript to include.
  18. .. attribute:: map_template
  19. Override the template used to generate the JavaScript slippy map.
  20. Default is ``'gis/admin/openlayers.html'``.
  21. .. attribute:: map_width
  22. Width of the map, in pixels. Defaults to 600.
  23. .. attribute:: map_height
  24. Height of the map, in pixels. Defaults to 400.
  25. .. attribute:: openlayers_url
  26. Link to the URL of the OpenLayers JavaScript. Defaults to
  27. ``'http://openlayers.org/api/2.8/OpenLayers.js'``.
  28. .. attribute:: modifiable
  29. Defaults to ``False``. When set to to ``True``, disables editing of
  30. existing geometry fields in the admin.
  31. .. note::
  32. This is different from adding the geometry field to
  33. :attr:`~django.contrib.admin.ModelAdmin.readonly_fields`,
  34. which will only display the WKT of the geometry. Setting
  35. ``modifiable=False``, actually displays the geometry in a map,
  36. but disables the ability to edit its vertices.
  37. ``OSMGeoAdmin``
  38. ===============
  39. .. class:: OSMGeoAdmin
  40. A subclass of :class:`GeoModelAdmin` that uses a spherical mercator projection
  41. with `OpenStreetMap <http://openstreetmap.org/>`_ street data tiles.
  42. See the :ref:`OSMGeoAdmin introduction <osmgeoadmin-intro>`
  43. in the tutorial for a usage example.