How to use tilemaker-server with openlayers

29 Views Asked by At

I have a working tilemaker-server - I can view map and it works fine under: http://localhost:8080/ Now I'm trying to view this map with openlayers using example from: https://openlayers.org/en/latest/examples/mapbox-vector-tiles.html Like this:

import MVT from 'ol/format/MVT.js';
import Map from 'ol/Map.js';
import VectorTileLayer from 'ol/layer/VectorTile.js';
import VectorTileSource from 'ol/source/VectorTile.js';
import View from 'ol/View.js';
import {Fill, Icon, Stroke, Style, Text} from 'ol/style.js';
    
const map = new Map({
  layers: [
    new VectorTileLayer({
      declutter: true,
      source: new VectorTileSource({
        attributions:
          '© <a href="https://www.mapbox.com/map-feedback/">Mapbox</a> ' +
          '© <a href="https://www.openstreetmap.org/copyright">' +
          'OpenStreetMap contributors</a>',
        format: new MVT(),
        url:
          'http://localhost:8080/{z}/{x}/{-y}.pbf',
      }),
      style: createMapboxStreetsV6Style(Style, Fill, Stroke, Icon, Text),
    }),
  ],
  target: 'map',
  view: new View({
    center: [0, 0],
    zoom: 2,
  }),
});

And I see only part of water polygon. What is wrong ?

0

There are 0 best solutions below