I am new to web programming here. I have a table which has multiple columns including: Restaurant Name,Restaurant Id, Lat, Lon, City, District, Country.

My requirement is to build a web client using OpenLayers and JavaScript and allow users to search a Restaurant. I am using GeoServer to create a layer from this table.

My problem is : I have to add dropdowns i.e. one for country, another for District /City based on the country selected. This city/district/country mapping has to come from the table which is in Teradata. Is there any way I can get the data to populate the dropdown from GeoServer services Or do I need to create a new service of my own. If I create my own service, can it be hosted from GeoServer.

Any inputs?

  • have you though about WFS? – Ian Turton Feb 21 '13 at 9:11
  • I will check some examples to see if wfs with filter works. Thanks! – vyh Feb 21 '13 at 10:31

There are multiple solutions, each differing in complexity and performance:

  1. Use just OpenLayers and WFS to load the data in an array and then parse and display it yourself.

  2. Use GeoExtJS and a WFS store. Here is an example.

  3. Create your own php (or any other server side technology) services, which return just the distinct values. Call these services in your JavaScript Application, to load the values.

Personally, I feel that if you have quite a bit of data, then Option 3 is the best. But the first two options are not bad, and might be appropriate in some cases.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.