I’d like to add additional “Flat” map projections (e.g. Mercator and Winkel-Tripel) in addition to the equirectangular (GeographicProjection) one already available.
I can do the projection math pretty easily, but it seems like Cesium might require a pretty big refactor. Am I missing something? Is there an easy way to add these?
Cesium has support for web mercator. Here’s a code sample:
var viewer = new Cesium.Viewer('cesiumContainer', {
sceneMode : Cesium.SceneMode.SCENE2D,
mapProjection: new Cesium.WebMercatorProjection(Cesium.Ellipsoid.WGS84)
});
For something like Winkel-Tripel projection, you might run into some weirdness with the infinite scrolling. I would recommend starting out using the rotation map mode for 2D:
var viewer = new Cesium.Viewer(‘cesiumContainer’, {
sceneMode : Cesium.SceneMode.SCENE2D,
mapMode2D : Cesium.MapMode2D.ROTATE
});
``
If you do implement Winkel-Tripel, let us know! I think that’s something other people would be interested in, we would love the contribution back =)
Also, it doesn’t look like the mapProjection can be changed “on-the-fly” (i.e. after the scene is already created) as it’s a read-only property and doesn’t seem to have a setter. Is that true?
Sorry, I’m not too familiar with the specifics. Maybe Kevin or someone else can give some more information.
For changing the projection on the fly- I know we used to have that available. I’m not sure why we changed it to read-only.
Sorry for not being more helpful, this is an area of the library I’m not as familiar with.