Enhanced-Search-Widget-for-FlexViewer Part III

116284
776
04-30-2013 03:58 PM
RobertScheitlin__GISP
MVP Emeritus
All,

   Here is a new thread to post questions and discuss the Enhanched Search Widget. The old thread was getting too long.
Tags (2)
776 Replies
RobertScheitlin__GISP
MVP Emeritus
Brent,

   What version are you running (hold the Alt key and click on widget title)?
0 Kudos
ErwanCaradec
New Contributor III
Hi Robert !
I'm back to FlexViewer, upgrading from 2.4 to 3.6...

About EnhancedSearch and Identify widgets, did you ever try to make the widgets config files dependent with sublayers ?

My problems :
- I have many different map configuration files which often use the same services/layers, parts of config file are often identical for a sublayer.
- The esearch config file use the layerid value, all config files have to be updated when you add/remove/move a layer in a service.
- The identify use the layer name, all config files have to be updated when a layer name change.

The idea would be to add a optional tag "widgetconfig" for sublayer tag in the main config file (this may need a MapManager modification). And if the value exists the widgets woul'd load the part of config.
<layer label="..." type="..." url="..." alpha="..." visible="...">
<sublayer id="1" popupconfig="...">
    <widgetconfig name="esearch" file="path_to_subconfigfile" />
    <widgetconfig name="identify" file="path_to_subconfigfile" />
<sublayer/>
<sublayer id=".../>
</layer>

Erwan
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Erwan,

   That sounds like a good idea but I stay away from changes to the core viewer when it comes to widgets as I don't want one of my widgets dependent on the custom recompiled viewer.
0 Kudos
BrentFoster
New Contributor II
Brent,

   What version are you running (hold the Alt key and click on widget title)?


I'm using version 3.5.2 of the esearch widget, dated 10-15-2013.  Running the 3.5 version of the Flex Viewer.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Brent,

   Because you are not using the latest version 3.6.5, all I can do is tell you where to fix the issue in code (as I don't go backwards in releases to fix bugs). I will have this fixed for the 3.6 version. Let me know if you are using the source code and I will let you know where to apply the code fix.
0 Kudos
BrentFoster
New Contributor II
Brent,

   Because you are not using the latest version 3.6.5, all I can do is tell you where to fix the issue in code (as I don't go backwards in releases to fix bugs). I will have this fixed for the 3.6 version. Let me know if you are using the source code and I will let you know where to apply the code fix.


Thanks Robert, Yes I can go in and recompile if you have the code specified for me to change.  Much thanks for your help.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Brent,

  OK, Here is the code change. In the queryFromURL function find the code block that look like this and add the red text:

                            if(searchResultAC.length > 0){
                                if(typeQ == "layer"){
                                    if(isNaN(zoomScale)){
                                        zoomAll();
                                    }else{
                                        if (map.scale > zoomScale){
                                            map.scale = zoomScale;
                                        }
                                        map.centerAt(searchResultAC[0].point);
                                    }
                                }
                                if(ViewerContainer.urlConfigParams.showdatagrid != null){
                                    if(ViewerContainer.urlConfigParams.showdatagrid == "true" && floatorfixed == "float"){
                                        showGridResults();
                                    }
                                }
                            }
0 Kudos
JamesFaron
Occasional Contributor
Robert,

I am upgrading from an earlier version of your widget, and I am encountering a problem with the graphic not showing at all zoom levels. The reason is that the layer in question is part of a tiled basemap that has several group layers that have min and max scales in the parent layers. For example, the layer that I am using in the xml is https://myserver/arcgis/rest/services/Maps/BaseMap/MapServer/110. That layer has a parent layer with a min and max scale (the layer itself does not have a min or max scale, i.e. it is type Feature Layer). In the older versions of the eSearch Widget, the search result graphic was I believe added to a graphics layer, which was added to the map, thus it appeared at all scales.

Could you give me a pointer as to what I may be able to do to get the graphic to not be bound by the min and max scale of its parent layer? The rest service is behind a firewall. I attached a screen shot of the service, where layer 110 is the Feature Layer that is being queried in the widget, and layer 107 is the group layer that has the min and max scale that is limiting the graphic's visibility.

Thanks,
Jim Faron
Katy Independent School District
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
James,

   Sure you just need to set the removeserchlayersminmaxscale attribute in the eSearchWidget.xml (you probabbly don't have it in your old version of the XML, That is why it is always best to take the current version of the XML and add your layers to it).
0 Kudos
JamesFaron
Occasional Contributor
Robert,

Wow, I sure missed that. Amazing stuff, as usual.

Thanks!

Jim Faron
0 Kudos