admin.txt 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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 4.
  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. ``'https://cdnjs.cloudflare.com/ajax/libs/openlayers/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.