Developers

License

* Copyright (c) 2009, Camptocamp
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the University of California, Berkeley nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

The --generate-route will update the routing.yml file for the frontend application, by adding the corresponding sfMapFishRoute.
In this example, the resulting module will be named "your_module". You may want to customize this !

Once this is done, clear your cache, and check you've got some GeoJSON data out of /index.php/your_module

This being done, you may want to have a look at MapFish client side software, which plays well with this REST API.
Just check out http://www.mapfish.org/svn/mapfish/trunk/MapFish/client/mfbase/ into your project's web/js directory, and read the doc or browse the examples ;-)

For quick CRUD operations on your data, you can take advantage of the existing mapfish.widgets.editing.FeatureEditingPanel widget, which is being showcased here.

Copy the mandatory config file from the plugin to your config directory

$ cp plugins/sfMapFishPlugin/data/print/print.yml config/print.yml

The print module should be ready & responding to /index.php/mfPrint/info to get print configuration.
Don't forget to configure the config.yml (see configuration. For instance, you should at least allow the print service to access the WMS services you're using.
The provided print.yml example fiel has 3 mandatory fields in the spec: title, comment & mapTitle.
If you're getting errors, check your symfony log file to get debug information (if enabled in your application environment).

Once this is done, you can integrate the MapFish print widgets into your client application, which give you the ability to output nice customizable PDF with your maps. Examples can be found here.

Troubleshooting: You may need to manually set the java path to get it working: