Ejemplo n.º 1
0
        public string GetAddressByGeo(float lat, float lng)
        {
            string result;

            try
            {
                using (BAGPS.gis BAgis = new BAGPS.gis())
                {
                    BAGPS.GSAuthenticationHeader auth = new BAGPS.GSAuthenticationHeader();
                    auth.Username = "******";
                    auth.Password = "******";
                    BAgis.GSAuthenticationHeaderValue = auth;
                    BAGPS.GSAddressResult rs = BAgis.GetAddressByGeo(lng, lat, "vn");

                    result = String.Format("{0},{1},{2}", rs.Road, rs.District, rs.Province);
                    if (rs.Building > 0)
                    {
                        result = string.Format("{0},{1}", rs.Building, result);
                    }
                    return(result);
                }
            }
            catch (Exception ex)
            {
                return("*");
            }
        }
Ejemplo n.º 2
0
        public string GetGeobyAddressBA_HN(string address)
        {
            string result;

            try
            {
                using (BAGPS.gis BAgis = new BAGPS.gis())
                {
                    BAGPS.GSAuthenticationHeader auth = new BAGPS.GSAuthenticationHeader();
                    auth.Username = "******";
                    auth.Password = "******";
                    BAgis.GSAuthenticationHeaderValue = auth;
                    BAGPS.GSAddressResult rs = BAgis.GetGeoByNameHaNoi(address, "vn");
                    result = String.Format("{0} {1}", rs.Lat, rs.Lng);
                    return(result.Replace(",", "."));
                }
            }
            catch (Exception ex)
            {
                return("*");
            }
        }