//////////////////////////////////////////////////////////////////////////// //--------------------------------- REVISIONS ------------------------------ // Date Name Tracking # Description // --------- ------------------- ------------- ---------------------- // 20JUN2009 James Shen Initial Creation //////////////////////////////////////////////////////////////////////////// /** * @inheritDoc */ public void GetLocations(int mapType, string address, IReverseGeocodingListener 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, IReverseGeocodingListener listener) { _listener = listener; _searchAddress = address; MapPoint mapPoint = (MapPoint)_addressCache[address]; if (mapPoint == null) { if (!_isChina) { Arg[] args = { new Arg("ll", address), new Arg("output", "js"), new Arg("oe", "utf8"), new Arg("key", _queryKey), null }; Request.Get(SEARCH_BASE, args, null, _reverseAddressQuery, this); } else { Arg[] args = { new Arg("ll", address), new Arg("output", "js"), new Arg("oe", "utf8"), null }; Request.Get(SEARCH_BASE_CHINA, args, null, _reverseAddressQuery, this); } } else { MapPoint[] mapPoints = new MapPoint[1]; mapPoints[0] = mapPoint; listener.Done(mapPoint.Name, mapPoints); } }
//////////////////////////////////////////////////////////////////////////// //--------------------------------- REVISIONS ------------------------------ // Date Name Tracking # Description // --------- ------------------- ------------- ---------------------- // 18JUN2009 James Shen Initial Creation //////////////////////////////////////////////////////////////////////////// /** * Set the listener for reverse geocoding query. * @param reverseGeocodingListener callback when query is done and in progress */ public void SetReverseGeocodingListener(IReverseGeocodingListener reverseGeocodingListener) { _digitalMapService.SetReverseGeocodingListener(reverseGeocodingListener); }
//////////////////////////////////////////////////////////////////////////// //--------------------------------- REVISIONS ------------------------------ // Date Name Tracking # Description // --------- ------------------- ------------- ---------------------- // 20JUN2009 James Shen Initial Creation //////////////////////////////////////////////////////////////////////////// /** * Set the listener for reverse geocoding query. * @param reverseGeocodingListener callback when query is done and in progress */ public void SetReverseGeocodingListener(IReverseGeocodingListener reverseGeocodingListener) { _reverseGeocodingListener = reverseGeocodingListener; }