1

Link to problem: https://khuts.org/webmap/osm-bright-style/mines.html Neither the mapbox-street layer nor the tile layer show. This map has an mbtiles file served using tileserver-php. The error refers to tile-coord.js, which does not seem to have any property 't' in it.

How do I resolve this?

Narelle
  • 31
  • 6
  • Can you extend on your question? How are you creating the layer causing the problem? – Scarysize Jan 30 '18 at 14:10
  • 1
    The relevant code is map.on('style.load', function() { map.addSource("operating", { "type": "vector", "data": "http://khuts.org/webmap/tileserver-php/operations.mbtiles" }); map.addLayer({ "id": "operating", "type": "circle", "source": "operating", "paint": { "circle-radius": 10, "circle-color": "#ccc" } }); – Narelle Jan 30 '18 at 22:45

1 Answers1

0

Seeing your comment here, you need to change how you create your data source. vector sources don't accept a data option, you either need to supply tiles (an array of tile urls) or an url (an url pointing to a TileJSON file):

map.addSource('my-source', {
  type: 'vector',
  // either "tiles"
  tiles: ['http://my-tile-server/{z}/{x}/{y}'],
  // or "url"
  url: 'http://my-tile-server/tiles.json'
});

If you are using tileserver-php, it supports both: - tile urls (z/x/y) - tile jsons

See its documentation of "Supported Protocols": https://github.com/klokantech/tileserver-php#supported-protocols

Scarysize
  • 4,131
  • 25
  • 37
  • Unfortunately, I cannot install node / npm on a hosted, shared server, which is why tileserver-php was the choice. I will have to extract the tiles from the archive and serve them that way. Thanks for the response. – Narelle Jan 31 '18 at 10:07
  • I updated my answer. tileserver-php also exposes tile urls and tile.json. – Scarysize Jan 31 '18 at 11:11