最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin1浏览0评论

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.

发布评论

评论列表(0)

  1. 暂无评论