Ejemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text.Trim().Equals(string.Empty))
            {
                MessageBox.Show("Lütfen bir adres giriniz!");
                return;
            }

            string address      = textBox1.Text.Trim();
            string fixedAddress = FixAddress(address);

            AddressLevel  addressLevel = tokenizer.ParseAddress(fixedAddress);
            List <string> list         = tokenizer.NotParsedList;

            list = geocoder.CheckForCity(list, ref addressLevel);

            if (!addressLevel.Il.Equals(string.Empty))
            {
                list = geocoder.CheckForTown(list, ref addressLevel);
            }

            addressLevel = geocoder.Geocode(addressLevel);

            FillScreen(addressLevel);
        }
Ejemplo n.º 2
0
        public AddressLevel Geocode(string address)
        {
            string fixedAddress = Fixer.Prepare(address);

            AddressLevel  addressLevel = tokenizer.ParseAddress(fixedAddress);
            List <string> list         = tokenizer.NotParsedList;

            list = geocoder.CheckForCity(list, ref addressLevel);

            if (!addressLevel.Il.Equals(string.Empty))
            {
                list = geocoder.CheckForTown(list, ref addressLevel);
            }

            addressLevel = geocoder.Geocode(addressLevel);

            return(addressLevel);
        }