admin.txt 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. .. versionchanged:: 1.11
  28. Older versions default to
  29. ``'http://openlayers.org/api/2.13.1/OpenLayers.js'``.
  30. .. attribute:: modifiable
  31. Defaults to ``True``. When set to ``False``, disables editing of
  32. existing geometry fields in the admin.
  33. .. note::
  34. This is different from adding the geometry field to
  35. :attr:`~django.contrib.admin.ModelAdmin.readonly_fields`,
  36. which will only display the WKT of the geometry. Setting
  37. ``modifiable=False``, actually displays the geometry in a map,
  38. but disables the ability to edit its vertices.
  39. ``OSMGeoAdmin``
  40. ===============
  41. .. class:: OSMGeoAdmin
  42. A subclass of :class:`GeoModelAdmin` that uses a spherical mercator projection
  43. with `OpenStreetMap <https://www.openstreetmap.org/>`_ street data tiles.
  44. See the :ref:`OSMGeoAdmin introduction <osmgeoadmin-intro>`
  45. in the tutorial for a usage example.