[mapserver-commits] [MapServer/MapServer] df1418: MS RFC 141: Add MS_ONLINERESOURCE to CONFIG file (...

Seth G noreply at github.com
Mon Feb 23 07:03:44 PST 2026


  Branch: refs/heads/main
  Home:   https://github.com/MapServer/MapServer
  Commit: df1418d6cbcf03b1889e015ec2c17fa31f0a5291
      https://github.com/MapServer/MapServer/commit/df1418d6cbcf03b1889e015ec2c17fa31f0a5291
  Author: Seth G <sethg at geographika.co.uk>
  Date:   2026-02-23 (Mon, 23 Feb 2026)

  Changed paths:
    A msautotest/config/expected/index_wms_onlineresource2.json
    A msautotest/config/expected/onlineresource_index.json
    A msautotest/config/expected/onlineresource_index_empty.json
    A msautotest/config/expected/onlineresource_ogcapi.json
    A msautotest/config/expected/onlineresource_ogcapi_collections.json
    A msautotest/config/expected/onlineresource_wfs_getcapabiltities.xml
    A msautotest/config/expected/onlineresource_wms_getcapabiltities.xml
    A msautotest/config/expected/onlineresource_wms_getcapabiltities_mapfile.xml
    M msautotest/config/index_wms_onlineresource.map
    A msautotest/config/onlineresource.conf
    A msautotest/config/onlineresource.map
    A msautotest/config/onlineresource_empty.conf
    M src/maputil.c

  Log Message:
  -----------
  MS RFC 141: Add MS_ONLINERESOURCE to CONFIG file (#7434)

Implementation of [RFC 141](https://mapserver.org/development/rfc/ms-rfc-141.html).

Adds a new `MS_ONLINERESOURCE ` to the MapServer [CONFIG](https://mapserver.org/mapfile/config.html) file.

```
  CONFIG
    ENV
      MS_ONLINERESOURCE "https://maps.example.com/"
    END
    MAPS
      EXAMPLE "/data/mapfiles/example.map"
    END
  END
```

When accessing the Mapfile using its key (`EXAMPLE` in the above example), a request such as https://maps.example.com/example/?service=wms&version=1.3.0&request=GetCapabilities will return a GetCapabilities response with the base URL set to ``https://maps.example.com/``.

```xml
    <WMS_Capabilities>
    <Service>
    <Name>WMS</Name>
    <Title>Example</Title>
    <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="https://maps.example.com/example/?"/>
```

When accessing a Mapfile using the `&map=` parameter, this will be appended to the `MS_ONLINERESOURCE` URL. For example, a request to https://maps.example.com/?map=/data/mapfiles/example.map&service=wms&version=1.3.0&request=GetCapabilities will return a GetCapabilities response including the following:

```xml
    <HTTP>
    <Get>
    <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="https://maps.example.com/?map=/data/mapfiles/example.map&"/>
    </Get>
```

For OGC API URLs requests such as https://maps.example.com/example/ogcapi/?f=json will return URLs in the format https://maps.example.com/example/ogcapi/collections?f=html.



To unsubscribe from these emails, change your notification settings at https://github.com/MapServer/MapServer/settings/notifications


More information about the MapServer-commits mailing list