Пример #1
0
        ///////////////////////////////////////////////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////
        /// <summary>
        /// Initialize geocoder.
        /// </summary>
        private void _InitGeocoder()
        {
            string serviceURL = _geocodingServiceInfo.Url;
            _client = new GeocodeServiceClient(serviceURL,
                _geocodingServer.OpenConnection());
            _client.ReverseGeocodeCompleted += new EventHandler<ReverseGeocodeCompletedEventArgs>(_ReverseGeocodeCompleted);

            // Get locator properties.
            PropertySet propSet = _client.GetLocatorProperties();
            foreach (PropertySetProperty prop in propSet.PropertyArray)
            {
                if (prop.Key.Equals(BATCHSIZE_PROPERTY, StringComparison.OrdinalIgnoreCase))
                {
                    _maxAddressCount = (int)prop.Value;
                    break;
                }
            }

            // Get locator fields.
            _addrFields = _client.GetAddressFields();

            // Now geocoder is initialized.
            _inited = true;
        }