Vector maps
The vector tiles maps API consists of two main parts: pre-defined vector data pieces (tiles) and a style which is defined by a text file. Usually, only a style file is necessary, containing information also about other components. Three vector maps layers are available: base map, points of interest, and a layer of labels and lines (place names, addresses, street names, street and boundary lines, etc.), which is suitable as an additional layer to an orthophoto map or satellite imagagery. Layers can be combined or used separetely.
Attribution
When using map services provided by Jāņa sēta in any format (including printed materials), proper attribution must be included. The attribution should be accessible according to the medium used—either displayed on the map itself or in a references or similar section. The exact form of attribution may vary depending on the specific styles used:
- base map or labels and lines — © Jāņa sēta;
- points of interest — © Jāņa sēta, OpenStreetMap.
URL
Styling information must match following pattern:
https://wms.kartes.lv/vectortiles/styles/style-combiner.php?key=
The response is given in JSON.
The HTTP GET request method is used.
Query parameters
The request consists of the following GET parameters:
Parameter | Description | Possible values |
---|---|---|
styles | Names of necessary vector map layers (comma separated) | baltic-vt - Base map; poi - Points of interest layer; baltic-vt-orto - Labels and lines (suitable as an additional layer to an orthophoto map) |
tilesize | Tile size in pixels | Default value: 128 |
Error codes
Status code | Description |
---|---|
200 | Wrong input data. Server can’t respond due to client error. |
404 | No location found. The URL is not recognized; the resource does not exist. |
5xx | Server error. |
Examples
Base map
Inuput:
https://wms.kartes.lv/vectortiles/styles/style-combiner.php?styles=baltic-vt&key=
Base map with points of layers
Input:
https://wms.kartes.lv/vectortiles/styles/style-combiner.php?styles=baltic-vt,poi&key=
Labels and lines with the points of interest on the orthophoto map
Input:
https://wms.kartes.lv/vectortiles/styles/style-combiner.php?styles=baltic-vt-orto,poi&key=
Use examples
Example of implementing BalticMaps vector basemap in MapLibre map library.
If npm is used, MapLibre can be installed with the following command:
npm install maplibre-gl
Create a map element in HTML:
<div id="map"></div>
Initialize the map in JavaScript:
import maplibregl from 'maplibre-gl';
import 'maplibre-gl/dist/maplibre-gl.css';
const api_key = 'your_api_key_here'; // Replace with your actual API key
// Initialize the map
const map = new maplibregl.Map({
container: 'map', // Container ID
style: `https://wms.kartes.lv/vectortiles/styles/style-combiner.php?styles=baltic-vt&key=${api_key}`, // Style URL
center: [24.773591, 57.208140], // Starting position [lng, lat]
zoom: 12 // Starting zoom level
});