TMS (Tile Map Service) request change

Hello,

I was wondering if it is possible only by adding some properties to change request type of Tile Map Service.

By default it is something like this URL / L / X / Y.png, but i want it to use GET parameters with layer name instead of pretty URLs

something like this URL ? X = something & Y = something & Layer = something.

Any information or hint will be helpful. :slight_smile:

Thanks.

Hi,

Have you looked at UrlTemplateImageryProvider?

Kevin

Thank you Kevin that was helpful btw could u help me with something else too, I’m trying to get tiles from server that is currently using EPSG:900913 coordinate system, which is not adding up correctly on cesium globe should I be converting coordinates while getting tiles or should I write in some of properties? And one more thing how can I get right coordinates on mouseClick event if I rotate camera by Z axis. Thank you.

EPSG:900913 is the same as the WebMercatorProjection in Cesium, so it should be supported. What problem are you seeing?

I attached screenshots. And this is code

" var viewer = new Cesium.Viewer(‘cesiumContainer’);

layers = viewer.scene.globe.imageryLayers;

var TMS= new Cesium.ImageryLayer(

new Cesium.UrlTemplateImageryProvider({

url : ‘/tms/1.0.0/google_streets_EPSG900913/{z}/{x}/{y}.png’

}));

layers.add(TMS);

"

By the way I tried this code too,

var TMS= new Cesium.UrlTemplateImageryProvider({
      URL: 'tms/1.0.0/google_streets_EPSG900913/{z}/{x}/{reverseY}.png',
      tilingScheme : new Cesium.GeographicTilingScheme(),
});
and this too
var TMS= new Cesium.UrlTemplateImageryProvider({
      URL: 'tms/1.0.0/google_streets_EPSG900913/{z}/{x}/{reverseY}.png',
      tilingScheme : new Cesium.WebMercatorTilingScheme(),
});


The second attempt in your last email, with reverseY and WebMercatorTilingScheme, looks right to me. What did that one look like?

Actually I took these screenshots from that code the second one, anyway I changed it to geoserver to WMS requests and now it is working, thank you very much for help. By the way do u know anything about GeoserverTerrainProvider plugin? I need to add custom terrain from geoserver to cesium they have given me WMS url.

Hello I'm the author of geoserverTerrainProvider plugin.

Hello I’m the author of geoserverTerrainProvider plugin.

Hello, I am trying to add terrain from geoserver, I have been given URL ( /geoserver/cite/wms), NAME of layer and XML url

code:

viewer = new Cesium.CesiumWidget(‘cesiumContainer’);

var terrainProvider = new Cesium.GeoserverTerrainProvider({

url : “/geoserver/cite/wms”,

xml: “/geoserver/ows?service=wms&version=1.1.0&request=GetCapabilities”,

layerName: “DEM_2014”,

formatImage: {format : “image/jpeg”,extension: “jpeg”}

});

viewer.terrainProvider = terrainProvider;

When I add terrainProvider globe goes blank, no error no warning nothing comes up in console. I’m new in cesium and geoserver so I do not know what else configs should i have, is there something that I’m missing and what else params/options should I ask server admins to make sure I have everything to support my side.

Thank you.

For me, you should have
terrainProvider = new Cesium.GeoserverTerrainProvider({
                 url : ‘http://localhost:8080/geoserver/ows’,
                 layerName: ‘cite:DEM_2014’,
                formatImage: {format : “image/jpeg”,extension: “jpeg”}
             });

the xml parameter isn't a string but DOM Document. You must have a real URL (/geoserver/cite/wms isn't an Uniform Resource Locator!).
If there is other issues could you send me your capabilities document?

I attached screen.

This is the layer at geoserver.

CODE:

var terrainProvider = new Cesium.GeoserverTerrainProvider({

service: “WMS”,

url : “http://10.10.120.169:8080/geoserver/wms”,

layerName: ‘cite:DEM_2014_1’,

formatImage: {format : “image/png”,extension: “png”},

hasStyledImage: false

});

RESULT:

When I add this terrain, app starts sending requests for tiles (I guess? no visual change. The default cesium layer re-renders), they come only once and app stops requesting them even after I change elevation level, no terrain is observable it is all flat.