Search Widget Highlights but layer is still off

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Search Widget Highlights but layer is still off

GordonL
Hi All,
it always bugged me that the Search widget highlights the "off" layer after a search.  

A code tweak to ensure the layer is turned on and all parent Folders it might be in.

In the /fusion/widgets/search/ folder, the Search.php around line 84:
change
if($layer->GetName() == $layerName)
    break;

to:


if($layer->GetName() == $layerName)
                        {
                                $layer->SetVisible(true);
                                $layer->ForceRefresh();
                                $currentGroup = $layer->GetGroup();
                                while ($currentGroup)
                                {
                                        $currentGroup->SetVisible(true);
                                        $currentGroup->SetDisplayInLegend(1);
                                        $currentGroup->SetExpandInLegend(1);
                                        $currentGroup = $currentGroup->GetGroup();
                                }  
                               
                                $map->Save();
                                break;
                        }


Now when you use the search widget, the layer turns on and all the groups it might be in turn on too.


Next Fix:  Since the MapMenu widget can put a map in that does not have the Search widgets layer definition, you will get an error.  
So, since the widget knows the path of the layer, why not add it to the top of the legend in the session so the Search Widget works without erroring out... I'll work on that soon.

Reply | Threaded
Open this post in threaded view
|

Re: Search Widget Highlights but layer is still off

loic
Hi Gordon,

Thanks for sharing. It works well ;-)
Reply | Threaded
Open this post in threaded view
|

Re: Search Widget Highlights but layer is still off

Jackie Ng
In reply to this post by GordonL
Hi Gordon,

I've noticed you've offered several fusion fixes like this in the past.

Can you provide svn diff patches for these changes? It will make it easier for me to integrate into Fusion proper.

- Jackie
Reply | Threaded
Open this post in threaded view
|

Re: Search Widget Highlights but layer is still off

GordonL
Sure Jackie, I will put it in asap.

gordon