// Use this for initialization void Start() { if (main == null) { main = this; } if (transform.parent == null) { if (GameObject.Find("Canvas") != null) { transform.parent = GameObject.Find("Canvas").transform; } if (transform.parent == null) { if (GameObject.Find("UICanvas") != null) { transform.parent = GameObject.Find("UICanvas").transform; } } if (transform.parent == null) { print("NO CANVAS"); Destroy(gameObject); } } if (cam == null) { cam = Camera.main; } }
protected void Page_Load(object sender, EventArgs e) { //if (!IsPostBack) //{ navigatorView = new NavigatorView(); var center = new GLatLng(48.51, 10.21); Gmap1.setCenter(center, 4); var xpinLetter = new XPinLetter(PinShapes.pin_star, "C", Color.Blue, Color.White, Color.Chocolate); var location = new GLatLng(center.lat, center.lng); //Gmap1.Add(new GMarker(location, new GMarkerOptions(new GIcon(xpinLetter.ToString(), xpinLetter.Shadow())))); foreach (var marker in navigatorView.ListMarker) { if (marker.Latitude > -90 && marker.Latitude < 90) { var icon = new PinIcon(PinIcons.flag, Color.Coral); var gMarker = new GMarker(new GLatLng(marker.Latitude, marker.Longitude), new GMarkerOptions(new GIcon(icon.ToString(), icon.Shadow()))); var tableText = String.Format(Marker.infoTableHtml, marker.Name, marker.Name, marker.Name, marker.Latitude, marker.Longitude); var infoWindow = new GInfoWindow(gMarker, tableText, false, GListener.Event.click); Gmap1.Add(infoWindow); } } //} }
public void ShowMap(List <Restaurant> list, string val) { PinIcon p; GMarker gm; GInfoWindow win; GMap1.resetInfoWindows(); foreach (var i in list) { p = new PinIcon(PinIcons.home, Color.Cyan); gm = new GMarker(new GLatLng(Convert.ToDouble(i.Latitude), Convert.ToDouble(i.Longitude)), new GMarkerOptions(new GIcon(p.ToString(), p.Shadow()))); //win = new GInfoWindow(gm, i.Name + " </br>Specialty: " + i.Specialty + " </br>" + " <a href='" + i.Url + "'>Read more...</a>", false, GListener.Event.mouseover); win = new GInfoWindow(gm, i.Name + " </br>Specialty: " + i.Specialty + " </br>" + " <a href='' id='myid' runat='server' OnClick='ShowDirections(" + i.Latitude + ", " + i.Longitude + ")'>Get Directions </a> ", false, GListener.Event.mouseover); GMap1.Add(win); string items = i.Specialty.ToString(); if (val == "") { ddlType.Items.Add(items); } ddlType.Items.FindByValue(val).Attributes.Add("Selected", "Selected"); ddlType.Items.FindByValue("").Attributes.Remove("Text"); ddlType.Items.FindByValue("").Attributes.Add("Text", "Select ALL"); } }
protected void control(object sender, GridViewCommandEventArgs e) { PROJEEntities db = new PROJEEntities(); if (e.CommandName == "cmd1") { int count = Convert.ToInt32(e.CommandArgument); count++; var query = (from a in db.konaklama where a.id == count select a.location).SingleOrDefault(); var y = Convert.ToDouble(query.Latitude); var x = Convert.ToDouble(query.Longitude); GMap1.Height = 1000; GMap1.Width = 500; GMap1.Key = "AIzaSyBbzayQWkhyVj3CTlFAh0UoVTt6NcZTpmo"; GLatLng latlon = new GLatLng(x, y); GMap1.setCenter(latlon, 12); GMarker gm; GMarker icono = new GMarker(latlon); PinIcon p; p = new PinIcon(PinIcons.flag, Color.Red); gm = new GMarker(new GLatLng(Convert.ToDouble(x), Convert.ToDouble(y)), new GMarkerOptions(new GIcon(p.ToString(), p.Shadow()))); GInfoWindow win; GMap1.addInfoWindow(win); } }
private void LoadGMap(string latitude, string longitude, string companyName, string address, string imageName) { PinIcon p; GMarker gm; GInfoWindow win; GLatLng mainLocation = new GLatLng(DBConvert.ParseDouble(latitude), DBConvert.ParseDouble(longitude)); GMapType.GTypes maptype = GMapType.GTypes.Normal; GMap1.setCenter(mainLocation, 15, maptype); GMap1.enableHookMouseWheelToZoom = true; GMapUIOptions options = new GMapUIOptions(); options.maptypes_hybrid = true; options.maptypes_normal = true; options.zoom_scrollwheel = true; GMap1.Add(new GMapUI(options)); //GMarker marker = new GMarker(mainLocation); GIcon icon = new GIcon(); icon.markerIconOptions = new MarkerIconOptions(50, 50, Color.Blue); p = new PinIcon(PinIcons.home, Color.Cyan); gm = new GMarker(mainLocation, new GMarkerOptions(new GIcon(p.ToString(), p.Shadow()))); win = new GInfoWindow(gm, HtmlIconMap(imageName, companyName, address), false, GListener.Event.mouseover); GMap1.addControl(new GControl(GControl.preBuilt.GOverviewMapControl)); GMap1.addControl(new GControl(GControl.preBuilt.LargeMapControl)); GMap1.Add(win); }
protected void control(object sender, GridViewCommandEventArgs e) { PROJEEntities db = new PROJEEntities(); if (e.CommandName == "cmd1") { int count = Convert.ToInt32(e.CommandArgument); count++; var query = (from a in db.mekans where a.id == count select a.location).SingleOrDefault(); var y = Convert.ToDouble(query.Latitude); var x = Convert.ToDouble(query.Longitude); GMap1.Height = 1000; GMap1.Width = 1000; //500'dü ben 1000 yaptım GMap1.Key = "AIzaSyBbzayQWkhyVj3CTlFAh0UoVTt6NcZTpmo"; var latlon = new GLatLng(x, y); //istenilen enlem boylam değerlerini merkez olarak alır GMap1.setCenter(latlon, 12); GMarker gm; GMarker icono = new GMarker(latlon); PinIcon p; p = new PinIcon(PinIcons.flag, Color.Red); //istenen yere bırakılacak bayrak işaretçisi gm = new GMarker(new GLatLng(Convert.ToDouble(x), Convert.ToDouble(y)), //parantezdeki sayılar enlem boylam buraya işaretçi bırakılacak new GMarkerOptions(new GIcon(p.ToString(), p.Shadow()))); GInfoWindow win; win = new GInfoWindow(gm, "" + "", false, GListener.Event.mouseover); //haritaya eklenir GMap1.addInfoWindow(win); } }
private void FillHome() { GLatLng gLatLng = null; if (Lat.HasValue) { gLatLng = new GLatLng(Lat.Value, Lon.Value); } else if (Address != null) { GeoCode geoCode = GMap1.getGeoCodeRequest(Address); if (geoCode.valid) { gLatLng = geoCode.Placemark.coordinates; } } if (gLatLng != null) { PinIcon pinIcon = new PinIcon(PinIcons.home, Color.FromArgb(0xB4, 0x97, 0x59)); var markerOptions = new GMarkerOptions(new GIcon(pinIcon.ToString(), pinIcon.Shadow()), Title.Replace("'", "´")); GMarker marker = new GMarker(gLatLng, markerOptions); //GMarker marker = new GMarker(gLatLng); StringBuilder sb = new StringBuilder(); sb.Append(Title); GInfoWindow window = new GInfoWindow(marker, sb.ToString(), false); GMap1.addInfoWindow(window); GMap1.setCenter(new GLatLng(gLatLng.lat, gLatLng.lng), InitialZoom); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { // Here I used Degha Location as Main Location and Lat Long is : 21.622564, 87.523417 GLatLng mainLocation = new GLatLng(21.622564, 87.523417); GMap1.setCenter(mainLocation, 15); XPinLetter xpinLetter = new XPinLetter(PinShapes.pin_star, "H", Color.Blue, Color.White, Color.Chocolate); GMap1.Add(new GMarker(mainLocation, new GMarkerOptions(new GIcon(xpinLetter.ToString(), xpinLetter.Shadow())))); List <HotelMaster> hotels = new List <HotelMaster>(); using (MyDatabaseEntities dc = new MyDatabaseEntities()) { hotels = dc.HotelMasters.Where(a => a.HotelArea.Equals("Digha")).ToList(); } PinIcon p; GMarker gm; GInfoWindow win; foreach (var i in hotels) { p = new PinIcon(PinIcons.home, Color.Cyan); gm = new GMarker(new GLatLng(Convert.ToDouble(i.LocLat), Convert.ToDouble(i.LocLong)), new GMarkerOptions(new GIcon(p.ToString(), p.Shadow()))); win = new GInfoWindow(gm, i.HotelName + " <a href='" + i.ReadMoreUrl + "'>Read more...</a>", false, GListener.Event.mouseover); GMap1.Add(win); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { // Here I used Degha Location as Main Location and Lat Long is : 21.622564, 87.523417 GLatLng mainLocation = new GLatLng(40.813445, 29.307283); GMap1.setCenter(mainLocation, 15); XPinLetter xpinLetter = new XPinLetter(PinShapes.pin_star, "H", Color.Blue, Color.White, Color.Chocolate); GMap1.Add(new GMarker(mainLocation, new GMarkerOptions(new GIcon(xpinLetter.ToString(), xpinLetter.Shadow())))); List <lokasyon> lokasyonlar = new List <lokasyon>(); using (lokasyonContext dc = new lokasyonContext()) { lokasyonlar = dc.lokasyonlar.ToList(); //lokasyonlar = dc.HotelMasters.Where(a => a.HotelArea.Equals("Digha")).ToList(); } PinIcon p; GMarker gm; GInfoWindow win; foreach (var i in lokasyonlar) { p = new PinIcon(PinIcons.home, Color.Cyan); gm = new GMarker(new GLatLng(Convert.ToDouble(i.enlem), Convert.ToDouble(i.boylam)), new GMarkerOptions(new GIcon(p.ToString(), p.Shadow()))); win = new GInfoWindow(gm, i.mekan_ismi + " <a href='" + i.siteye_git + "'>Read more...</a>", false, GListener.Event.mouseover); GMap1.Add(win); } } }
protected void GridView2_SelectedIndexChanging(object sender, GridViewSelectEventArgs e) { //string ah = GridView2.SelectedRow.Cells[1].Text; int I = e.NewSelectedIndex; // GridViewRow row = GridView2.SelectedRow; // string lo = row.ID; string pid = GridView2.Rows[I].Cells[1].Text; dataDataContext dd = new dataDataContext(); Word_search word = new Word_search(); var eddd = (from a in dd.Word_searches where a.ID == Convert.ToInt32(pid) select a).SingleOrDefault(); GMap1.Visible = true; GMap1.reset(); PinIcon p; GMarker gm; GInfoWindow gin; GLatLng mainarea = new GLatLng(Convert.ToDouble(eddd.latid), Convert.ToDouble(eddd.@long)); GMap1.setCenter(mainarea, 15); XPinLetter xpinletter = new XPinLetter((PinShapes.pin_star), "W", Color.Blue, Color.White, Color.Chocolate); GMap1.Add(new GMarker(mainarea, new GIcon(xpinletter.ToString(), xpinletter.Shadow()))); p = new PinIcon(PinIcons.computer, Color.Cyan); gm = new GMarker(new GLatLng(Convert.ToDouble(eddd.latid), (Convert.ToDouble(eddd.@long))), new GMarkerOptions(new GIcon(p.ToString(), p.Shadow()))); gin = new GInfoWindow(gm, "<font color=black><b>Search info</b><br/> Word search:" + eddd.Word_search1 + "<br /> date_of_search:" + eddd.date_s, false, GListener.Event.mouseover); GMap1.Add(gin); Session["lat"] = this.Request.QueryString["lat"]; Session["lon"] = this.Request.QueryString["long"]; Session["user"] = us; }
protected void Page_Load(object sender, EventArgs e) { if(!IsPostBack) { GLatLng mainLocation = new GLatLng(34.0477964, -118.2581307); GMap1.setCenter(mainLocation, 14); XPinLetter xpinLetter = new XPinLetter(PinShapes.pin_star, "H", Color.Blue, Color.White, Color.Chocolate); GMap1.Add(new GMarker(mainLocation, new GMarkerOptions(new GIcon(xpinLetter.ToString(), xpinLetter.Shadow())))); List<HotelMaster> hotels = new List<HotelMaster>(); using (HotelDatabaseEntities dc = new HotelDatabaseEntities()) { hotels = dc.HotelMasters.Where(a => a.HotelArea.Equals("Los Angeles Downtown")).ToList(); } PinIcon p; GMarker gm; GInfoWindow win; foreach(var i in hotels) { p = new PinIcon(PinIcons.home, Color.Cyan); gm = new GMarker(new GLatLng(Convert.ToDouble(i.LocLat), Convert.ToDouble(i.LocLong)), new GMarkerOptions(new GIcon(p.ToString(), p.Shadow()))); win = new GInfoWindow(gm, i.HotelName + "<a href='"+i.ReadMoreUrl+"'> Read more...</a>", false, GListener.Event.mouseover); GMap1.Add(win); } } }
protected void Button1_Click(object sender, EventArgs e) { us = (User)Session["user"]; string lat = (string)Session["lat"]; string lon = (string)Session["long"]; GLatLng mainarea = new GLatLng(33.50, 36.30); GMap1.setCenter(mainarea, 13); XPinLetter xpinletter = new XPinLetter((PinShapes.pin_star), "W", Color.Blue, Color.White, Color.Chocolate); GMap1.Add(new GMarker(mainarea, new GIcon(xpinletter.ToString(), xpinletter.Shadow()))); PinIcon p; GMarker gm; GInfoWindow gin; foreach (var i in data.Word_searches) { if (i.Word_search1.ToString().Trim() == TextBox1.Text) { p = new PinIcon(PinIcons.computer, Color.Cyan); gm = new GMarker(new GLatLng(Convert.ToDouble(i.latid), (Convert.ToDouble(i.@long))), new GMarkerOptions(new GIcon(p.ToString(), p.Shadow()))); us = data.Users.Where(pm => pm.ID == i.Searcher_id).Single(); gin = new GInfoWindow(gm, "<font color=black><b>Search info</b><br/> User:"******"<br /> Word search:" + i.Word_search1 + "<br /> date_of_search:" + i.date_s, false, GListener.Event.mouseover); GMap1.Add(gin); } } Session["lat"] = this.Request.QueryString["lat"]; Session["lon"] = this.Request.QueryString["long"]; Session["user"] = us; }
protected void Page_Load(object sender, EventArgs e) { dt.Columns.Add("Tweet"); dt.Columns.Add("User"); dt.Columns.Add("Location"); dt.Columns.Add("Longitude"); dt.Columns.Add("latitude"); dt.Columns.Add("TweetCount"); tokens.AccessToken = "140219230-Mww3rqC22jsEeGrwyWzfgGtzXNlPonroTyyFaE6F"; tokens.AccessTokenSecret = "fNao9nGu9fgmxYtcF0UXoVMCcAGoBzkRPRfl7ujA2il1b"; tokens.ConsumerKey = "2VqPg2xyY8A7ziLmRk5SaRaSL"; tokens.ConsumerSecret = "ccJGxDaBDgyvrn6UGQFmQd0RNLXn3qRcTbg8rKZo01bmrK0EH5"; TwitterResponse<TwitterSearchResultCollection> result = TwitterSearch.Search(tokens, "#ACME", new SearchOptions()); TwitterSearchResultCollection results = result.ResponseObject; List<TwitterSearchResult> resultList = results.ToList(); foreach (var item in resultList) { string longtu = ""; string lattu = ""; try { longtu = item.Geo.Coordinates[0].Longitude.ToString(); lattu = item.Geo.Coordinates[0].Latitude.ToString(); } catch (Exception) { } if (longtu != "" && lattu != "") { GLatLng mainLocation = new GLatLng(Convert.ToDouble(longtu), Convert.ToDouble(lattu)); GMap1.setCenter(mainLocation, 5); PinIcon p; GMarker gm; GInfoWindow win; p = new PinIcon(PinIcons.home, Color.Cyan); gm = new GMarker(new GLatLng(Convert.ToDouble(longtu), Convert.ToDouble(lattu)), new GMarkerOptions(new GIcon(p.ToString(), p.Shadow()))); win = new GInfoWindow(gm, "" + "", false, GListener.Event.mouseover); GMap1.Add(win); } dt.Rows.Add(item.Text, item.User.Name, item.User.Location,longtu , lattu,item.User.ListedCount); } GridView1.DataSource = dt; GridView1.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (Session["New"] != null) { Session["New"].ToString(); Session["latidtude"].ToString(); Session["longitude"].ToString(); } else { Response.Write("Error"); } //double latitude; //double.TryParse(Session["latidtude"].ToString(), NumberStyles.Any, CultureInfo.CurrentCulture, out latitude); string RLat = Session["latidtude"].ToString(); string RLong = Session["longitude"].ToString(); if (!IsPostBack) { // Current Location GLatLng mainLocation = new GLatLng(Convert.ToDouble(RLat), Convert.ToDouble(RLong)); GMap1.setCenter(mainLocation, 15); XPinLetter xpinLetter = new XPinLetter(PinShapes.pin_star, "F", Color.Blue, Color.White, Color.Chocolate); GMap1.Add(new GMarker(mainLocation, new GMarkerOptions(new GIcon(xpinLetter.ToString(), xpinLetter.Shadow())))); List <LocData> location = new List <LocData>(); using (FishLocEntities dc = new FishLocEntities()) { location = dc.LocDatas.Where(a => a.Loc_Area.Equals("Orick")).ToList(); } PinIcon p; GMarker gm; GInfoWindow win; foreach (var i in location) { p = new PinIcon(PinIcons.home, Color.Cyan); gm = new GMarker(new GLatLng(Convert.ToDouble(i.Loc_Lat), Convert.ToDouble(i.Loc_Long)), new GMarkerOptions(new GIcon(p.ToString(), p.Shadow()))); win = new GInfoWindow(gm, i.Loc_Name + " <a href='" + i.ReadMoreUrl + "'>Read more...</a>", false, GListener.Event.mouseover); GMap1.Add(win); } } }
protected void Page_Load(object sender, EventArgs e) { GLatLng latlng = new GLatLng(41, -3.2); GMap1.setCenter(latlng, 5); PinLetter pinLetter = new PinLetter("A", Color.Yellow, Color.Black); XPinLetter xPinLetter = new XPinLetter(PinShapes.pin_star, "B", Color.Blue, Color.White, Color.Chocolate); PinIcon pinIcon = new PinIcon(PinIcons.home, Color.Cyan); XPinIcon xPinIcon = new XPinIcon(PinShapes.pin, PinIcons.home, Color.LightGreen, Color.BlueViolet); SPin sPin = new SPin(0.5, -10, Color.Green, 8, PinFontStyle.normal, "C"); GMap1.Add(new GMarker(latlng, new GMarkerOptions(new GIcon(pinLetter.ToString(), pinLetter.Shadow())))); GMap1.Add(new GMarker(latlng + new GLatLng(2, 2), new GMarkerOptions(new GIcon(xPinLetter.ToString(), xPinLetter.Shadow())))); GMap1.Add(new GMarker(latlng + new GLatLng(2, -2), new GMarkerOptions(new GIcon(pinIcon.ToString(), pinIcon.Shadow())))); GMap1.Add(new GMarker(latlng + new GLatLng(-2, 2), new GMarkerOptions(new GIcon(xPinIcon.ToString(), xPinIcon.Shadow())))); GMap1.Add(new GMarker(latlng + new GLatLng(-2, -2), new GMarkerOptions(new GIcon(sPin.ToString())))); }
private void ShowinMap(List <Report> reports) { GLatLng mainLocation = new GLatLng(23.684994, 90.356331); GMap1.setCenter(mainLocation, 8); XPinLetter xPinLetter = new XPinLetter(PinShapes.pin_star, "H", Color.Blue, Color.White, Color.Chocolate); GMap1.Add(new GMarker(mainLocation, new GMarkerOptions(new GIcon(xPinLetter.ToString(), xPinLetter.Shadow())))); PinIcon p; GMarker gm; GInfoWindow win; foreach (var report in reports) { if (report.TotalPatient > 0) { p = new PinIcon(PinIcons.home, Color.Red); gm = new GMarker( new GLatLng(Convert.ToDouble(report.DistrictLoclot), Convert.ToDouble(report.DistrictLocLong)), new GMarkerOptions(new GIcon(p.ToString(), p.Shadow()))); win = new GInfoWindow(gm, " District Name: " + report.DistrictName + " Total Patient: " + report.TotalPatient, GListener.Event.mouseover); GMap1.Add(win); } else { p = new PinIcon(PinIcons.home, Color.Cyan); gm = new GMarker( new GLatLng(Convert.ToDouble(report.DistrictLoclot), Convert.ToDouble(report.DistrictLocLong)), new GMarkerOptions(new GIcon(p.ToString(), p.Shadow()))); win = new GInfoWindow(gm, " District Name: " + report.DistrictName + " Total Patient: " + report.TotalPatient, GListener.Event.mouseover); GMap1.Add(win); } } }
protected void Page_Load(object sender, EventArgs e) { string role = Session["Role"] as string; if (role != "Administrator") { Response.Redirect("Login.aspx"); } else { txtUserName.InnerHtml = Session["username"] as string; } if (!IsPostBack) { // Here I used Degha Location as Main Location and Lat Long is : 21.622564, 87.523417 //-25.85719, 28.1845484 GLatLng mainLocation = new GLatLng(-26.270760, 28.112268); GMap1.setCenter(mainLocation, 15); XPinLetter xpinLetter = new XPinLetter(PinShapes.pin_star, "H", Color.Blue, Color.White, Color.Chocolate); GMap1.Add(new GMarker(mainLocation, new GMarkerOptions(new GIcon(xpinLetter.ToString(), xpinLetter.Shadow())))); List <UserRegistration> userreg = new List <UserRegistration>(); using (NacosadbDataContext dc = new NacosadbDataContext()) { userreg = dc.UserRegistrations.Where(a => a.ID != null).ToList(); } PinIcon p; GMarker gm; GInfoWindow win; foreach (var i in userreg) { p = new PinIcon(PinIcons.home, Color.Cyan); gm = new GMarker(new GLatLng(Convert.ToDouble(-25.85719), Convert.ToDouble(28.1845484)), new GMarkerOptions(new GIcon(p.ToString(), p.Shadow()))); //" <a href='" + i.ReadMoreUrl + "'>Read more...</a>" win = new GInfoWindow(gm, i.Address, false, GListener.Event.mouseover); GMap1.Add(win); } } }
private void ShowinMap(List<Report> reports) { GLatLng mainLocation = new GLatLng(23.684994, 90.356331); GMap1.setCenter(mainLocation, 8); XPinLetter xPinLetter = new XPinLetter(PinShapes.pin_star, "H", Color.Blue, Color.White, Color.Chocolate); GMap1.Add(new GMarker(mainLocation, new GMarkerOptions(new GIcon(xPinLetter.ToString(), xPinLetter.Shadow())))); PinIcon p; GMarker gm; GInfoWindow win; foreach (var report in reports) { if (report.TotalPatient > 0) { p = new PinIcon(PinIcons.home, Color.Red); gm = new GMarker( new GLatLng(Convert.ToDouble(report.DistrictLoclot), Convert.ToDouble(report.DistrictLocLong)), new GMarkerOptions(new GIcon(p.ToString(), p.Shadow()))); win = new GInfoWindow(gm, " District Name: " + report.DistrictName + " Total Patient: " + report.TotalPatient, GListener.Event.mouseover); GMap1.Add(win); } else { p = new PinIcon(PinIcons.home, Color.Cyan); gm = new GMarker( new GLatLng(Convert.ToDouble(report.DistrictLoclot), Convert.ToDouble(report.DistrictLocLong)), new GMarkerOptions(new GIcon(p.ToString(), p.Shadow()))); win = new GInfoWindow(gm, " District Name: " + report.DistrictName + " Total Patient: " + report.TotalPatient, GListener.Event.mouseover); GMap1.Add(win); } } }
public async void idleuser() { var idleuser = await ParseUser.Query .WhereEqualTo("status", UserControlls.statusCode[0]) .FindAsync(); txtidle.Text = idleuser.Count() + ""; //foreach (ParseUser user in idleuser){ // int count= user.ObjectId.Count(); // txtidle.Text = count.ToString(); //} //var userGeoPoint = ParseUser.CurrentUser.Get<ParseGeoPoint>("lastLocation"); foreach (ParseUser user in idleuser) { ParseFile img = user.Get<ParseFile>("profilePic"); idleuserlist.Add(new User { Id = user.ObjectId, username = user.Get<string>("username"), lastLocation = user.Get<ParseGeoPoint>("lastLocation"), profilePic = img.Url, status = user.Get<string>("status") }); } GMapOverlay markersOverlay = new GMapOverlay(); foreach (var locations in idleuserlist) { //Image i = new Image(); //ResizeImage(locations.profilePic, 40, 40); //GIcon icon = new GIcon(); //icon.image=locations.profilePic.AbsoluteUri.ToString(); //icon.shadow = "http://simpleicon.com/wp-content/uploads/map-marker-3.png"; //icon.iconSize = new GSize(40, 100); //icon.shadowSize = new GSize(82, 200); //string jsonEmployeeResponse = JsonConvert.SerializeObject(locations); PinIcon p; GMarker gm; GInfoWindow win; //Bitmap im = new Bitmap(PinIcons.WCmale); //imggreen = PinIcons.WCmale; //imggreen.ForeColor = Color.Green; //body += @"<p><img src='" + domainName + imageFileName +"' alt='Product Image' width='250px' height='250px' runat='server' /></p>"; p = new PinIcon(PinIcons.WCmale, Color.Green); gm = new GMarker(new GLatLng(locations.lastLocation.Latitude, locations.lastLocation.Longitude), new GMarkerOptions(new GIcon(p.ToString(), p.Shadow()))); win = new GInfoWindow(gm, "<p><img src='" + locations.profilePic + "' alt='person Image' width='60px' height='60px' runat='server' /> <br/>" + locations.username.First().ToString().ToUpper() + locations.username.Substring(1) + " <br/>" + locations.status.First().ToString().ToUpper() + locations.status.Substring(1) + "</p>", false, GListener.Event.mouseover); GMap1.Add(win); } }
protected void Button1_Click(object sender, EventArgs e) { dt.Clear(); TwitterResponse<TwitterSearchResultCollection> result = TwitterSearch.Search(tokens, TextBox2.Text, new SearchOptions()); TwitterSearchResultCollection results = result.ResponseObject; List<TwitterSearchResult> resultList = results.ToList(); foreach (var item in resultList) { string longtu = ""; string lattu = ""; try { longtu = item.Geo.Coordinates[0].Longitude.ToString(); lattu = item.Geo.Coordinates[0].Latitude.ToString(); } catch (Exception) { } if (longtu != "" && lattu != "") { GLatLng mainLocation = new GLatLng(Convert.ToDouble(longtu), Convert.ToDouble(lattu)); GMap1.setCenter(mainLocation, 5); PinIcon p; GMarker gm; GInfoWindow win; p = new PinIcon(PinIcons.home, Color.Cyan); gm = new GMarker(new GLatLng(Convert.ToDouble(longtu), Convert.ToDouble(lattu)), new GMarkerOptions(new GIcon(p.ToString(), p.Shadow()))); win = new GInfoWindow(gm, "" + "", false, GListener.Event.mouseover); GMap1.Add(win); } dt.Rows.Add(item.Text, item.User.Name, item.User.Location, longtu, lattu, item.User.ListedCount); } GridView1.DataSource = dt; GridView1.DataBind(); }
public async void finisheduser() { var finisheduser = await ParseUser.Query .WhereEqualTo("status", UserControlls.statusCode[7]) .FindAsync(); txtfinished.Text = finisheduser.Count().ToString(); foreach (ParseUser user in finisheduser) { ParseFile img = user.Get<ParseFile>("profilePic"); finishuserlist.Add(new User { Id = user.ObjectId, username = user.Get<string>("username"), lastLocation = user.Get<ParseGeoPoint>("lastLocation"), profilePic = img.Url, status = user.Get<string>("status") }); } foreach (var locations in finishuserlist) { PinIcon p; GMarker gm; GInfoWindow win; p = new PinIcon(PinIcons.WCmale, Color.Yellow); gm = new GMarker(new GLatLng(locations.lastLocation.Latitude, locations.lastLocation.Longitude), new GMarkerOptions(new GIcon(p.ToString(), p.Shadow()))); win = new GInfoWindow(gm, "<p><img src='" + locations.profilePic + "' alt='person Image' width='60px' height='60px' runat='server' /> <br/>" + locations.username.First().ToString().ToUpper() + locations.username.Substring(1) + " <br/>" + locations.status.First().ToString().ToUpper() + locations.status.Substring(1) + "</p>", false, GListener.Event.mouseover); GMap1.Add(win); } }
protected void Button2_Click(object sender, EventArgs e) { GLatLng mainLocation = new GLatLng(Convert.ToDouble(TextBox3.Text), Convert.ToDouble(TextBox4.Text)); GMap1.setCenter(mainLocation, 5); PinIcon p; GMarker gm; GInfoWindow win; p = new PinIcon(PinIcons.home, Color.Cyan); gm = new GMarker(new GLatLng(Convert.ToDouble(TextBox3.Text), Convert.ToDouble(TextBox4.Text)), new GMarkerOptions(new GIcon(p.ToString(), p.Shadow()))); win = new GInfoWindow(gm, "" + "", false, GListener.Event.mouseover); GMap1.Add(win); }