public void GetLocations(int mapType, string address, IGeocodingListener listener)
 {
     _isChina = mapType == MapType.MICROSOFTCHINA ||
                mapType == MapType.GOOGLECHINA || mapType == MapType.MAPABCCHINA;
     SetChina(_isChina);
     SetGoogleKey(GoogleQueryKeys[GoogleKeyIndex]);
     GetLocations(address, listener);
     GoogleKeyIndex++;
     GoogleKeyIndex %= 10;
 }
        ////////////////////////////////////////////////////////////////////////////
        //--------------------------------- REVISIONS ------------------------------
        // Date       Name                 Tracking #         Description
        // ---------  -------------------  -------------      ----------------------
        // 20JUN2009  James Shen                              Initial Creation
        ////////////////////////////////////////////////////////////////////////////

        /**
         * Sends a request to Google servers to geocode the specified address
         * @param address  address to query
         * @param listener callback when query is done.
         */
        public void GetLocations(string address, IGeocodingListener listener)
        {
            _listener      = listener;
            _searchAddress = address;
            MapPoint mapPoint = (MapPoint)_addressCache[address];

            if (mapPoint == null)
            {
                if (!_isChina)
                {
                    Arg[] args =
                    {
                        new Arg("q",      address),
                        new Arg("output", "json"),
                        new Arg("key",    _queryKey),
                        null
                    };
                    Request.Get(SEARCH_BASE, args, null, _addressQuery, this);
                }
                else
                {
                    Arg[] args =
                    {
                        new Arg("q",      address),
                        new Arg("output", "json"),
                        null
                    };
                    Request.Get(SEARCH_BASE_CHINA, args, null, _addressQuery, this);
                }
            }
            else
            {
                MapPoint[] mapPoints = new MapPoint[1];
                mapPoints[0] = mapPoint;
                listener.done(mapPoint.Name, mapPoints);
            }
        }
Esempio n. 3
0
        ////////////////////////////////////////////////////////////////////////////
        //--------------------------------- REVISIONS ------------------------------
        // Date       Name                 Tracking #         Description
        // ---------  -------------------  -------------      ----------------------
        // 18JUN2009  James Shen                 	          Initial Creation
        ////////////////////////////////////////////////////////////////////////////
        /**
         * Set the listener for geocoding query.
         * @param geocodingListener callback when query is done and in progress

         */
        public void SetGeocodingListener(IGeocodingListener geocodingListener)
        {
            _digitalMapService.SetGeocodingListener(geocodingListener);
        }
Esempio n. 4
0
        ////////////////////////////////////////////////////////////////////////////
        //--------------------------------- REVISIONS ------------------------------
        // Date       Name                 Tracking #         Description
        // ---------  -------------------  -------------      ----------------------
        // 20JUN2009  James Shen                              Initial Creation
        ////////////////////////////////////////////////////////////////////////////

        /**
         * Set the listener for geocoding query.
         * @param geocodingListener callback when query is done and in progress
         *
         */
        public void SetGeocodingListener(IGeocodingListener geocodingListener)
        {
            _geocodingListener = geocodingListener;
        }
 public void GetLocations(int mapType, string address, IGeocodingListener listener)
 {
     _isChina = mapType == MapType.MICROSOFTCHINA ||
             mapType == MapType.GOOGLECHINA || mapType == MapType.MAPABCCHINA;
     SetChina(_isChina);
     SetGoogleKey(GoogleQueryKeys[GoogleKeyIndex]);
     GetLocations(address, listener);
     GoogleKeyIndex++;
     GoogleKeyIndex %= 10;
 }
        ////////////////////////////////////////////////////////////////////////////
        //--------------------------------- REVISIONS ------------------------------
        // Date       Name                 Tracking #         Description
        // ---------  -------------------  -------------      ----------------------
        // 20JUN2009  James Shen                 	          Initial Creation
        ////////////////////////////////////////////////////////////////////////////
        /**
         * Sends a request to Google servers to geocode the specified address
         * @param address  address to query
         * @param listener callback when query is done.
         */
        public void GetLocations(string address, IGeocodingListener listener)
        {
            _listener = listener;
            _searchAddress = address;
            MapPoint mapPoint = (MapPoint)_addressCache[address];

            if (mapPoint == null)
            {
                if (!_isChina)
                {
                    Arg[] args = {
                    new Arg("q", address),
                    new Arg("output", "json"),
                    new Arg("key", _queryKey),
                    null
                };
                    Request.Get(SEARCH_BASE, args, null, _addressQuery, this);
                }
                else
                {
                    Arg[] args = {
                    new Arg("q", address),
                    new Arg("output", "json"),
                    null
                };
                    Request.Get(SEARCH_BASE_CHINA, args, null, _addressQuery, this);
                }
            }
            else
            {
                MapPoint[] mapPoints = new MapPoint[1];
                mapPoints[0] = mapPoint;
                listener.done(mapPoint.Name, mapPoints);
            }
        }
        ////////////////////////////////////////////////////////////////////////////
        //--------------------------------- REVISIONS ------------------------------
        // Date       Name                 Tracking #         Description
        // ---------  -------------------  -------------      ----------------------
        // 20JUN2009  James Shen                 	          Initial Creation
        ////////////////////////////////////////////////////////////////////////////
        /**
         * Set the listener for geocoding query.
         * @param geocodingListener callback when query is done and in progress

         */
        public void SetGeocodingListener(IGeocodingListener geocodingListener)
        {
            _geocodingListener = geocodingListener;
        }
Esempio n. 8
0
        ////////////////////////////////////////////////////////////////////////////
        //--------------------------------- REVISIONS ------------------------------
        // Date       Name                 Tracking #         Description
        // ---------  -------------------  -------------      ----------------------
        // 18JUN2009  James Shen                              Initial Creation
        ////////////////////////////////////////////////////////////////////////////

        /**
         * Set the listener for geocoding query.
         * @param geocodingListener callback when query is done and in progress
         *
         */
        public void SetGeocodingListener(IGeocodingListener geocodingListener)
        {
            _digitalMapService.SetGeocodingListener(geocodingListener);
        }