1

OpenMapTiles.org gives an example snippet (which is described as) showing how to use Mapbox GL JS to display openmaptiles generated tiles.

The full OMT example:

<!DOCTYPE html>
<html>
<head>
    <meta charset='utf-8' />
    <title>OpenMapTiles OSM Bright style</title>
    <meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
    <script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.29.0/mapbox-gl.js'></script>
    <link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.29.0/mapbox-gl.css' rel='stylesheet' />
    <style>
        body { margin:0; padding:0; }
        #map { position:absolute; top:0; bottom:0; width:100%; }
    </style>
</head>
<body>
    <div id='map'></div>
    <script>
        var map = new mapboxgl.Map({
            container: 'map',
            style: 'https://openmaptiles.github.io/osm-bright-gl-style/style-cdn.json',
            center: [8.5456, 47.3739],
            zoom: 11
        });
    </script>
</body>
</html>

I serve it from an nginx server and it does indeed work.

The path to the tiles is fairly deep however:

https://openmaptiles.github.io/osm-bright-gl-style/style-cdn.json
...
sources:
  openmaptiles: 
    type:  "vector"
    url: "https://free.tilehosting.com/data/v3.json?key=RiS4gsgZPZqeeMlIyxFo"
...

https://free.tilehosting.com/data/v3.json?key=RiS4gsgZPZqeeMlIyxFo
tiles:
  0:"https://maps.tilehosting.com/data/v3/{z}/{x}/{y}.pbf.pict?key=RiS4gsgZPZqeeMlIyxFo"

I have two questions:

  1. The above final tile endpoint https://maps.tilehosting.com/data/v3/{z}/{x}/{y}.pbf.pict appears from the suffix .pict not be a vector format. Is that correct? Is there another example using the vector format produced by the tools in openmaptiles git repo?
  2. Is the chain of files leading to the tiles endpoint all open software, or is some of it proprietary?

1 Answer 1

1

Regarding your first question:

.pbf.pict is just an alias for .pbf which could be set in the configuration file of Tileserver GL which I think is used for serving the OMT vector tiles in this case.

Some more information regarding .pbf.pict:

Regarding your second question:

https://openmaptiles.github.io/osm-bright-gl-style/style-cdn.json

is the following Mapbox GL style:

https://github.com/openmaptiles/osm-bright-gl-style

https://github.com/openmaptiles/osm-bright-gl-style/blob/master/style.json

License:

https://github.com/openmaptiles/osm-bright-gl-style/blob/master/LICENSE.md

This style references the sources which could be used for the map.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.