Hello!
How do i get coordinates from KML or KMZ file? I have this javascript funtion that loads kml file and zooms to specified coordinates.
function LoadKMZKML(file){
viewer.dataSources.add(Cesium.KmlDataSource.load(file));
var coordinates=?;
viewer.camera.flyTo({
destination : Cesium.Cartesian3.fromDegrees(coordinates)
});
}
R.M
Assuming you just want to fly to the KML file extent, you can use viewer.flyTo instead of viewer.camera.flyTo
var promise = viewer.dataSources.add(Cesium.KmlDataSource.load(file));
viewer.flyTo(promise);
tiistai 5. toukokuuta 2015 16.04.37 UTC+3 Matthew Amato kirjoitti:
Assuming you just want to fly to the KML file extent, you can use viewer.flyTo instead of viewer.camera.flyTo
var promise = viewer.dataSources.add(Cesium.KmlDataSource.load(file));
viewer.flyTo(promise);
Hello!
How do i get coordinates from KML or KMZ file? I have this javascript funtion that loads kml file and zooms to specified coordinates.
function LoadKMZKML(file){
viewer\.dataSources\.add\(Cesium\.KmlDataSource\.load\(file\)\);
var coordinates=?;
viewer\.camera\.flyTo\(\{
destination : Cesium\.Cartesian3\.fromDegrees\(coordinates\)
});
}
R.M
--
You received this message because you are subscribed to the Google Groups "cesium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Thank you
Viewer.flyTo works but i still need position of the model for this other function rajaa().
function LoadKMZKML(file){
var p=viewer.dataSources.add(Cesium.KmlDataSource.load(file));
viewer.flyTo(p);
rajaa(longitude,latitude);
}
function rajaa(longitude,latitude) {
scene.screenSpaceCameraController.maximumZoomDistance=5000.0;
center = Cesium.Cartesian3.fromDegrees(longitude,latitude,0.0);
transform = Cesium.Transforms.eastNorthUpToFixedFrame(center);
camera = viewer.camera;
camera.constrainedAxis = Cesium.Cartesian3.UNIT_Z;
camera.lookAtTransform(transform);
}
I think you must iterate all your entities to get the right position. but you can identify an entity by setting an ID within your kml and starting iterate from it.
or if you find other solution I will also take it.