Open dilignt opened 8 years ago
@dilignt, if you remove you columbus changes, does the tileset appears in 3D?
Thanks for your reply @gberaudo
No - I can't get any 3d view with those changes removed, it's just a blue screen. Looking at the console it seems that none of the images can be found because the path is being formatted Incorrectly. eg
An error occurred in "kh": Failed to obtain image tile X: 1 Y: 0 Level: 1.
An error occurred in "kh": Failed to obtain image tile X: 1 Y: 1 Level: 1
on Line 424 of Cesium.js it is looking for the images in paths host/1/1/-1.jpg
and host/1/1/-2.jpg
but the images are actually at host/1/1/0.jpg
and host/1/1/1.jpg
. All of the tiles have the same error in Cesium, but they are fine in ol3. Do you know what needs to change so that the images can be found correctly?
@dilignt, in 2D, OL3 is displaying your map while in 3D it is Cesium. You are using a custom tilegrid in OL3 but there is no support for this in OL3-Cesium. In a general case, I think it would require reprojection.
Tiles are requested by Cesium in src/core/olimageryprovider.js requestImage()
.
You may try to adapt the code there.
Alternatively, you may try using a standard tilegrid, and restrict the layer to your extent: http://openlayers.org/en/master/apidoc/ol.source.XYZ.html http://openlayers.org/en/master/apidoc/ol.layer.Layer.html For this to work, you will need to generate you tileset on a global tilegrid.
Thanks - I tried changing requestImage()
and the tiles are now loaded into cesium. The problem now is that the 3d view is zoomed all the way in so that you can't see the images at all. If I zoom out I start to see a tile magnified, but then the browser runs out of memory and crashes. There are also other tile requests from Cesium for tiles that are outwith the bounding box of my tileset. Is there a way to somehow constrain the zoom levels and extent of the 3d view in Cesium so that these problems don't occur?
There is a rectangle
property on the imagery provider.
Yes, I noticed the Rectangle, but I can't see a way to convert my pixel dimensions into radians or degrees when my tileset is flat and not a globe - Cesium.Rectangle is instantiated with NSEW lat/lon points in radians. Do you know if this is possible?
I have no way of generating a tileset on a global grid - it isn't a map it's a floorplan.
I've got a small TMS tileset that I've created a ol3 map with. The tilemap resource file uses pixel coordinates,
The code I've used to create the ol3 map is
This ol3 map works great. I'm now trying to view the map using ol3-cesium with a SceneMode of COLUMBUS_VIEW with the following code
I had to change the scene3DOnly parameter to false in the build when olcs is initialising the scene to get the code to run.
The ol3-cesium view is not rendering correctly - there are loads of missing image tile errors, and the 3d scene is not showing. What am I missing - is there some conversion that needs to happen, or some bounding rectangle that needs to be configured somewhere? Is it possible to use small TMS tilesets in ol3-cesium with columbus view?
Any help gratefully appreciated - many thanks in advance