Skip to content

Flyto or zoomto to an entity or entities #70

@CMCDragonkai

Description

@CMCDragonkai

On cesium you can normally add an entity and fly to that entity:

            var wyoming = viewer.entities.add({
                name: 'Wyoming',
                // polygon :: Cesium.PolygonGraphics
                polygon: {
                    // polygon longitude and latitude (not totally accurate)
                    hierarchy: Cesium.Cartesian3.fromDegreesArray([
                        -109.080842, 45.002073,
                        -105.91517,  45.002073,
                        -104.058488, 44.996596,
                        -104.053011, 43.002989,
                        -104.053011, 41.003906,
                        -105.728954, 40.998429,
                        -107.919731, 41.003906,
                        -109.04798,  40.998429,
                        -111.047063, 40.998429,
                        -111.047063, 42.000709,
                        -111.047063, 44.476286,
                        -111.05254,  45.002073
                    ]),
                    material: Cesium.Color.RED.withAlpha(0.5)
                }
            });

            viewer.flyTo(wyoming).then(function(result){
                if (result) {
                    viewer.selectedEntity = wyoming;
                }
            });

I just tried this with an entity I added via ob = v.dataSources.add() but I wasn't able run v.camera.flyTo(ob), it didn't fly anywhere.

How can this be done? Also I'm a bit confused as to how Cesium's Javascript API maps to the Python object API, some things are placed in different areas.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions