Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

[1.6.x] Fixed #21618 -- Added hints about openlayers.js hosting

Thanks kz26 for the report and Tim Graham for the excellent
Backport of b7a7baa from master.
  • Loading branch information...
1 parent 3b79fba commit 2d08390d70007236e083183d78a4435d249c5aa8 @claudep claudep committed
Showing with 20 additions and 0 deletions.
  1. +20 −0 docs/ref/contrib/gis/forms-api.txt
20 docs/ref/contrib/gis/forms-api.txt
@@ -156,6 +156,20 @@ Widget classes
This is the default widget used by all GeoDjango form fields.
``template_name`` is ``gis/openlayers.html``.
+ ``OpenLayersWidget`` and :class:`OSMWidget` use the ``openlayers.js`` file
+ hosted on the ```` Web site. This works for basic usage
+ during development, but isn't appropropriate for a production deployment as
+ ```` has no guaranteed uptime and runs on a slow server.
+ You are therefore advised to subclass these widgets in order to specify
+ your own version of the ``openlayers.js`` file in the ``js`` property of
+ the inner ``Media`` class (see :ref:`assets-as-a-static-definition`). You
+ can host a copy of ``openlayers.js``
+ `tailored to your needs`_ on your own server or refer to a copy from a
+ content-delivery network like This will also allow
+ you to serve the JavaScript file(s) using the ``https`` protocol if needed.
+ .. _tailored to your needs:
.. class:: OSMWidget
@@ -163,3 +177,9 @@ Widget classes
This widget uses an OpenStreetMap base layer (Mapnik) to display geographic
objects on.
``template_name`` is ``gis/openlayers-osm.html``.
+ The :class:`OpenLayersWidget` note about JavaScript file hosting above also
+ applies here. See also this `FAQ answer`_ about ``https`` access to map
+ tiles.
+ .. _FAQ answer:

0 comments on commit 2d08390

Please sign in to comment.
Something went wrong with that request. Please try again.