EN · DE · FR · IT · ES
  • Products
  • Pricing
  • Documentation
  • Log in Try for free

Vector API documentation

Hosted map styles for MapLibre GL JS

  • Web applications
  • Desktop applications
  • Raster API
  • Vector API
    • Service
    • Map style
    • Layers
    • Global state
    • Anchor
  • Print maps
  • FAQ

Service

The hosted style.json URL is the main entry point for our vector map service. The style tells your map library how to draw the map and where to request tiles from our latest Mapbox Vector Tile (MVT) dataset.

https://maps.omniscale.net/v2/{api-key}/style.json

Replace {api-key} with a vector API key registered for your website’s domain. You can create one in the Vector tiles tab in the customer area.

Map library

We recommend MapLibre GL JS, the renderer we officially support for our vector styles. The current styles require version 5.22.0 or later.

Here is how to load the map in MapLibre GL JS. Pass the hosted style URL as the style option.

const map = new maplibregl.Map({
    container: 'map',
    style: 'https://maps.omniscale.net/v2/your-api-key/style.json',
    center: [8.22, 53.14],
    zoom: 13
});

Keep the attribution control visible to display the credits supplied by the style. See the complete MapLibre GL JS example.

If your application requires OpenLayers, use the ol-mapbox-style converter to load the same style URL. MapLibre GL JS generally renders vector maps faster, and OpenLayers places labels differently.

Map style

You can select the map style with the style path segment. Use style.default for the standard color map or style.grayscale for grayscale. If you omit this segment, the map uses the standard color style.

https://maps.omniscale.net/v2/{api-key}/style.default/style.json
https://maps.omniscale.net/v2/{api-key}/style.grayscale/style.json

Layers

With vector tiles, you can choose which layers your map draws. In our vector styles, roads alone use separate layers for outlines and fills, with additional layers for bridges and tunnels. If you selected these layers individually, you would have to track their internal names and update your application whenever we added or renamed a road layer.

To give you a stable way to select map content, we group these layers into the same categories as the raster API. The roads category lets you show or hide all the road layers together, even when we change how the style draws them.

You can set the initial selection in the style URL and change it after the map loads using MapLibre global state.

Select layers in the style URL

Use the layers path segment to select categories. It can come before or after style. For the default map, omit this segment or use layers.osm.

  • To show only certain categories, list their names separated by commas.
  • To change the default selection, prefix each name with + to add that category or - to hide it.
Roads and labels only
https://maps.omniscale.net/v2/{api-key}/layers.roads,labels/style.json

Grayscale map without labels or house numbers
https://maps.omniscale.net/v2/{api-key}/style.grayscale/layers.-labels,-housenumbers/style.json

Default map with points of interest
https://maps.omniscale.net/v2/{api-key}/layers.+pois/style.json
LayerEnabled by defaultMap content
worldYesLand and water background
landusagesYesLand use, including forests, parks, and built-up areas
adminYesAdministrative boundaries
roadsYesRoads
buildingsYesBuilding footprints
labelsYesMap labels, including place and street names
housenumbersYesHouse numbers
poisNoPoints of interest, including shops, hospitals, and parking lots

All selections use the same vector tiles. Hiding a category changes what the map draws, and its features remain in the downloaded tiles.

Change layer visibility with global state

Use MapLibre global state to show or hide a category while someone is using the map. Call map.setGlobalStateProperty with omniscale: followed by the category name. Set the value to true to show the category or false to hide it.

This checkbox starts with the style’s current setting. Selecting or clearing it shows or hides points of interest without reloading the map.

<label><input type="checkbox" id="show-pois" disabled> Show points of interest</label>
map.on('load', () => {
    const checkbox = document.getElementById('show-pois');
    checkbox.checked = map.getGlobalState()['omniscale:pois'];
    checkbox.disabled = false;
    checkbox.addEventListener('change', () => {
        map.setGlobalStateProperty('omniscale:pois', checkbox.checked);
    });
});

Labels, house numbers, and points of interest each have their own switch. Pass null to restore a category’s initial setting from the style URL. If your application replaces the style, reapply the user’s choices after the new style loads.

For MapLibre GL JS 6.x, use 6.17.0 or later when switching layers at high zoom. In earlier 6.x releases, set zoomLevelsToOverscale: undefined in the map constructor so previously hidden layers can appear above the dataset’s maximum zoom.

Add your own layers above or below map content

When you add your own data to the map, you can choose which parts of the basemap appear above or below it. For example, you might draw a route line below the map labels so street names stay readable, and place its stops above the labels. Our styles provide named positions, called anchors, for placing your own layers.

Pass the anchor name as the beforeId argument to map.addLayer. MapLibre draws your layer immediately before that anchor. The omniscale:below-{category} anchor comes before the category’s first layer. The omniscale:above-{category} anchor comes after its last layer, so inserting there draws your layer above the category.

The labels anchors span map labels, house numbers, and points of interest. This example uses a GeoJSON file containing a LineString for the route and Point features for its stops.

map.on('load', () => {
    map.addSource('route', {type: 'geojson', data: '/data/route.geojson'});

    map.addLayer({
        id: 'route-line',
        type: 'line',
        source: 'route',
        filter: ['==', ['geometry-type'], 'LineString'],
        paint: {'line-color': '#2166ac', 'line-width': 4}
    }, 'omniscale:below-labels');

    map.addLayer({
        id: 'route-stops',
        type: 'circle',
        source: 'route',
        filter: ['==', ['geometry-type'], 'Point'],
        paint: {'circle-color': '#2166ac', 'circle-radius': 6}
    }, 'omniscale:above-labels');
});

Anchors keep their positions when you hide or show a category. Categories can overlap in drawing order, so the range between two anchors can include other map content. Symbol layers still follow MapLibre’s label collision rules.

Help and Service

  • Register • Log in
  • Products & Functions
  • Plans and Pricing
  • Interactive map
  • Help, Documentation & API
  • Available projections

About us

  • Legal
  • Terms and Conditions
  • Privacy

Contact details

Omniscale GmbH & Co. KG
Moltkestraße 6a
26122 Oldenburg
Germany
Go to contact form ↝

Copyright © 2026 • Omniscale, Map data: OpenStreetMap (License: ODbL)

* For business customers only. We do not enter into contracts with consumers within the meaning of Section 13 of the German Civil Code (BGB). All prices are listed excluding VAT.