Geospatial ‚Äď Actualit√©s

MapFish: interaction between client and server

26 février 2009

I just received a question regarding the communciation between MapFish client and MapFish server. As I gave an answer in french, here is one in english ūüėČ
MapFish provides a MapSearcher class for querying a map. I will use this sample to describe it’s usage (source code can be accessed here).

Let’s try to see how it works: the information function “i” located in the toolbar lets the user select some features and show them in a grid.

On the server side, it is needed to have an implemation of the MapFish protocol which will interact with the database. See the code.

On the client side (all the code can be found in search.html) you need:

  1. to use the MapFish protocol with “protocol = mapfish.Protocol.decorateProtocol({…
  2. to create a Map searcher: “var mapSearcher = new mapfish.Searcher.Map({…” which will use the protocol
  3. to add the “i” button in the toolbar: “toolbar.addControl(mapSearcher, {…
  4. to create a grid “new Ext.grid.GridPanel({…”, a store “var store = new{…” and a store mediator “var searchStoreMediator = new{…” to show the result provided by the MapFish protocol in a grid.

Laisser un commentaire

Votre adresse de messagerie ne sera pas publiée. Les champs obligatoires sont indiqués avec *

4 commentaires

  1. Cédric@camptocamp dit :

    This is the URL of the REST protocoll developped on the server side.
    Maybe a question send to the mailing list would help you to get a good support.

  2. Anonymous dit :

    I want to use the searcher in my client, too.

    But I've got one problem:
    In this example a protocol is created.
    protocol: new mapfish.Protocol.MapFish({
    url: mapfish.SERVER_BASE_URL + 'summits',

    What kind of URL do I have to add, that the searcher works with my client, too?

  3. yvesm dit :

    Where’s the French version ūüėČ ?