2010-03-27 04:14:53 +08:00
|
|
|
======================
|
|
|
|
GeoDjango's admin site
|
|
|
|
======================
|
|
|
|
|
|
|
|
.. module:: django.contrib.gis.admin
|
2016-02-19 15:31:25 +08:00
|
|
|
:synopsis: GeoDjango's extensions to the admin site.
|
2010-03-27 04:14:53 +08:00
|
|
|
|
2020-12-10 01:12:56 +08:00
|
|
|
``GISModelAdmin``
|
|
|
|
=================
|
|
|
|
|
|
|
|
.. versionadded:: 4.0
|
|
|
|
|
|
|
|
.. class:: GISModelAdmin
|
|
|
|
|
|
|
|
.. attribute:: gis_widget
|
|
|
|
|
|
|
|
The widget class to be used for
|
|
|
|
:class:`~django.contrib.gis.db.models.GeometryField`. Defaults to
|
|
|
|
:class:`~django.contrib.gis.forms.widgets.OSMWidget`.
|
|
|
|
|
|
|
|
.. attribute:: gis_widget_kwargs
|
|
|
|
|
|
|
|
The keyword arguments that would be passed to the :attr:`gis_widget`.
|
|
|
|
Defaults to an empty dictionary.
|
|
|
|
|
2010-03-27 04:14:53 +08:00
|
|
|
``GeoModelAdmin``
|
|
|
|
=================
|
|
|
|
|
|
|
|
.. class:: GeoModelAdmin
|
|
|
|
|
2016-02-19 15:31:25 +08:00
|
|
|
.. attribute:: default_lon
|
2010-03-27 04:14:53 +08:00
|
|
|
|
2016-02-19 15:31:25 +08:00
|
|
|
The default center longitude.
|
2010-03-27 04:14:53 +08:00
|
|
|
|
2016-02-19 15:31:25 +08:00
|
|
|
.. attribute:: default_lat
|
2010-03-27 04:14:53 +08:00
|
|
|
|
2016-02-19 15:31:25 +08:00
|
|
|
The default center latitude.
|
2010-03-27 04:14:53 +08:00
|
|
|
|
2016-02-19 15:31:25 +08:00
|
|
|
.. attribute:: default_zoom
|
2010-03-27 04:14:53 +08:00
|
|
|
|
2016-06-17 20:01:13 +08:00
|
|
|
The default zoom level to use. Defaults to 4.
|
2010-03-27 04:14:53 +08:00
|
|
|
|
2016-02-19 15:31:25 +08:00
|
|
|
.. attribute:: extra_js
|
2010-03-27 04:14:53 +08:00
|
|
|
|
2016-02-19 15:31:25 +08:00
|
|
|
Sequence of URLs to any extra JavaScript to include.
|
2010-03-27 04:14:53 +08:00
|
|
|
|
2016-02-19 15:31:25 +08:00
|
|
|
.. attribute:: map_template
|
2010-03-27 04:14:53 +08:00
|
|
|
|
2016-02-19 15:31:25 +08:00
|
|
|
Override the template used to generate the JavaScript slippy map.
|
|
|
|
Default is ``'gis/admin/openlayers.html'``.
|
2010-03-27 04:14:53 +08:00
|
|
|
|
2016-02-19 15:31:25 +08:00
|
|
|
.. attribute:: map_width
|
2010-03-27 04:14:53 +08:00
|
|
|
|
2016-02-19 15:31:25 +08:00
|
|
|
Width of the map, in pixels. Defaults to 600.
|
2010-03-27 04:14:53 +08:00
|
|
|
|
2016-02-19 15:31:25 +08:00
|
|
|
.. attribute:: map_height
|
2010-03-27 04:14:53 +08:00
|
|
|
|
2016-02-19 15:31:25 +08:00
|
|
|
Height of the map, in pixels. Defaults to 400.
|
2010-03-27 04:14:53 +08:00
|
|
|
|
2016-02-19 15:31:25 +08:00
|
|
|
.. attribute:: openlayers_url
|
2010-03-27 04:14:53 +08:00
|
|
|
|
2016-02-19 15:31:25 +08:00
|
|
|
Link to the URL of the OpenLayers JavaScript. Defaults to
|
2016-08-10 23:13:08 +08:00
|
|
|
``'https://cdnjs.cloudflare.com/ajax/libs/openlayers/2.13.1/OpenLayers.js'``.
|
2010-03-27 04:14:53 +08:00
|
|
|
|
2016-02-19 15:31:25 +08:00
|
|
|
.. attribute:: modifiable
|
2010-04-17 00:34:42 +08:00
|
|
|
|
2016-02-19 15:31:25 +08:00
|
|
|
Defaults to ``True``. When set to ``False``, disables editing of
|
|
|
|
existing geometry fields in the admin.
|
2010-04-17 00:34:42 +08:00
|
|
|
|
2016-02-19 15:31:25 +08:00
|
|
|
.. note::
|
2010-08-20 03:27:44 +08:00
|
|
|
|
2016-02-19 15:31:25 +08:00
|
|
|
This is different from adding the geometry field to
|
|
|
|
:attr:`~django.contrib.admin.ModelAdmin.readonly_fields`,
|
|
|
|
which will only display the WKT of the geometry. Setting
|
|
|
|
``modifiable=False``, actually displays the geometry in a map,
|
|
|
|
but disables the ability to edit its vertices.
|
2010-04-17 00:34:42 +08:00
|
|
|
|
2020-12-10 01:12:56 +08:00
|
|
|
.. deprecated:: 4.0
|
|
|
|
|
|
|
|
This class is deprecated. Use :class:`~django.contrib.admin.ModelAdmin`
|
|
|
|
instead.
|
|
|
|
|
2010-03-27 04:14:53 +08:00
|
|
|
``OSMGeoAdmin``
|
|
|
|
===============
|
|
|
|
|
|
|
|
.. class:: OSMGeoAdmin
|
|
|
|
|
2017-09-09 19:21:24 +08:00
|
|
|
A subclass of :class:`GeoModelAdmin` that uses a Spherical Mercator projection
|
2016-02-19 15:31:25 +08:00
|
|
|
with `OpenStreetMap <https://www.openstreetmap.org/>`_ street data tiles.
|
2020-12-10 01:12:56 +08:00
|
|
|
|
|
|
|
.. deprecated:: 4.0
|
|
|
|
|
|
|
|
This class is deprecated. Use :class:`GISModelAdmin` instead.
|