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


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);

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,

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.