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 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) { 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 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())))); }
protected void btnBUscar_Click(object sender, EventArgs e) { UbicacionServiceClient proxy = new UbicacionServiceClient(); Ubicacion ubi = new Ubicacion(); try { GMap1.reset(); ubi = proxy.listaUbicacion(TextBox1.Text); GLatLng milocacion = new GLatLng(ubi.latitud, ubi.longitud); GMap1.setCenter(milocacion, 14); XPinLetter Xpin = new XPinLetter(PinShapes.pin_star, "H", Color.Blue, Color.White, Color.Chocolate); GMap1.Add(new GMarker(milocacion, new GMarkerOptions(new GIcon(Xpin.ToString(), Xpin.Shadow())))); } catch (Exception ex) { Label2.Text = ex.Message; } }
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) { ClientScript.RegisterStartupScript(this.GetType(), "myscript", @"<script type=""text/javascript""> if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(success); } else { alert(""Geo Location is not supported on your current browser!""); } function success(position) { var lat = position.coords.latitude; document.getElementById('HiddenField1').value = lat.toLocaleString(); var long = position.coords.longitude; document.getElementById('HiddenField2').value = long.toLocaleString(); var city = position.coords.locality; var myLatlng = new google.maps.LatLng(lat, long); var myOptions = { center: myLatlng, zoom: 12, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById(""map_canvas""), myOptions); var marker = new google.maps.Marker({ position: myLatlng, title: ""lat: "" + lat + "" long: "" + long }); } </script>"); if (!IsPostBack) { // GLatLng mainarea = new GLatLng(33.2,36.3); 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()))); } }
protected void Page_Load(object sender, EventArgs e) { GMapUIOptions options = new GMapUIOptions(); options.zoom_scrollwheel = true; //options GMap1.addGMapUI(new GMapUI(options)); //setcenter GMap1.setCenter(new GLatLng(-7.197617, 112.73288),15, GMapType.GTypes.Satellite); //add red marker GLatLng redPosition = new GLatLng(-7.197681, 112.72429); XPinLetter xPinLetter = new XPinLetter(PinShapes.pin_star, "A", Color.White, Color.Black, Color.Red); GMarker redMarker = new GMarker(redPosition, new GMarkerOptions(new GIcon(xPinLetter.ToString(), xPinLetter.Shadow()))); //add info window GInfoWindowOptions IWoptions = new GInfoWindowOptions(12, GMapType.GTypes.Normal); GInfoWindow mbUp = new GInfoWindow(redMarker, "<i>I'm in</i> <a style='color:red'>RED</a> <b>Condition</b>", IWoptions); GMap1.addGMarker(redMarker); GMap1.addInfoWindow(mbUp); //add green marker GLatLng greenPosition = new GLatLng(-7.19651, 112.731035); xPinLetter = new XPinLetter(PinShapes.pin_star, "B", Color.White, Color.Black, Color.Green); GMarker greenMarker = new GMarker(greenPosition, new GMarkerOptions(new GIcon(xPinLetter.ToString(), xPinLetter.Shadow()))); //add info window IWoptions = new GInfoWindowOptions(12, GMapType.GTypes.Normal); mbUp = new GInfoWindow(greenMarker, "<i>I'm in</i> <a style='color:green'>GREEN</a> <b>Condition</b>", IWoptions); GMap1.addGMarker(greenMarker); GMap1.addInfoWindow(mbUp); }
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); } } }
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) { if (!IsPostBack) { // Here I used Degha Location as Main Location and Lat Long is : 21.622564, 87.523417 GLatLng mainLocation = new GLatLng(10.2833322, 123.8999964); GMap1.setCenter(mainLocation, 12); 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 <Restaurant> restaurants = new List <Restaurant>(); using (RestaurantsDBEntities1 dc = new RestaurantsDBEntities1()) { restaurants = dc.Restaurants.Where(a => a.Area.Equals("Cebu")).ToList(); } ddlType.Items.Add(new ListItem("Select Restaurant Type", "")); ddlType.Items.FindByValue("").Attributes.Add("Disabled", "Disabled"); ShowMap(restaurants, ""); } }
protected void ExibirTodosOsPontosNoMapa() { MA_PARTICIPANTE participante = (MA_PARTICIPANTE)Session["participante"]; GLatLng mainLocation = new GLatLng(Convert.ToDouble(participante.geolocalizacao.Latitude), Convert.ToDouble(participante.geolocalizacao.Longitude)); 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())))); }
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 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) { 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); } } }