javascript - How to zoom entitiesdatasources with Cesium? - Stack Overflow

I tried:czmlDataSource.load(czmlurl).then(function(){viewer.dataSources.add(czmlDataSource).then(functi

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
Add a ment  | 

1 Answer 1

Reset to default 4

Give 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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745193884a4615996.html

相关推荐

  • javascript - How to zoom entitiesdatasources with Cesium? - Stack Overflow

    I tried:czmlDataSource.load(czmlurl).then(function(){viewer.dataSources.add(czmlDataSource).then(functi

    2小时前
    30

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信