ThinkGeo.com    |     Documentation    |     Premium Support

Consuming TMS Service

Hi,

I am using the ThinkGeo Desktop Edition, we are trying to connect to a MapProxy TMS service so that we can display the tiles on the map.

So far I have not been able to do this, is there some sample code for the Desktop Edition which will point us in the right direction?

The MapProxy TMS service documentation can be found here: https://mapproxy.org/docs/1.0.0/services.html

Kind Regards
Dan

Hi Dan,

I suggest you contact our sales for Professional service about that.

Because we only support WMS and WMTS but don’t have existing layer for TMS. If you want to implement that, you should want to write a group of custom classes which is similar with our WmtsLayer/WmtsTiledOverlay/WmsOverlay, you should want to inherit from our base class to do something like cut the tile, request from remote server and split them into map.

In our wiki you can find many samples here http://wiki.thinkgeo.com/wiki/map_suite_desktop_edition_all_samples, maybe some of them is help you to implement that, and if you met some detail tech question when write code, you can come to ask us.

Wish that’s helpful.

Regards,

Don

Don,

Thank you

Dan

Hi Dan,

Any question please let us know.

Regards,

Don

Hi Don,

I’ve been trying to connect to the WMS service however I keep getting the following error message:

This CRS is not supported in the Wms server: http://10.170.1.110:5588/service?

bei ThinkGeo.MapSuite.Core.x6d719af406ea4c2c.xefb05224bd7f87dd(String x1a92a4424217edab, Collection1 x17bbdd0be5bc567b, String x8d726fd517275dcd) bei ThinkGeo.MapSuite.Core.TiledWmsRasterSource.GetImageCore(RectangleShape worldExtent, Int32 canvasWidth, Int32 canvasHeight) bei ThinkGeo.MapSuite.Core.RasterSource.GetImage(RectangleShape worldExtent, Int32 canvasWidth, Int32 canvasHeight) bei ThinkGeo.MapSuite.Core.TiledWmsLayer.DrawImage(GeoCanvas canvas) bei ThinkGeo.MapSuite.Core.TiledWmsLayer.DrawCore(GeoCanvas canvas, Collection1 labelsInAllLayers)
bei ThinkGeo.MapSuite.Core.Layer.Draw(GeoCanvas canvas, Collection1 labelsInAllLayers) bei ThinkGeo.MapSuite.DesktopEdition.LayerOverlay.DrawCore(GeoCanvas canvas) bei ThinkGeo.MapSuite.DesktopEdition.Overlay.MainDraw(GeoCanvas canvas) bei ThinkGeo.MapSuite.DesktopEdition.Overlay.Draw(GeoCanvas canvas) bei ThinkGeo.MapSuite.DesktopEdition.WinformsMap.x03e3d48bcfe7bb6c(IEnumerable1 xa6f0db4f183189f1)
bei ThinkGeo.MapSuite.DesktopEdition.WinformsMap.xff5b27c00f9678c2(RectangleShape x178b193eec228e6e)
bei ThinkGeo.MapSuite.DesktopEdition.WinformsMap.xe3cee4adb9c72451()
bei ThinkGeo.MapSuite.DesktopEdition.WinformsMap.x9ac8c50f434f4b39(Int32 xb565f4681f05557a)
bei ThinkGeo.MapSuite.DesktopEdition.WinformsMap.Refresh()
bei ServiceEditionSample.Form1.button1_Click(Object sender, EventArgs e)

I have tried the following Crs / Srs settings:

<SRS>EPSG:900913</SRS>
<SRS>EPSG:4326</SRS>
<SRS>EPSG:4258</SRS>
<SRS>CRS:84</SRS>
<SRS>EPSG:3857</SRS>

However none of these seem to be working.

Here are the capabilities:

service.xml (3.5 KB)

Kind Regards
Dan

Hi Dan,

As below is the test code and test link, I cannot open the tile image also, it shows this exception: “The operation has timed out”

But I hadn’t found any problem from this link, I think maybe you can contact the wms owner for double check whether the request url missed any important parameter, if you can find any sample link which should be helpful.

        Map1.MapUnit = GeographyUnit.DecimalDegree;

        WmsOverlay wmsOverlay = new WmsOverlay(new System.Uri("http://10.170.1.110:5588/service?"));
        wmsOverlay.SendingWebRequest += WmsOverlay_SendingWebRequest;

        wmsOverlay.TileHeight = 256;
        wmsOverlay.TileWidth = 256;

        wmsOverlay.Parameters.Add("FORMAT", "image/png");
        wmsOverlay.Parameters.Add("SRS", "EPSG:4326");
        wmsOverlay.Parameters.Add("VERSION", "1.1.1");
        wmsOverlay.Parameters.Add("layers", "basemap_layer");
        wmsOverlay.Parameters.Add("SERVICE", "WMS");
        wmsOverlay.Parameters.Add("EXCEPTIONS", "application/vnd.ogc.se_inimage");

        Map1.CurrentExtent = new RectangleShape(-180, 85, 180, -85);

        Map1.Overlays.Add(wmsOverlay);

http://10.170.1.110:5588/service?BBOX=-45,45,-33.75,56.25&EXCEPTIONS=application/vnd.ogc.se_inimage&FORMAT=image/png&HEIGHT=256&layers=basemap_layer&REQUEST=GetMap&SERVICE=WMS&SRS=EPSG:4326&VERSION=1.1.1&WIDTH=256

Regards,

Don

Hi Don,

Thanks for this - apologies the service is not public and you must be on the network to access it, I should have explained that.

Is the same possible using the TiledWmsOverlay class? We are using the Desktop Edition and it looks like WmsOverlay is only usable in the webedition?

Kind Regards
Dan

Hi Dan,

Yes you can use the TiledWmsOverlay for desktop edition.

And please use the event SendingWebRequest to adjust the sending request and modify the parameter.

Regards,

Don

Thanks Don.

That worked, I had to upgrade to version 9… then it worked.

Kind Regards
Dan

Hi Dan,

I am glad to hear that works.

Our new 10.0 is very different with all the previous 9 versions, maybe you want to try our 10.0 so get the latest code.

Regards,

Don