88:Contact: pramsey at cleverelephant.ca
99:Author: Jeff McKenna
1010:Contact: jmckenna at gatewaygeomatics.com
11- :Last Updated: 2021-05-17
11+ :Last Updated: 2025-07-25
1212
1313.. contents:: Table of Contents
1414 :depth: 2
@@ -29,31 +29,32 @@ Configuration
2929=============
3030
3131Tile requests are handled by the 'mapserv' CGI program. In order to
32- return tiles in the correct projection, MapServer must be built with the
33- --use-proj option turned on . You can check if your version of 'mapserv' has
32+ return tiles in the correct projection, MapServer must be built against the
33+ `PROJ` library . You can check if your version of 'mapserv' has
3434projection support by running it with the '-v' option and looking
3535for 'SUPPORTS=PROJ'.
3636
3737Example 1. On Unix::
3838
3939 $ ./mapserv -v
40- MapServer version 7.7-dev OUTPUT=PNG OUTPUT=JPEG OUTPUT=KML SUPPORTS=PROJ
41- SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=CAIRO SUPPORTS=SVG_SYMBOLS
42- SUPPORTS=RSVG SUPPORTS=ICONV SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER
43- SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER
44- SUPPORTS=SOS_SERVER SUPPORTS=GEOS SUPPORTS=POINT_Z_M SUPPORTS=PBF INPUT=JPEG
45- INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE
40+ MapServer version 8.5-dev PROJ version 9.6 GDAL version 3.11 OUTPUT=PNG
41+ OUTPUT=JPEG OUTPUT=KML SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE
42+ SUPPORTS=CAIRO SUPPORTS=SVG_SYMBOLS SUPPORTS=RSVG SUPPORTS=ICONV
43+ SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER
44+ SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER
45+ SUPPORTS=OGCAPI_SERVER SUPPORTS=GEOS SUPPORTS=PBF INPUT=JPEG INPUT=POSTGIS
46+ INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE INPUT=FLATGEOBUF
4647
4748Example 2. On Windows::
4849
4950 C:\ms4w> mapserv -v
50- MapServer version 7.7 .0-dev (MS4W 4.0.4) OUTPUT=PNG OUTPUT=JPEG OUTPUT=KML
51- SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=CAIRO SUPPORTS=SVG_SYMBOLS
52- SUPPORTS=SVGCAIRO SUPPORTS=ICONV SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER
53- SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER
54- SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI SUPPORTS=THREADS SUPPORTS=GEOS
55- SUPPORTS=POINT_Z_M SUPPORTS=PBF INPUT=JPEG INPUT=POSTGIS INPUT=OGR
56- INPUT=GDAL INPUT=SHAPEFILE
51+ MapServer version 8.5 .0-dev (MS4W 5.2.0) PROJ version 9.7 GDAL version 3.12
52+ OUTPUT=PNG OUTPUT=JPEG OUTPUT=KML SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE
53+ SUPPORTS=CAIRO SUPPORTS=SVG_SYMBOLS SUPPORTS=SVGCAIRO SUPPORTS=ICONV
54+ SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER
55+ SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=OGCAPI_SERVER
56+ SUPPORTS=FASTCGI SUPPORTS=THREADS SUPPORTS=GEOS SUPPORTS=PBF INPUT=JPEG
57+ INPUT=POSTGIS INPUT=OGR INPUT= GDAL INPUT=SHAPEFILE INPUT=FLATGEOBUF
5758
5859MapServer requires that each LAYER in your .map file (or "mapfile") have a valid PROJECTION
5960block to support reprojection. Because the tile mode uses reprojection,
@@ -185,6 +186,60 @@ contains it, then its address relative to that tile. So the top left tile
185186in the second zoom level is "00" and the bottom right one is "33".
186187See the Bing Maps site for more details: http://msdn.microsoft.com/en-us/library/bb545006.aspx
187188
189+ Mapbox Vector Tile (MVT) output
190+ -------------------------------
191+
192+ .. seealso::
193+ MVT support was added into MapServer through :ref:`RFC #119 <rfc119>`
194+
195+ Since the MapServer 7.2.0 release, MapServer is able to output MVT vector tiles.
196+
197+ **Notes regarding MVT support in MapServer:**
198+
199+ - make sure that your `mapserv -v` command reports `SUPPORTS=PBF` in the response,
200+ which tells you that your MapServer instance supports MVT output
201+
202+ - if your mapserv is missing the support, on Ubuntu you might execute:
203+
204+ ::
205+
206+ sudo apt install protobuf-c-compiler libprotobuf-c-dev
207+
208+ and then compile MapServer with the `-DWITH_PROTOBUFC=ON` switch
209+
210+ - verify that your mapfile has a :ref:`PROJECTION` object defined for
211+ every :ref:`LAYER`
212+
213+ - add an OUTPUTFORMAT block to your mapfile, to leverage GDAL's
214+ `MVT driver <https://gdal.org/en/stable/drivers/vector/mvt.html>`__ :
215+
216+ .. code-block:: mapfile
217+
218+ OUTPUTFORMAT
219+ NAME "mvt"
220+ DRIVER MVT
221+ #FORMATOPTION "EXTENT=512" # default is 4096
222+ FORMATOPTION "EDGE_BUFFER=20"
223+ END
224+
225+ - now test this output by adding the `&map.imagetype=mvt` switch to your earlier
226+ request, and try to load it in your browser, such as:
227+
228+ ::
229+
230+ http://127.0.0.1/cgi-bin/mapserv.exe?
231+ MAP=/ms4w/apps/local-demo/local.map
232+ &MODE=tile
233+ &TILEMODE=gmap
234+ &TILE=0+0+0
235+ &LAYERS=countries
236+ &map.imagetype=mvt
237+
238+ - your browser should download a file, which you can rename to something like
239+ `demo.pbf`, and then execute `ogrinfo <https://gdal.org/en/stable/programs/ogrinfo.html>`__
240+ on the file to examine it
241+
242+ - the ogrinfo response should contain a message such as `using driver `MVT' successful`
188243
189244Using Google Maps
190245-----------------
@@ -328,9 +383,7 @@ as overlays, or as alternate base maps. Here is an example:
328383 <div id="myMap" style="position:relative; width:500px; height:500px;"></div>
329384 </body>
330385 </html>
331-
332-
333-
386+
334387.. RST Link Section
335388
336389.. _`GTileLayerOverlay`: https://developers.google.com/maps/documentation/javascript/tutorial
0 commit comments