[OpenMap Users] Newbie with question on OMGraphicHandlerLayer.filter()

From: Julie Tittler <tittlers@rcn.com>
Date: Wed Jun 11 2003 - 08:51:26 EDT

I can't seem to get this function to return any hits to me, even when I
know some exist because I can see the hits on the map. Here's the problem
I'm trying to solve:

I have a 0.5 mi radius zone around some buildings in my map. Users can
create these zones. They are OMGraphics. I'm trying to write code to return
a list of buildings, OMPolys in their own layer, which fall within the
selected zone. It seems to me that the easiest way to do this is to use the
filter function. Below is a snippet of my code. I'm really not sure why
this doesn't work. Do I need to setup the OMGraphicHandlerLayer to be able
to use filters or something? Any ideas would be greatly appreciated.

NOTE: The zone polys lives in a different layer than the buildings.

/////////////////
// CODE SNIPPET
/////////////////
  public Vector getFacilitiesInPoly(OMGraphic poly)
  {
    if(poly == null)
      return null;

    //The super class is a OMGraphicHandlerLayer.
    OMGraphicList facs = super.filter(poly.getShape(), true);
    if(facs == null)
      return null;

    int index;
    int size = facs.size();
    if(size <= 0)
      return null; <--------- //I always get this point. //I never get
any hits, even though the ellipse
                                //clearly is overlaying some buildings on
the map.

    OMGraphic bldg = null;
    Vector facIDs = new Vector();

    for(index = 0; index < size; index++)
    {
      bldg = facs.getOMGraphicAt(index);
      if(bldg == null)
        continue;
      else
        facIDs.add(((FacilityData)bldg.getAppObject()).m_sID);
    }

    super.resetFiltering(); <--------- Do you need to do this so the filter
doesn't affect the map?
    return facIDs;
  }
//
/////////////////

Thank you,
Julie Tittler

-- 
 
--
[To unsubscribe to this list send an email to "majdart@bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Wed Jun 11 08:52:39 2003

This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:35 EDT