I’ve been working with cesium for a little while, and I think I’m doing the right things with the WebMapServiceImageryProvider, according to the API and what chatter there is. I’ve got some issues though. I want to build an application that can show meteorological data (WMS) overlays for a given view over the course of a few days in play mode (3hr time steps). However, I cannot get this thing to stop doing three VERY annoying things:
1. Ordering data for the planet when all I want is the area around the UK (or the current viewport or wherever). Even when I specify a rectangle, see below.
2. Ordering data for zoom levels in addition to my current zoom (when rectangle is specified, current zoom is constrained to that, but you can see it pulling-in much lower resolution data as well.
3. Tiling! I want to turn it off for vector layers – it should not be used for vectors, because the geoserver providing my vector data will only provide full vectors, ceasing at a certain padding before ordered edges… When you tile, EACH tile has this padding, destroying the look of your data. I’ve increased the tile size, but it still tiles it at least at 0deg and 180…
4. Projection – the overlays ordered from the GeoServer are crisp – great looking… then the api mangles those overlays, causing vector data and contours to look fuzzy.
The question(s): How do I do the following? :
1. In addition to selecting tile sizes, I should be able to elect to just turn tiling off.
2. I should be able to make requests solely for my area of interest and current zoom.
3. I’d like to specify alternative projections to avoid the stretching one sees as one nears the poles – it looks like this is allowed, and there may be examples… Failing that, at the least - data overlaid onto my map should be nearly as crisp as the data ordered - I've heard there are multiple projections - maybe understandable for 3D.. Can I make that stop for 2D?
Code:
// rectangle has already been specified by either selection or rubber band...
// commented items w/in code were suggestions gained through correspondence with Tim Rivenbark. They did not work as needed (WMS image becomes static - not useful for zoom-ins).
this.AddLayerToRect = function(layerName, hostURL){
var self = this;
var rect = new Rectangle.fromDegrees(self.rect.left, self.rect.bottom, self.rect.right, self.rect.top);
if ((rect.height == 0) || (rect.width == 0)) {
this.AddLayer(layerName, hostURL);
return;
}
//var southwestMeters = webMercatorProjection.project(Rectangle.southwest(rect));
//var northeastMeters = webMercatorProjection.project(Rectangle.northeast(rect));
var wmsProvider = new WebMapServiceImageryProvider({
url : hostURL,
layers : layerName,
enablePickFeatures : true,
rectangle : rect,
tileWidth : 2048,
tileHeight : 2048,
parameters: {
dim_analysis_time : analysisTime,
format : 'image/png',
transparent : true
},
//minimumLevel : 0,
//maximumLevel : 0,
//tileWidth : 256,
//tileHeight : 256,
//tilingScheme : new WebMercatorTilingScheme({
//numberOfLevelZeroTilesX : 1,
//numberOfLevelZeroTilesY : 1,
//rectangleSouthwestInMeters : new Cartesian2(southwestMeters.x, southwestMeters.y),
//rectangleNortheastInMeters : new Cartesian2(northeastMeters.x, northeastMeters.y)
//}),
// validTimes is filled elsewhere - this works
times: validTimes,
clock: cesiumViewer.clock
});
cesiumViewer.imageryLayers.addImageryProvider(wmsProvider);
}
Using Chrome during dev. Cesium 1.46 with updates (not yet officially integrated) that fix WMS usage with the clock.
Testing: Find a WMS source with defined time steps. Use fixed WebMapServiceImageryProvider.js (see https://github.com/AnalyticalGraphicsInc/cesium/pull/6348 - great work). Hit play and watch unusable display of tiling mess and bizarre low-rez downloads as the tiles settle that occurs. Timed wms overlays need to avoid tiling.