Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Viewer.js always defaults to Bing Imagery provider when baseLayerPicker option set to false #879

Closed
cmorse opened this issue Jun 18, 2013 · 5 comments

Comments

@cmorse
Copy link
Contributor

cmorse commented Jun 18, 2013

With the following options set, Viewer.js will default to Bing Maps as the imagery provider.

var viewer = new Cesium.Viewer('cesiumContainer', {
    baseLayerPicker : false,
    selectedImageryProviderViewModel : new Cesium.ImageryProviderViewModel({
        name : 'Open\u00adStreet\u00adMap',
        iconUrl : require.toUrl('../Images/.../openStreetMap.png'),
        tooltip : 'OpenStreetMap (OSM) is a collaborative project ...',
        creationFunction : function() {
            return new Cesium.OpenStreetMapImageryProvider({
                url : 'http://tile.openstreetmap.org/'
            });
        }
    })
});
@shunter
Copy link
Contributor

shunter commented Jun 18, 2013

I fixed a few typos in your sample code (note it's baseLayerPicker with a capital L, the doc was wrong, fixed with #870 today)

Another unfortunate problem with the current code is that you have to create a ImageryProviderViewModel with all properties filled in, even though you don't actually need the name, url, tooltip, and you don't need the extra layer of creationFunction.

Perhaps we can add an option to allow directly specifying an ImageryProvider.

@cmorse
Copy link
Contributor Author

cmorse commented Jun 18, 2013

Thanks!

It would be nice to specify the ImageryProvider directly. In my case, we only want to support a single provider. I would be willing to implement that if you give me an idea of how to do it since setting ImageryProvider would probably not work with the baseLayerPicker or ImageryProviderViewModel options.

mramato added a commit that referenced this issue Jun 19, 2013
Allow users to specify `options.imageryProvider` rather than `options.selectedImageryProviderViewModel` when the BaseLayerPicker is not being used.
@mramato
Copy link
Contributor

mramato commented Jun 19, 2013

This was an easy fix so I opened the above pull request for it. Let me know what you think.

@cmorse
Copy link
Contributor Author

cmorse commented Jun 19, 2013

Thanks for the quick patch. I'll check it out at work tomorrow.

@cmorse
Copy link
Contributor Author

cmorse commented Jun 19, 2013

This worked perfectly for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants