Search code examples
angularcesiumjswms

how to request an unique tile for wms layer in cesium?


I am trying to create a kind of timeline using cesium, WMS server and layers. I am currently using WebMapServiceImageryProvider but it gives me a layer in many tiles. For my timeline I would like to use a singleTile, to reduce request to the server. I have tried to implement SingleTileImageryProvider but it still provides me many tiles. Can someone help me ?

I think i probably should get a rectangle for my geographical zone, and give it to cesium, but i do not understand how. Moreover, cesium documentation is not really explicite.


Solution

  • Ok, I have finally got success with this subject.

    To resume, I wanted to request a same layer each time with different dimension value and do a kind of animation by display or not each. To reduce sended request on my server, I wanted to disable tiles and request a unique tile.

    I have done this by using SingleTileImageryProvider. Many parameters are needed. First, the tile width and height. I set screen dimensions. Then, rectangle covered by the image in response and the BBOX parameter provided by getting upperRight and lower left coordinates.

    I have forced my request to use CRS:84, to deal with degrees, not meters. Then I get lat/long of upperRight and LowerLeft corner of my screen, using cesium methods. These coordinates helped me to define my BBOX.

    I can now launch my animation, just a tile is loaded by deadlines, and my server is not satured.