Download "user manual"
Transcript
Search 23. Search 23.1. Introduction The search plugin aim is to offer standards search features (like recentering, result offset, guided search, ajax features...) in a generic way. Take note that in his current state the plugin only offers a server framework. There is not yet any generic JavaScript framework. Warning The following examples only work with AJAX mode on ! 23.2. Basic Usage Introduction 23.2.1. General Considerations The search plugin must be activated on both CartoClient and CartoServer side ie. the loadPlugins parameter must contain search in your project client_conf/ client.ini and server_conf/<mapId>/<mapId>.ini. Search use is mainly based on three files. client_conf/search.ini , plugins/ search/htdocs/js/Search.ajax.js and plugins/search/templates/ search.tpl. The search plugin uses the PEAR DB abstraction class and should be able to handle all databases supported by PEAR DB. 23.3. Basic Sample 23.3.1. Basic Mechanism and Setup The data set and the query specification are set in the search.ini file. The design and the fields of the search form is set in the search.tpl file. The search behavior mainly reside in the Search.ajax.js. Let's imagine that we want to do a search with a recenter on data that are represented on a layer Addresses. The source of the data is a table in a PostGIS database. 135