Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I've got an ExtJs combobox next to the map with several points of the map that are provided from a Postgis database through Php/XmlHttprequest.

At the same time I've got a map with all points containing their respective attributes.

I need to select a point from the list and then this point must be searched on the map an centered on it.

Can somebody tell me which is the best way to proceed with this case? Relating combobox valuefield with map feature id maybe? Retrieving coordinates directly from database and centering the map on this coordinates?

Thank you

share|improve this question
add comment

1 Answer 1

The best is to get the geometry from the database and use that to center the point in the map. To center it you need to do:

var pointCenter = new OpenLayers.LonLat(//here the way you get the geometry);
map.setCenter(pointCenter);

If you have a combo box, you could use a function in a handler to call some urls pointing to your php script, or simply add that combo to a geoext formpanel or featurestore to get the geometry data.

Hope this helps,

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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