This project is read-only.

WMS map network server

Aug 20, 2009 at 4:21 PM

Hi, first of all I want to thank you for this very high quality piece of software.

I'm evaluating to use it as the main navigation component of a GIS-like software package. Right now I'm in the prototyping stage.

I need some help to create a WMS (Web Map Service) NetworkServer; I know that I need to overwrite the CreateRequestUri method to provide my server's url, but the issue is that I don't know how to get the data needed in the url from the index parameter. A tipical WMS url looks like this:

http://localhost:60048/wms.ashx?STYLES=&VERSION=1.3.0&SERVICE=WMS&REQUEST=GetMap&BBOX=-89.999872,-89.999872,-44.999936,-44.999936&FORMAT=image/png&WIDTH=256&HEIGHT=256&CRS=EPSG:4326&layers=base

So, basically I need to get the bounding box of the requested tile... How can achieve this?

Thanks in advance.

Regards,

Germán Schuager

Aug 20, 2009 at 5:09 PM

Hi again,

I've solved my problem...

I've created a dependency property called TileProvider in my WmsNetworkServer class and set it through binding in XAML, something like this:

 

            <d3:Map Name="map">
                <demo4:WmsNetworkServer TileProvider="{Binding Path=TileProvider, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type d3:Map}}}"  />
            </d3:Map>

            <d3:Map Name="map">

                <demo4:WmsNetworkServer TileProvider="{Binding Path=TileProvider, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type d3:Map}}}"  />

            </d3:Map>

then, in the override of CreateRequestUri I've done the following to get the tile bounding box:

var bounds = TileProvider.GetBounds(index);

If there is a better method to solve this please let me know.

 

Aug 21, 2009 at 1:33 PM
Edited Aug 21, 2009 at 1:35 PM

Hi Germán,

 

I think code can be a little more simple - you can create your in C#, and have a ctor of WmsNetworkServer with Map as an argument, or with TileProvider as an argument.

And then you can set map's NetworkTileServer property to your server.

But your solution is acceptable, if it solves what it should solve)

 

TileProvider is certainly that thing that should be used to get bounds of tile, so your solution is right.

 

Regards,

Mikhail Brinchuk.