OpenstreetMap as default baselayer

41 views
Skip to first unread message

hashi...@gmail.com

unread,
Oct 8, 2019, 2:58:52 AM10/8/19
to cesium-dev
1. A concise explanation of the problem you're experiencing.
Hi I am building an application where i want the OSM as the default base layer instead of the bing Maps is there a way to do so. I have tried adding the code as mentioned as shown below


2. A minimal code example. If you've found a bug, this helps us reproduce and repair it.
var osm = new Cesium.OpenStreetMapImageryProvider({
    url : 'https://a.tile.openstreetmap.org/'
});
But it throws an error

"Uncaught TypeError: Cesium.OpenStreetMapImageryProvider is not a constructor"

3. Context. Why do you need to do this? We might know a better way to accomplish your goal.
Because of the reason i have to visualize the data every time a small change happens and i am nearly at the limit of 1000 bing sessions. Secondly i am doing this for my MS so i cant buy the cesium ion upgraded version


4. The Cesium version you're using, your operating system and browser.
I am using cesium 1.6


hashi...@gmail.com

unread,
Oct 8, 2019, 11:36:17 AM10/8/19
to cesium-dev
basically instead of using 
var osm = new Cesium.OpenStreetMapImageryProvider({
    url : 'https://a.tile.openstreetmap.org/'
});

You have to use
var osm = new Cesium.createOpenStreetMapImageryProvider({
    url : 'https://a.tile.openstreetmap.org/'
});

Please edit the documentation so that it reflects this the link for the documentation is as follows

Omar Shehata

unread,
Oct 8, 2019, 3:04:41 PM10/8/19
to cesium-dev
Thanks for catching that! That code example is generated from the source code, which you could fork and submit a pull request to fix:


That would definitely be a useful contribution! See the contributing guide for how to submit a pull request: https://github.com/AnalyticalGraphicsInc/cesium/blob/master/CONTRIBUTING.md#opening-a-pull-request
Reply all
Reply to author
Forward
0 new messages