[Cartoweb-users] customize query tool and new tool in general

karsten vennemann karsten at terragis.net
Fri Nov 23 03:10:22 EST 2007


Hi all,
I'm working on customizing the tools for my cartoweb3.4 project. I started
off with the CartoWeb3 Demo and added my data and metadata for the layers I
wanted to enable queries for. However, with this projects template/set-up
the queries always seem to run onto all layers - no matter whether I check
the "query all layers" checkbox. Thus I usually get an error since some of
my layers (which I didn't configure with metadata and didn't intend to use
for queries) don't have values for
"id_attribute_string" and
"query_returned_attributes".
My goal is to have a dropdown list of all queriable layers and the user can
select the layer she wants to query, then click on the map to query by
point. Only the attributes of the user selected layer should be returned and
displayed.
My questions are
1. How and where would I start doing this modification. At this point I'm
not sure whether that functionality is readily available or need some
customization of the query/and table plugin? And as well as for the smarty
template to change the location where the results are displayed?.
2. How would I include a new tool in the template - I guess that would be a
javascript calling a php function? Is there a place where the other tools
and their js code is located?
3. I found the example below in the documentation ( 2.4.2.3. Example)-
copied below. This seems like a class I could modify to suit my need and
send a request from a new tool to ?


Cheers
Karsten


The following class implements a filter which allows to recenter on an
object while hilighting it: 

class ClientFilterIdrecenter extends ClientPlugin
                             implements FilterProvider {
                       
    public function filterPostRequest(FilterRequestModifier $request) {}
    
    public function filterGetRequest(FilterRequestModifier $request) {
        
        $id = $request->getValue('id');
        if (!is_null($id)) {
            $layer = 'grid_classhilight';
            $request->setValue('query_layer', $layer);
            $request->setValue('query_maskmode', '1');
            $request->setValue('query_select', $id);
 
            $request->setValue('id_recenter_layer', $layer);        
            $request->setValue('id_recenter_ids', $id);
        }
    }
}

 

 

Karsten 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/cartoweb-users/attachments/20071123/0787d5a8/attachment.html


More information about the Cartoweb-users mailing list