pre-release version 0.9 (September, 2001)
© Pedro Pereira Gonçalves (pedro@inovagis.org)
| ||||||||||||||||||||||
|
When making a WMS request is sometimes quite anoying that the entire web page is reloaded. It is possible to avoid this by using a simple javascript function that will use the image property SRC to dynamically change the image location. For that it is necessary to create a javascript function that receives the new input paremeters and constructs the new GETMap URL. In this example a function called UpdateURL was created with the following interface: function UpdateURL (x1, y1, x2, y2, styles) The x1, y1, x2, and y2 parameters are the new BBOX location to the requested map, while the sytles is the new OGC style requested for the map created. In this function it is first necessary to construct the newURL and then applied it to the image SRC tag. Please notice that for this last operation is advised that you name your IMG, something like this <img border=1 name="MAP" width="300" height="150" src=" ... If not you can always use the image document array. The source code for this function is : function UpdateURL (x1, y1, x2, y2, styles) { var newUrl = "/GIServer/map.exe?REQUEST=GETMAP&LAYERS=TERRA.BORDERS&"; newUrl = newUrl + "BBOX=" + x1 + "," + y1 + "," + x2 + "," + y2; newUrl = newUrl + "&SRS=EPSG:4326&WIDTH=300&HEIGHT=150&STYLES="+ styles; document.MAP.src = newUrl; } Regarding the STYLES parameter the GIServer will transform this style into GIServer parameters. This is done because in the TERRA.BORDERS alias is registered the style COUNTRIES with the following parameters:
| ||||||||||||||||||||||
|
|