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
Solved! Go to Solution.
Maybe, in my case is to disable click...
Can I do it?
Naty
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.
Maybe it happens because I customized the file:
PopUpRendererSkin.mxml?
But Can I disable the click in the features found of the querywidget?
Naty
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?
No, it is not a part of my map before I open the query widget...
Naty,
OK where in your code are you setting the popup to use your custom PopUpRendererSkin?
Robert,
I just added the original src file of ESRI PopUpRendererSkin.mxml in the folder: myproject/src/com/esri/ags and I customized it..
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);
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 ...?
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?...