• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Running a WFS query using javascript in geoserver

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have written a simple javascript program which asks the user to enter the bounding box co-ordinates and with these co-ordinates the wfs function of getfeature needs to be run but I am getting an error message
"Bounding box coordinate is not parsable:ULX". I have no idea what this means. Here is the script:
<html>
<head>
<script>
function query() {
var ULX=document.getElementById('num1');
var ULY=document.getElementById('num2');
var LWX=document.getElementById('num3');
var LWY=document.getElementById('num4');
window.location.assign("http://localhost:8080/geoserver/wfs?VERSION=1.1.0&REQUEST=GetFeature&SERVICE=WFS&TYPENAME=tasmania_state_boundaries&crs=EPSG:4326&BoundingBox=ULX,ULY,LWX,LWY")
}
</script>
</head>
<p> Bounding Box </p>
<form>
Upper Left X Co-ordinate: <input type="text" onchange="if (/^\.?$/.test(this.value) || !/^-?\d*\.?\d*$/.test(this.value)) {alert('This field requires a Number'); this.value=''; this.focus()}" id="num1">
Upper Left Y Co-ordinate: <input type="text" onchange="if (/^\.?$/.test(this.value) || !/^-?\d*\.?\d*$/.test(this.value)) {alert('This field requires a Number'); this.value=''; this.focus()}" id="num2"><br/>
Lower Right X Co-ordinate: <input type="text" onchange="if (/^\.?$/.test(this.value) || !/^-?\d*\.?\d*$/.test(this.value)) {alert('This field requires a Number'); this.value=''; this.focus()}" id="num3">
Lower Right Y Co-ordinate: <input type="text" onchange="if (/^\.?$/.test(this.value) || !/^-?\d*\.?\d*$/.test(this.value)) {alert('This field requires a Number'); this.value=''; this.focus()}" id="num4"><br/>
<input type="button" name="Query" value="Query" onclick="query()">
</form>
</html>
 
Always look on the bright side of life. At least this ad is really tiny:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic