I tried:
czmlDataSource.load(czmlurl).then(function(){
viewer.dataSources.add(czmlDataSource).then(function(){
viewer.flyTo(viewer.dataSources,offset);
});
});
This:
czmlDataSource.load(czmlurl).then(function(){
viewer.dataSources.add(czmlDataSource).then(function(){
viewer.zoomTo(viewer.dataSources,offset);
});
});
And this:
czmlDataSource.load(czmlurl).then(function(){
viewer.dataSources.add(czmlDataSource);
viewer.flyTo(viewer.dataSources,offset);
});
And its .zoomTo
equivalent without success. What to do now?
Edit: The answer that works is: viewer.flyTo(czmlDataSource) I thought I had to use the viewer's data source as in viewer.DataSources, which was my mistake, that did not work.
Stack overflow has bee so stale people waste their time correcting grammar and spelling on 3 year old posts.
I tried:
czmlDataSource.load(czmlurl).then(function(){
viewer.dataSources.add(czmlDataSource).then(function(){
viewer.flyTo(viewer.dataSources,offset);
});
});
This:
czmlDataSource.load(czmlurl).then(function(){
viewer.dataSources.add(czmlDataSource).then(function(){
viewer.zoomTo(viewer.dataSources,offset);
});
});
And this:
czmlDataSource.load(czmlurl).then(function(){
viewer.dataSources.add(czmlDataSource);
viewer.flyTo(viewer.dataSources,offset);
});
And its .zoomTo
equivalent without success. What to do now?
Edit: The answer that works is: viewer.flyTo(czmlDataSource) I thought I had to use the viewer's data source as in viewer.DataSources, which was my mistake, that did not work.
Stack overflow has bee so stale people waste their time correcting grammar and spelling on 3 year old posts.
Share Improve this question edited May 29, 2019 at 20:41 TTR asked Nov 21, 2015 at 10:44 TTRTTR 1832 silver badges13 bronze badges 1- Please provide full code context. – Andrew Commented May 22, 2019 at 18:43
1 Answer
Reset to default 4Give this a try:
viewer.dataSources.add(czmlDataSource);
czmlDataSource.load(czmlurl).then(function() {
viewer.flyTo(czmlDataSource, options);
});
See also: viewer.flyTo for the available options
.
Also remember to check the web console for any errors, and include them with your question if they are relevant.