displaying vector tiles in Cesium


Does anyone know how to display vector tiles generated from a shapefile in Cesium?

I tiled a shapefile with TileMill (https://www.mapbox.com/timemill). Then, I unpacked the resulting .mbtiles file with mbutil (https://github.com/mapbox/mbutil, https://www.e-education.psu.edu/geog585/node/711). The .mbtiles unpacks into directories 7/, 8/, ... , 18/ with png's and a metadata.json.
Tilestream can display the vector tiles (https://github.com/mapbox/tilestream). In a terminal, cd into the tilestream folder and run this command: node --harmony index.js --tiles='[path and directory that contains your unpacked .mbtiles]' &
A webpage http://localhost:8888/ displays zoomable vector tiles.
This works on both Windows 7 and Ubuntu 14.04.

In my Cesium app, I've tried several providers and several url variations. However, I am not able to display shapefile generated vector tiles draped over my Cesium terrain map.

var shorelines = layers.addImageryProvider(
                   new Cesium.OpenStreetMapImageryProvider({
                     url: 'http://localhost:8888',
                     rectangle: new Cesium.Rectangle.fromDegrees (
         fileExtension: 'png',
                     minimumLevel: 7,
                     maximumLevel: 18

I tried various providers:
TileMapServiceImageryProvider (with the directories and metadata files for it),

I tried different url’s to the tiles:
url: ‘http://ipaddress:8888/v2/firstTileMill_a2650c/{z}/{x}/{y}.png’,
url: ‘ipaddress:8888/map/firstTileMill_a2650c’,
url: ‘http://ipaddress/#!/map/firstTileMill_a2650c’,.

Please help if you are able to get vector tiles to display in Cesium. Thanks!

Susan Renee

Hello Susan,

Have you tried using the UrlTemplateImageryProvider?

If you know what format the URL is expected to be in, you can use a template as the url parameter. Read the documentation for details.

I’m not sure if this would help at all, but we do also have a MapboxImageryProvider.



Thanks Hannah,

I appreciate your help. Not able to get vector tiles to display, just yet. I will keep trying different calls to the function UrlTemplateImageryProvider
and also MapboxImageryProvider. Wish there were a tutorial with a method to create vector tiles and display in Cesium. Thank you for sharing with me these two functions.

Susan Renee

Hi Susan

Did you able to read mbtiles in your cesium application? i am facing the same problem, i host my mbtile files on my webserver and i try to rendered them on my cesium application (running on the same webserver as mbtiles)

The best