[Cartoweb-users] How to relocate map after search?

Oliver Christen oliver.christen at camptocamp.com
Tue Sep 25 08:57:56 EDT 2007


I dont think you can trigger the recentering at that stage. The server side 
has been already called and the map generated, its too late in the workflow 
already.
You must display the result and then trigger the recentering via javascript 
when parsing the result: if only one result->trigger recenter.
There are example of recenter function in the documentation
http://www.cartoweb.org/doc/cw3.4/xhtml/user.search.html#user.search.sample.basic
all you need is to parse the result and trigger the function in 
Search.ajax.js in function handleResponse

regards
Oliver

> Hello,
>
> I am using the search plugin to find addresses. After the search is 
> executed, I would like to relocate the map automatically to one of the 
> query results. The query returns the coordinates in two fields, which I 
> can read in the ...ResultProvider.getResult() method. My question is: How 
> do I trigger the relocation from there?
>
> Thanks,
> Dirk
>
>
> _______________________________________________
> Cartoweb-users mailing list
> Cartoweb-users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/cartoweb-users
> 



More information about the Cartoweb-users mailing list