ThinkGeo.com    |     Documentation    |     Premium Support

Questions on WmsLayerPlugin: BrowerCacheExpiration and GetFeatureInfo?

Hi ThinkGeo,


I have following questions on WmsLayerPlugin properties and methods


1) BrowerCacheExpiration?


I have Web app that consumes maps from our WMS server. When is BrowerCacheExpiration supposed to be used? What is the recommended value to be used ?  How to ensure browser cache cleanup when upgrading map data on WMS server?


2) GetFeatureInfo?


What is the purpose of this method? How to use it  with WorldMap Data? How is Web app going to query for feature using this method? How to make WMS layer queryable? How does tiles affect this method?

Regards,


Anil




 


Hi, Anil
The property BrowserCacheExpiration is used for making the browser cache expired after a certain timespan. It’s initialized in the default constructor of WmsLayerPlugin, and can be set in the Inherited WmsLayerPlugin classes. The default value of this property is 7 days, and as far as I can see, you can set it a little bit longer than the default value, because map data on the server side doesn’t seem to change frequently. You can set this property in the overridden GetMapConfiguaration method in your own WmsLayerPlugin(The one you’re going to implement for your own WmsLayerPlugin). When map data on WMS server is updated, to make sure the browser can get the updated map, one thing to do is to clear up the server cache on WMS server, the other thing is to delete browser cache manually in the internet explorer.
As for the GetFeatureInfo method, this method implements the WMS GetFeatureInfo operation and returns feature information depending on the request from client, it’s a standard API defined in the WMS Implementation Specification V1.1.1. To query a feature with the method, the FeatureSource of the feature has to support spatial querying, and the WmsQueryMode property need to be set to Queryable on WMS Server. The next thing to do is to generate a HttpWebRequest in such a format:
ServerAddress:Port/WmsHandler.axd?VERSION=1.1.1&SRS=EPSG:4326&WIDTH=MapWidthInPixels

&HEIGHT=MapHeightInPixels&BBOX=xMin,yMin,xMax,yMax&QUERY_LAYERS=TargetLayerName

&STYLES=DEFAULT&X=ScreenCoordinateX&Y=ScreenCoordinateY&REQUEST=GetFeatureInfo&INFO_FORMAT=text/json

After setting the parameters with corresponding values, we can query the feature specified in the URL by calling MapControl.MapTools.WmsGetFeatureInfo.HandleResponse method by passing in the HttpWebRequest object. (For now the INFO_FORMAT parameter can be set to text/html and text/json, however, text/xml option can probably raise a server side exception and we’re working intensively trying to locate and fix the potential bug, sorry for the inconvenient.)
 
Further questions please let us know.
 
Thanks!