Select to view content in your preferred language

add ROLL_OVER on QueryWidget

1861
20
Jump to solution
08-21-2014 03:46 AM
NatashaManzuiga
Occasional Contributor

Hi, I 'm trying to add a ROLL_OVER function on mouseovergraphic

I added this line on createQueryResults..

graphic.addEventListener(MouseEvent.ROLL_OVER, mouseOverGraphic);

and the function:

private function mouseOverGraphic(event:MouseEvent):void
    {
        var gra:Graphic = event.currentTarget as Graphic;
        var infoData:Object = gra.attributes;
           
        clearTimeout(hitimer);
        var queryResult:ResultItem = gra.attributes as ResultItem;
        if (map.extent.containsXY(queryResult.center.x, queryResult.center.y))
                // only show infowindow if query result in contained within map extent
        {
            hitimer = setTimeout(showHighlight, 300, [ queryResult ]);
        }
        else
        {
            hideInfoWindow();
        }

    }

What I'm wronging?

Naty

0 Kudos
20 Replies
NatashaManzuiga
Occasional Contributor

Maybe, in my case is to disable click...

Can I do it?

Naty

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Naty,

   What does the layer tag look like for this layer in question. It has nothing to do with the widget portion of the main config.

0 Kudos
NatashaManzuiga
Occasional Contributor

Maybe it happens because I customized the file:
PopUpRendererSkin.mxml?

But Can I disable the click in the features found of the querywidget?

Naty

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Naty,

  Is this layer a part of your map before you open the query widget? and if so does a popup appear when you click on a feature of this layer?

0 Kudos
NatashaManzuiga
Occasional Contributor

No, it is not a part of my map before I open the query widget...

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Naty,

  OK where in your code are you setting the popup to use your custom PopUpRendererSkin?

0 Kudos
NatashaManzuiga
Occasional Contributor

Robert,

I just added the original src file of ESRI  PopUpRendererSkin.mxml in the folder: myproject/src/com/esri/ags and I customized it..

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Naty,

   OK to disable the graphic click popup then just comment out this line in the createQueryResults function

graphic.infoWindowRenderer = infoWindowRenderer;

You can then add the graphic click event yourself in the createQueryResults function, just like the ROLL_OVER:

graphic.addEventListener(MouseEvent.CLICK, mouseOverGraphic);

NatashaManzuiga
Occasional Contributor

Thanks....that's perfectly fit the click event...

One strange thing still happens

If I have search widget opened and a querywidget too...if I click a feature which is of the search widget...why if I click on it...the search doesnt start ...?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Naty

why if I click on it...the search doesnt start ...?

You have me pretty confused with that question. Why would a search start if you click on a feature?... are you saying that you have the search's graphical selection tool active?...

0 Kudos