Select to view content in your preferred language

Flexviewer3.4 would like clear result graphic after zoom?

1327
8
09-04-2013 05:16 AM
haThach
Regular Contributor
Hi,

Can anyone point me to the right direction? I am using a regular search widget 3.4, where do I go about clearing the result graphic polygon layer when I hover over the result, click once to zoom to extent, then clear or fade away the result graphic.

[ATTACH=CONFIG]27194[/ATTACH]
Tags (2)
0 Kudos
8 Replies
RobertScheitlin__GISP
MVP Emeritus
ha Thach,

   Clicking the little trash can icon clears the graphic and results. There is nothing built in for what you are asking for.
0 Kudos
haThach
Regular Contributor
Thanks Robert,

What I really want is able to config the mxml adding a clear graphic function in an area to automatically clear the result graphic after zoom to the extent.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
ha Thach,

   As I mentioned there is NO configuration for this. You can add this capability to the code if you are working with the source code in Adobe Flash Builder though.
0 Kudos
haThach
Regular Contributor
Robert,

Yes, I'm working with the source code in Adobe Flash Builder 4.7, can you point me to a specify area in the source code. Thanks.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
ha Thach,

Here is what I would change/Add:

            private function showHighlight(params:Array):void
            {
                var searchResult:ResultItem = params[0];
                var showHighlightPoint:MapPoint = searchResult.center as MapPoint;
                var linkAlias:String = searchResult.attributes.linkAlias;

                popUpRenderer.popUpInfo = configurePopUpInfo(searchResult.attributes);
                popUpRenderer.graphic = searchResult.graphic;

                map.infoWindow.content = popUpRenderer;
                map.infoWindow.contentOwner = popUpRenderer.graphic;
                map.infoWindow.show(showHighlightPoint);
                clearTimeout(hitimer);
                hitimer = setTimeout(clearGraphics, 300);
            }
            
            private function clearGraphics():void
            {
                if (resultFeatureLayer)
                {
                    resultFeatureLayer.featureCollection = new FeatureCollection(new FeatureSet(), resultFeatureLayer.layerDetails); // empty featureset to clear
                }
            }
0 Kudos
haThach
Regular Contributor
Robert, the code work great. Once again, you are very helpful, Thank You!
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
ha Thach,

   Glad to help. Now you need to do your part and follow these instructions:

Don't forget to click the Mark as answer check on this post and to click the top arrow (promote).
Follow these steps as shown in the below graphic:

0 Kudos
RobertScheitlin__GISP
MVP Emeritus
ha Thach,

  OK you are half way there... Now just do step 1 in the graphic above
0 Kudos