**Hello guys, **
I’m working on a mobile version of an application using cesium and I’m running into a showstopper.
The thing that we need to be able to support to make this project work with cesium is kml layers. Great thing is that it works perfectly on desktop.
However once switching to android I’m getting completely different result. Almost as if the mobile version is ignoring the settings given in order to place it on the terrain rather then under it.
I’m using the following code to setup the kml layer
private async addAllLayers() {
if (!this.kmlLayerCollection.ready) {
await new Promise((resolve) => {
let unobserve = observe(this.kmlLayerCollection, “ready”, change => {
if (this.kmlLayerCollection.ready) {
resolve();
unobserve();
}
})
})
}
let promises: Promise = ;
this.kmlLayerCollection.layers.forEach(l => promises.push(this.addKmlLayer(l)));
let layers: any = await Promise.all(promises);
layers.forEach(l => this.cesiumStore.viewer.dataSources.add(l))
}
private addKmlLayer(kml: KmlLayerModel) {
return new Promise((resolve) => {
Cesium.KmlDataSource.load(kml.src, {
camera: this.cesiumStore.viewer.scene.camera,
canvas: this.cesiumStore.viewer.scene.canvas,
clampToGround: true
}).then((r: any) => {
this.cesiumStore.activeKmlLayers.push({ cesiumLayer: r, model: kml });
let name = r.name as string;
if (!kml.name) kml.name = name.slice(0, name.length - 4);
resolve®;
})
})
}
This code gets the following results, I’ll post an image of the result I get on desktop and one of mobile. I’ll post the specs under the image
Phone
**Device: Huawei Mate 10 lite. **
Browser: Chrome V70.0.3538.80
Desktop
Everything is working as intended on desktop so I don’t see a reason to post those specs.
I need this to show the same result on desktop aswell as mobile. We’re working on a new pilot for a platform that would go into the hands of alot of local residents. In the world of today that means that a majority of users are coming to the website using a mobile phone. Not being able to show the same results on mobile as on desktop would mean that we can’t actually use cesium for this pilot. Which would suck because we really love using cesium.
Is there anything that can be done about this problem? Is it even a problem or have I simply not set some things the way they are supposed to?
Best regards,
Wilco de Boer