Skip to content

Commit f5c1f04

Browse files
committed
Add new ol-mapserver.js version, update docs with demo links
1 parent d16e238 commit f5c1f04

File tree

5 files changed

+389
-20
lines changed

5 files changed

+389
-20
lines changed

en/cgi/openlayers.txt

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@
88
*****************************************************************************
99

1010
MapServer (since the 6.0 release) provides a simple, built-in method for testing a Mapfile
11-
using OpenLayers. This feature is for testing/development purposes
11+
using OpenLayers. This feature is for testing and development purposes
1212
only, and not for production or deploying full-featured sites. You
13-
can preview, test, and navigate a Mapfile by accessing a special url
13+
can preview, test, and navigate a Mapfile by accessing a special URL
1414
which will return a built-in OpenLayers template.
1515

1616
.. note:: This feature was discussed in
17-
`rfc 63 <https://mapserver.org/development/rfc/ms-rfc-63.html>`_
17+
`RFC 63 <https://mapserver.org/development/rfc/ms-rfc-63.html>`_
1818
and in the ticket https://github.com/MapServer/MapServer/issues/3549
1919

2020
Up to the MapServer 8.4 release the OpenLayers Viewer was based on `OpenLayers 2 <https://openlayers.org/two/>`_.
21-
As of MapServer 8.6 the OpenLayers viewer was updated to work with `OpenLayers 10.4+ <https://openlayers.org/>`_.
21+
As of MapServer 8.6 the OpenLayers viewer was updated to work with `OpenLayers 10.5+ <https://openlayers.org/>`_.
2222
The MapServer CGI Layer, used by the viewer, can be see in
2323
the `OpenLayers examples <https://openlayers.org/en/latest/examples/mapserver-cgi.html>`_.
2424

@@ -30,13 +30,11 @@ Opening the OpenLayers viewer in your browser
3030
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3131

3232
Assuming you are running MapServer on your local machine, and you have
33-
the Itasca demo setup, a basic url would be (split into two lines for
34-
readability)::
33+
the Itasca demo setup, a basic URL would be::
3534

36-
http://localhost/cgi-bin/mapserv?mode=browse&template=openlayers
37-
&layer=lakespy2&layer=dlgstln2&map=/var/www/workshop/itasca.map
35+
http://localhost/cgi-bin/mapserv?mode=browse&template=openlayers&layer=lakespy2&layer=dlgstln2&map=/var/www/workshop/itasca.map
3836

39-
Here is a quick breakdown of that url:
37+
Here is a quick breakdown of that URL:
4038

4139
* Basic Parameters for activating the OpenLayers browser::
4240

@@ -50,14 +48,19 @@ Here is a quick breakdown of that url:
5048
layer=lakespy2
5149
layer=dlgstln2
5250

53-
**That's it!**
51+
When using the ``mode=browser`` MapServer will create an image on the server. By default this will be in the same folder as the Mapfile.
52+
If this MapServer cannot write to this folder you will see an error similar to:
53+
54+
.. code-block:: bash
55+
56+
msSaveImage(): Unable to access file. Failed to create output file (/etc/mapserver/Test174833722471.png).
5457

55-
.. uncomment me when the demo server is up to 6.0
56-
.. If you don't have a live MapServer install to play with, you can also try this out on the demo server::
57-
..
58-
.. https://demo.mapserver.org/cgi-bin/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&BBOX=-180,-90,180,90&SRS=EPSG:4326&WIDTH=953&HEIGHT=480&LAYERS=bluemarble,continents,country_bounds,cities&STYLES=&FORMAT=image/png&TRANSPARENT=true&mode=browse&template=openlayers
59-
..
58+
In this case you will need to set your :ref:`IMAGEPATH <mapfile-web-imagepath>` to a folder MapServer can write to.
6059

60+
**That's it!**
61+
62+
If you don't have a live MapServer install to play with, you can also try the
63+
`MapServer demo <https://demo.mapserver.org/cgi-bin/wms?mode=browse&template=openlayers&layer=continents&layer=country_bounds>`__.
6164

6265
Opening the OpenLayers viewer in the form of a WMS request
6366
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -90,14 +93,17 @@ Here is a quick breakdown of the interesting parts of that URL:
9093
BBOX=429956.19803725,5231780.0814818,444078.32296225,5245902.2064068
9194
SRS=EPSG:26915
9295

93-
#Version and other WMS request params
96+
#Version and other WMS request parameters
9497
SERVICE=WMS
9598
VERSION=1.1.1
9699
REQUEST=GetMap
97100
WIDTH=512
98101
HEIGHT=512
99102
TRANSPARENT=true
100103

104+
If you don't have a live MapServer install to play with, you try the
105+
`MapServer demo <https://demo.mapserver.org/cgi-bin/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&BBOX=-180,-90,180,90&SRS=EPSG:4326&WIDTH=953&HEIGHT=480&LAYERS=bluemarble,continents,country_bounds,cities&STYLES=&FORMAT=application/openlayers&TRANSPARENT=true>`__.
106+
101107
Customizing settings
102108
~~~~~~~~~~~~~~~~~~~~
103109

@@ -113,14 +119,14 @@ These variables can also be set in a Mapfile, for example to point to the full O
113119

114120
.. code-block:: mapfile
115121

116-
CONFIG "MS_OPENLAYERS_CSS_URL" "//cdn.jsdelivr.net/npm/ol@v10.4.0/ol.css"
117-
CONFIG "MS_OPENLAYERS_JS_URL" "//cdn.jsdelivr.net/npm/ol@v10.4.0/dist/ol.js"
122+
CONFIG "MS_OPENLAYERS_CSS_URL" "//cdn.jsdelivr.net/npm/ol@v10.5.0/ol.css"
123+
CONFIG "MS_OPENLAYERS_JS_URL" "//cdn.jsdelivr.net/npm/ol@v10.5.0/dist/ol.js"
118124

119125
Location of the embedded OpenLayers.js file
120126
-------------------------------------------
121127

122-
If you aren't providing your own OpenLayers library through `MS_OPENLAYERS_JS_URL` and
123-
`MS_OPENLAYERS_CSS_URL`, MapServer will point to hardcoded filepaths at `mapserver.org/lib` to find the OpenLayers
128+
If you aren't providing your own OpenLayers library through ``MS_OPENLAYERS_JS_URL`` and
129+
``MS_OPENLAYERS_CSS_URL``, MapServer will point to hard-coded filepaths at `mapserver.org/lib` to find the OpenLayers
124130
library, referred to in `maptemplate.c <https://github.com/MapServer/MapServer/blob/main/src/maptemplate.c#L54>`_.
125131

126132
This version of OpenLayers is a cut-down version that only contains the classes needed for the

0 commit comments

Comments
 (0)