displaying vector tiles in Cesium

1,793 views
Skip to first unread message

susan....@tamucc.edu

unread,
Dec 23, 2015, 10:31:34 AM12/23/15
to cesium-dev
Hello,

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 (
-89.533156,29.58726,-84.1728,30.5219497),
fileExtension: 'png',
minimumLevel: 7,
maximumLevel: 18
})
);

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

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

Hannah Pinkos

unread,
Dec 23, 2015, 11:39:46 AM12/23/15
to cesium-dev, susan....@tamucc.edu
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.

Best,

Hannah

Rogers, Susan

unread,
Jan 5, 2016, 10:27:39 AM1/5/16
to Hannah Pinkos, cesium-dev

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

juho...@gmail.com

unread,
Jan 4, 2018, 10:37:19 AM1/4/18
to cesium-dev
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

Juho

Reply all
Reply to author
Forward
0 new messages