admin.txt 1.8 KB

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