Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cesium visualization issue with asset id: 120215 #338

Closed
osmondjia opened this issue Jul 4, 2020 · 3 comments
Closed

Cesium visualization issue with asset id: 120215 #338

osmondjia opened this issue Jul 4, 2020 · 3 comments

Comments

@osmondjia
Copy link

I have uploaded a geoJSON file in the Cesium ion, but there is a warning occurred that said "We're having trouble with your data. To help fix it, please open an issue in our Github repository."
What problems should be fixed?

@OmarShehata
Copy link

I think this is related to this issue: CesiumGS/cesium#8042

If you change the arcType after adding your GeoJSON to the scene it should fix it:

var promise = Cesium.IonResource.fromAssetId(121192)
  .then(function (resource) {
    return Cesium.GeoJsonDataSource.load(resource);
  })
  .then(function (data) {
    for (var i = 0; i < data.entities.values.length; i++) {
        var entity = data.entities.values[i];
        if (Cesium.defined(entity.polyline)) {
            entity.polyline.arcType = Cesium.ArcType.GEODESIC;
        }
    }
    return viewer.dataSources.add(data);
  })
  .then(function (dataSource) {
    return viewer.zoomTo(dataSource);
  })
  .otherwise(function (error) {
    console.log(error);
  });

@lilleyse
Copy link

This was fixed in CesiumGS/cesium#9028. The code works without the workaround now.

var promise = Cesium.IonResource.fromAssetId(121192)
  .then(function (resource) {
    return Cesium.GeoJsonDataSource.load(resource);
  })
  .then(function (data) {
    return viewer.dataSources.add(data);
  })
  .then(function (dataSource) {
    return viewer.zoomTo(dataSource);
  })
  .otherwise(function (error) {
    console.log(error);
  });

@lilleyse
Copy link

The fix will go out with the CesiumJS 1.72 release on August 3rd. It may also be deployed to ion before then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants