Skip to main content

Connect map services

If you want to use maps within forms, you must connect a map service. This is done via the Web Map Service protocol.
To connect a map service, you must perform the following steps:

  • Open the appsettings.json file (default path under Windows C:\inetpub\wwwroot\linqi\appsettings.json) within the linqi installation folder using a text editor.
  • This file contains the configuration of linqi in JSON format.
  • Search for the area “Maps”: []. If this area does not exist, you can insert it.
  • Within the Maps area you can now insert a new entry for a map:
  {
"Id": "1a01686a-b448-4612-a7fc-157be7efa4cd",
"IsDefault": true,
"DisplayName": {
"de": "Welt",
"en": "World",
"fr": "Monde",
"es": "Mundo"
},
"Layers": [
{
"Id": "raster-tiles",
"Type": "Raster",
"TileUrl": "WMS_URL",
"TileSize": 256,
"Attribution": "Powered by...",
"MinZoom": 0,
"MaxZoom": 18
}
],
"GeoCodeConfig": {
"SearchUrl": "GECODE_URL"
},
"DefaultCenter": {
"Latitude": 51.32676167349368,
"Longitude": 10.031064679564793
},
"DefaultZoom": 4
}

You must replace the following values:

  • Id must be a unique value in Guid format. For example, you can create a Guid on the following page.
  • IsDefault specifies whether the card is the default card or another one. You always need exactly one default card.
  • DisplayName specifies the name of the map in the different languages
  • Layers defines the layers of the map. This has the following settings:
    • Id must be a unique value
    • Type should be left at Raster for most services
    • TileUrl defines the url of the map service. Details of this url can be found below.
    • TileSize specifies the size of the individual tile elements in pixels.
    • Attribution defines a text that is displayed at the bottom right corner of the map and can be used to specify the source of the map data.
    • MinZoom is the smallest zoom level supported by the map
    • MaxZoom is the largest zoom level supported by the map
  • GeoCodeConfig allows you to specify a url for searching for locations. For example, Nominatim is supported as a source.
  • DefaultCenter allows you to specify the default latitude and longitude coordinates used when initially opening the map
  • DefaultZoom allows you to specify the default zoom level

After you have made this entry, you can save the appsettings.json file and restart the service. Maps can then be used in linqi.

Web Map Service Url

To make the WMS_URL dynamic, the following placeholders are available in the url:

PlaceholderDescription
{x}The index of the tile along the map’s x axis according to Spherical Mercator projection. If the value is 0, the tile’s left edge corresponds to the 180th meridian west. If the value is 2z−1, the tile’s right edge corresponds to the 180th meridian east.
{y}The index of the tile along the map’s y axis according to Spherical Mercator projection. If the value is 0, the tile’s tile edge corresponds to arctan(sinh(π)), or approximately 85.0511 degrees north. If the value is 2z−1, the tile’s bottom edge corresponds to −arctan(sinh(π)), or approximately 85.0511 degrees south.
{z}The tile’s zoom level. At zoom level 0, each tile covers the entire world map; at zoom level 1, it covers ¼ of the world; at zoom level 2, 1⁄16 of the world, and so on.
{bbox-epsg-3857}The tile’s bounding box, expressed as a comma-separated list of the tile’s western, southern, eastern, and northern extents according to Spherical Mercator (EPSG:3857) projection. The bounding box is typically used with map services conforming to the Web Map Service protocol.
{quadkey}A quadkey indicating both the tile’s location and its zoom level. The quadkey is typically used with Bing Maps.
{ratio}A suffix indicating the resolution of the tile image. The suffix is the empty string for standard resolution displays and @2x for Retina displays.
{prefix}Two hexadecimal digits chosen such that each visible tile has a different prefix. The prefix is typically used for domain sharding.