1. ======================
    
  2. GeoDjango's admin site
    
  3. ======================
    
  4. 
    
  5. .. module:: django.contrib.gis.admin
    
  6.     :synopsis: GeoDjango's extensions to the admin site.
    
  7. 
    
  8. ``GISModelAdmin``
    
  9. =================
    
  10. 
    
  11. .. versionadded:: 4.0
    
  12. 
    
  13. .. class:: GISModelAdmin
    
  14. 
    
  15.     .. attribute:: gis_widget
    
  16. 
    
  17.         The widget class to be used for
    
  18.         :class:`~django.contrib.gis.db.models.GeometryField`. Defaults to
    
  19.         :class:`~django.contrib.gis.forms.widgets.OSMWidget`.
    
  20. 
    
  21.     .. attribute:: gis_widget_kwargs
    
  22. 
    
  23.         The keyword arguments that would be passed to the :attr:`gis_widget`.
    
  24.         Defaults to an empty dictionary.
    
  25. 
    
  26. ``GeoModelAdmin``
    
  27. =================
    
  28. 
    
  29. .. class:: GeoModelAdmin
    
  30. 
    
  31.     .. attribute:: default_lon
    
  32. 
    
  33.     The default center longitude.
    
  34. 
    
  35.     .. attribute:: default_lat
    
  36. 
    
  37.     The default center latitude.
    
  38. 
    
  39.     .. attribute:: default_zoom
    
  40. 
    
  41.     The default zoom level to use.  Defaults to 4.
    
  42. 
    
  43.     .. attribute:: extra_js
    
  44. 
    
  45.     Sequence of URLs to any extra JavaScript to include.
    
  46. 
    
  47.     .. attribute:: map_template
    
  48. 
    
  49.     Override the template used to generate the JavaScript slippy map.
    
  50.     Default is ``'gis/admin/openlayers.html'``.
    
  51. 
    
  52.     .. attribute:: map_width
    
  53. 
    
  54.     Width of the map, in pixels.  Defaults to 600.
    
  55. 
    
  56.     .. attribute:: map_height
    
  57. 
    
  58.     Height of the map, in pixels.  Defaults to 400.
    
  59. 
    
  60.     .. attribute:: openlayers_url
    
  61. 
    
  62.     Link to the URL of the OpenLayers JavaScript.  Defaults to
    
  63.     ``'https://cdnjs.cloudflare.com/ajax/libs/openlayers/2.13.1/OpenLayers.js'``.
    
  64. 
    
  65.     .. attribute:: modifiable
    
  66. 
    
  67.     Defaults to ``True``.  When set to ``False``, disables editing of
    
  68.     existing geometry fields in the admin.
    
  69. 
    
  70.     .. note::
    
  71. 
    
  72.         This is different from adding the geometry field to
    
  73.         :attr:`~django.contrib.admin.ModelAdmin.readonly_fields`,
    
  74.         which will only display the WKT of the geometry. Setting
    
  75.         ``modifiable=False``, actually displays the geometry in a map,
    
  76.         but disables the ability to edit its vertices.
    
  77. 
    
  78.     .. deprecated:: 4.0
    
  79. 
    
  80.         This class is deprecated. Use :class:`~django.contrib.admin.ModelAdmin`
    
  81.         instead.
    
  82. 
    
  83. ``OSMGeoAdmin``
    
  84. ===============
    
  85. 
    
  86. .. class:: OSMGeoAdmin
    
  87. 
    
  88.     A subclass of :class:`GeoModelAdmin` that uses a Spherical Mercator projection
    
  89.     with `OpenStreetMap <https://www.openstreetmap.org/>`_ street data tiles.
    
  90. 
    
  91.     .. deprecated:: 4.0
    
  92. 
    
  93.         This class is deprecated. Use :class:`GISModelAdmin` instead.