Ejemplo n.º 1
0
        ////////////////////////////////////////////////////////////////////////////
        //--------------------------------- REVISIONS ------------------------------
        // Date       Name                 Tracking #         Description
        // ---------  -------------------  -------------      ----------------------
        // 21JUN2009  James Shen                              Initial Creation
        ////////////////////////////////////////////////////////////////////////////

        /**
         * get all records based on given rectangle.
         * @param rectGeo the boundary..
         * @return a hashtable array Contains of all matched record.
         *  the key is the mapInfo ID. the value is the MBR of map object.
         * @
         */
        public Hashtable[] Search(GeoLatLngBounds rectGeo)
        {
            lock (_mapFeatureLayers)
            {
                Hashtable[] retTable = new Hashtable[_mapFeatureLayers.Count];
                GeoLatLng   pt1      = new GeoLatLng(rectGeo.Y, rectGeo.X);
                GeoLatLng   pt2      = new GeoLatLng(rectGeo.Y + rectGeo.Height,
                                                     rectGeo.X + rectGeo.Width);
                double distance = GeoLatLng.Distance(pt1, pt2);

                if (_mapUnit == MAPUNIT_MILE)
                {
                    distance /= 1.632;
                }

                for (int i = 0; i < _mapFeatureLayers.Count; i++)
                {
                    MapFeatureLayer mapLayer = (MapFeatureLayer)_mapFeatureLayers[i];
                    if (mapLayer.CanBeShown(distance))
                    {
                        retTable[i] = mapLayer.Search(rectGeo);
                    }
                    else
                    {
                        retTable[i] = new Hashtable();
                    }
                }
                return(retTable);
            }
        }
Ejemplo n.º 2
0
        ////////////////////////////////////////////////////////////////////////////
        //--------------------------------- REVISIONS ------------------------------
        // Date       Name                 Tracking #         Description
        // ---------  -------------------  -------------      ----------------------
        // 21JUN2009  James Shen                              Initial Creation
        ////////////////////////////////////////////////////////////////////////////

        /**
         * get all records based on given rectangle in give map layer.
         * @param index the index of given map layer.
         * @param rectGeo the boundary..
         * @return a hashtable of all matched record.the key is the mapInfo ID.
         * @
         */
        public Hashtable Search(int index, GeoLatLngBounds rectGeo)
        {
            lock (_mapFeatureLayers)
            {
                MapFeatureLayer mapLayer = GetMapFeatureLayer(index);
                if (mapLayer != null)
                {
                    return(mapLayer.Search(rectGeo));
                }
                return(null);
            }
        }
Ejemplo n.º 3
0
        ////////////////////////////////////////////////////////////////////////////
        //--------------------------------- REVISIONS ------------------------------
        // Date       Name                 Tracking #         Description
        // ---------  -------------------  -------------      ----------------------
        // 21JUN2009  James Shen                              Initial Creation
        ////////////////////////////////////////////////////////////////////////////

        /**
         * get all records based on search condition  in give map layer.
         * @param index the index of given map layer.
         * @param findConditions the search condition.
         * @return a hashtable of all matched record.the key is the mapInfo ID.
         * @
         */
        public Hashtable Search(int index, FindConditions findConditions)
        {
            lock (_mapFeatureLayers)
            {
                MapFeatureLayer mapLayer = GetMapFeatureLayer(index);
                if (mapLayer != null)
                {
                    return(mapLayer.Search(findConditions));
                }

                return(null);
            }
        }
Ejemplo n.º 4
0
        ////////////////////////////////////////////////////////////////////////////
        //--------------------------------- REVISIONS ------------------------------
        // Date       Name                 Tracking #         Description
        // ---------  -------------------  -------------      ----------------------
        // 21JUN2009  James Shen                              Initial Creation
        ////////////////////////////////////////////////////////////////////////////

        /**
         * get all records based on given string. the seach will search based on
         * map layer's key field.
         * @param matchString
         * @return a hashtable array Contains of all matched record.
         *  the key is the mapInfo ID. the value is the matched string.
         * @
         */
        public Hashtable[] Search(string matchString)
        {
            lock (_mapFeatureLayers)
            {
                Hashtable[] retTable = new Hashtable[_mapFeatureLayers.Count];
                for (int i = 0; i < _mapFeatureLayers.Count; i++)
                {
                    MapFeatureLayer mapLayer       = (MapFeatureLayer)_mapFeatureLayers[i];
                    FindConditions  findConditions = new FindConditions();
                    findConditions.AddCondition(mapLayer.DataTable.GetFieldIndex(mapLayer.KeyField.GetName()), matchString);
                    retTable[i] = mapLayer.Search(findConditions);
                }
                return(retTable);
            }
        }