示例#1
0
        protected void btnSearch_ServerClick(object sender, EventArgs e)
        {
            string             key     = this.autocomplete.Value;
            GooglePlaceService service = new GooglePlaceService();
            TextSearch         data    = service.DoTextSearch(key);

            if (data.Status.Equals("OK"))
            {
                SetViewUrl(data);
            }
        }
示例#2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.IsPostBack)
     {
         string location = this.Request.QueryString["location"];
         if (string.IsNullOrEmpty(location))
         {
             this.streeviewFrame.Visible = false;
             return;
         }
         this.streeviewFrame.Src     = GooglePlaceService.GetStreeViewUrl(location);
         this.streeviewFrame.Visible = true;
     }
 }
示例#3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.IsPostBack)
     {
         string placeid = this.Request.QueryString["id"];
         if (string.IsNullOrEmpty(placeid))
         {
             this.mapviewFrame.Visible = false;
             return;
         }
         this.mapviewFrame.Src     = GooglePlaceService.GetMapUrl(placeid);
         this.mapviewFrame.Visible = true;
     }
 }
示例#4
0
        private void SetViewUrl(GooglePlaceService service, TextSearch result)
        {
            if (result.Results.Length == 0)
            {
                return;
            }
            this.lblLocation.Text = result.Results[0].Geometry.Location.ToString();
            this.lblPlaceId.Text  = result.Results[0].PlaceId;
            var detail = service.GetDetail(result.Results[0].PlaceId);

            string url = detail.Result.Url;

            this.lnkMap.NavigateUrl = this.lnkMap.Text = url;
            this.content.Visible    = true;
        }
示例#5
0
        private void SetViewUrl(TextSearch result)
        {
            if (result.Results.Length == 0)
            {
                return;
            }
            this.map.Src          = GooglePlaceService.GetMapUrl(result);
            this.streeview.Src    = GooglePlaceService.GetStreeViewUrl(result);
            this.lblLocation.Text = result.Results[0].Geometry.Location.ToString();
            this.lblPlaceId.Text  = result.Results[0].PlaceId;
            string url = "mapview.aspx?id=" + result.Results[0].PlaceId;

            this.lnkMap.NavigateUrl = this.lnkMap.Text = url;
            url = "streeview.aspx?location=" + result.Results[0].Geometry.Location.ToString();
            this.lnkStreeView.NavigateUrl = this.lnkStreeView.Text = url;
            this.content.Visible          = true;
        }
示例#6
0
 public string GetEmbedStreeViewUrl(string location)
 {
     return(GooglePlaceService.GetStreeViewUrl(location));
 }
示例#7
0
 public string GetEmbedMapUrl(string placeId)
 {
     return(GooglePlaceService.GetMapUrl(placeId));
 }