Select to view content in your preferred language

onMouse over Map graphics highlights map color and item in table

3005
0
06-04-2010 01:30 PM
eddiequinlan
Deactivated User
Hi everyone,

The code I was using in 1.3 I'm now in the process of moving over to 2.0. 
I've got 99% of it working properly except for the following:

I have 2 options for the user to select parcels: 
    1) by Name ie a where clause query
or
    2) by buffering a user created graphic (ie line, poly, etc)

Both options work fine; they display the parcels correctly on the map, list in my table, and show the graphic buffer.

I have set up the mouse over map/mouse over item functions to highlight the info in the table and/or over the map.
The functions work fine for the results returned by the Name search, but I cannot figure out why it won't work for
the buffered results.

The item highlight over the table works fine and shows the correct parcel on the map, but moving the mouse over the map returns nothing.   I know it's something simple, but I need help.  I've attached the code for both queries.  Any ideas are appreciated.



******* where clause query is run which returns valid results. They are displayed
  on the map and in the new table.


AttrbQueryTask.execute(queryAttrb, new AsyncResponder(onResult, onFault));
   
   
function onResult(featureSet:FeatureSet, token:Object = null ):void
{
if (featureSet.features.length >= 1)
{
  myGraphicsLayer.clear();
  for each (var myGraphic:Graphic in featureSet.features )
  {
   resultAttribs = myGraphic.attributes;
   var featuresRec:ArrayCollection = new ArrayCollection();
   featuresRec.addItem(resultAttribs);
   myGraphic.symbol = FeatSetSymbol;

   myGraphic.addEventListener(MouseEvent.ROLL_OVER, onMouseOverMap);
   myGraphic.addEventListener(MouseEvent.ROLL_OUT, onMouseOutMap);
   myGraphicsLayer.add(myGraphic);
      
   html_display = "<b>" + featureSet.features.length + "</b>  parcels found matching  " +TextSrchInput;
  }





******** before AttrbQueryTask, a buffer polygon is created, which then selects the intersecting
  parcels.
The parcels are displayed and my table is created with the correct data.



AttrbQueryTask.execute(MailingQuery, new AsyncResponder(Mail_Result, onFault));
     
     
// =================== Create mailing list ========================
     
function Mail_Result( featureSet:FeatureSet, token:Object = null ):void
     
{                 
  if (featureSet.features.length > 0)
  {
       
   for each (var myGraphic:Graphic in featureSet.features)
   {
    resultAttribs = myGraphic.attributes;
    Alert.show(myGraphic.attributes['PATPCL_PIN'].toString()); //loop works; it returns attribute and graphics.
       
    var featuresRec:ArrayCollection = new ArrayCollection();
    featuresRec.addItem(resultAttribs);
       
    myGraphic.autoMoveToTop=true;
    myGraphic.symbol = FeatSetSymbol;
    myGraphicsLayer.add(myGraphic);
        
    myGraphic.addEventListener(MouseEvent.ROLL_OVER, onMouseOverMap);
    myGraphic.addEventListener(MouseEvent.ROLL_OUT, onMouseOutMap);

   }

Sincerely,
Eddie
Tags (2)
0 Kudos
0 Replies