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); } }
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; } }
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; } }
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; }
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; }
public string GetEmbedStreeViewUrl(string location) { return(GooglePlaceService.GetStreeViewUrl(location)); }
public string GetEmbedMapUrl(string placeId) { return(GooglePlaceService.GetMapUrl(placeId)); }