[Cartoweb-users] colored result from search action

Oliver Christen oliver.christen at camptocamp.com
Wed Sep 26 08:58:33 EDT 2007


look at the source of your page in your browser and see if you have the 
<input type="hidden" id="locate1" /> element.
if not, then
1) be sure you have modified the correct file. If you have personalized the 
template, it will be in /projects/*yourproject*/plugins/locate/template
2) be sure you have cleared the cache with "php cw3setup.php --clean" in 
command-line

I tried the modification on the demoPlugins project so it must work.

regards
Oliver

>
> So...
> I've implemented your changes in locate.tpl with no success
>
> I changed name of function in this file:
> afunction slocate(input_element, item) {
> But no error is present.
>
> ...it seems that file is not used with idrecentering.
> stefan
>
>
> Oliver Christen wrote:
>>
>> Hi
>>
>> hilighting of feature is only possible with filter (parameters) via query
>> http://www.cartoweb.org/doc_head/docbook/xhtml/dev.newplugin.html#dev.newplugin.special.filters
>>
>> so you need to pass the additional parameters:
>> query_layer=*layer name*
>> query_select=*feature id*
>> query_hilight=1
>> query_return_table=0
>> and
>> layer_select=*layer name*
>>
>> in locate.tpl, you have:
>>     document.forms['carto_form'].id_recenter_layer.value =
>> input_element.alt;
>>     document.forms['carto_form'].id_recenter_ids.value = item.id;
>>
>> right there, add:
>>     var l1 = $('locate1');
>>     var l2 = $('locate2');
>>     var l3 = $('locate3');
>>     var l4 = $('locate4');
>>     var l5 = $('locate5');
>>
>>     l1.name = 'query_layer';
>>     l1.value = input_element.alt;
>>     l2.name = 'query_select';
>>     l2.value = item.id;
>>     l3.name = 'query_hilight';
>>     l3.value = 1;
>>     l4.name = 'query_return_table';
>>     l4.value = 0;
>>     l5.name = 'layer_select';
>>     l5.value = input_element.alt;
>>
>> and at the end, add:
>>
>> <input type="hidden" id="locate1" />
>> <input type="hidden" id="locate2" />
>> <input type="hidden" id="locate3" />
>> <input type="hidden" id="locate4" />
>> <input type="hidden" id="locate5" />
>>
>> clean your cache and try again
>>
>> maybe there is a nicer way to do that but it works and that was quick to
>> do
>>
>> regards
>> Oliver
>>
>>
>>>
>>> How can I get searched element by locate plugin colored (highlighted)
>>> pls.?
>>> -- 
>>> View this message in context:
>>> http://www.nabble.com/colored-result-from-search-action-tf4520773.html#a12896293
>>> Sent from the cartoweb-users mailing list archive at Nabble.com.
>>>
>>> _______________________________________________
>>> Cartoweb-users mailing list
>>> Cartoweb-users at lists.maptools.org
>>> http://lists.maptools.org/mailman/listinfo/cartoweb-users
>>>
>>
>> _______________________________________________
>> Cartoweb-users mailing list
>> Cartoweb-users at lists.maptools.org
>> http://lists.maptools.org/mailman/listinfo/cartoweb-users
>>
>>
>
> -- 
> View this message in context: 
> http://www.nabble.com/colored-result-from-search-action-tf4520773.html#a12900275
> Sent from the cartoweb-users mailing list archive at Nabble.com.
>
> _______________________________________________
> 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