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
|
|
|
|
|
|
|
``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-02-19 15:31:25 +08:00
|
|
|
The default zoom level to use. Defaults to 18.
|
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
|
|
|
|
``'http://openlayers.org/api/2.13.1/OpenLayers.js'``.
|
2010-03-27 04:14:53 +08:00
|
|
|
|
2010-04-17 00:34:42 +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
|
|
|
|
2010-03-27 04:14:53 +08:00
|
|
|
``OSMGeoAdmin``
|
|
|
|
===============
|
|
|
|
|
|
|
|
.. class:: OSMGeoAdmin
|
|
|
|
|
2016-02-19 15:31:25 +08:00
|
|
|
A subclass of :class:`GeoModelAdmin` that uses a spherical mercator projection
|
|
|
|
with `OpenStreetMap <https://www.openstreetmap.org/>`_ street data tiles.
|
|
|
|
See the :ref:`OSMGeoAdmin introduction <osmgeoadmin-intro>`
|
|
|
|
in the tutorial for a usage example.
|