/docs/ref/contrib/gis/admin.txt
Plain Text | 72 lines | 43 code | 29 blank | 0 comment | 0 complexity | fcb8087bfcd52051d356529e32a9d7bc MD5 | raw file
Possible License(s): BSD-3-Clause
1.. _ref-gis-admin: 2 3====================== 4GeoDjango's admin site 5====================== 6 7.. module:: django.contrib.gis.admin 8 :synopsis: GeoDjango's extensions to the admin site. 9 10 11``GeoModelAdmin`` 12================= 13 14.. class:: GeoModelAdmin 15 16 .. attribute:: default_lon 17 18 The default center longitude. 19 20 .. attribute:: default_lat 21 22 The default center latitude. 23 24 .. attribute:: default_zoom 25 26 The default zoom level to use. Defaults to 18. 27 28 .. attribute:: extra_js 29 30 Sequence of URLs to any extra JavaScript to include. 31 32 .. attribute:: map_template 33 34 Override the template used to generate the JavaScript slippy map. 35 Default is ``'gis/admin/openlayers.html'``. 36 37 .. attribute:: map_width 38 39 Width of the map, in pixels. Defaults to 600. 40 41 .. attribute:: map_height 42 43 Height of the map, in pixels. Defaults to 400. 44 45 .. attribute:: openlayers_url 46 47 Link to the URL of the OpenLayers JavaScript. Defaults to 48 ``'http://openlayers.org/api/2.8/OpenLayers.js'``. 49 50 51 .. attribute:: modifiable 52 53 Defaults to ``True``. When set to ``False``, disables editing of 54 existing geometry fields in the admin. 55 56 .. note:: 57 58 This is different from adding the geometry field to 59 :attr:`~django.contrib.admin.ModelAdmin.readonly_fields`, 60 which will only display the WKT of the geometry. Setting 61 ``modifiable=False``, actually displays the geometry in a map, 62 but disables the ability to edit its vertices. 63 64``OSMGeoAdmin`` 65=============== 66 67.. class:: OSMGeoAdmin 68 69 A subclass of :class:`GeoModelAdmin` that uses a spherical mercator projection 70 with `OpenStreetMap <http://openstreetmap.org/>`_ street data tiles. 71 See the :ref:`OSMGeoAdmin introduction <osmgeoadmin-intro>` 72 in the tutorial for a usage example.