protected void Page_Load(object sender, EventArgs e) { GLatLng latlon = new GLatLng(10.2, 22); GMap1.setCenter(latlon, 4); /****** INFOWINDOWTAB 1 ******/ GInfoWindowTabs iwTabs = new GInfoWindowTabs(); iwTabs.point = latlon; List <GInfoWindowTab> tabs = new List <GInfoWindowTab>(); for (int i = 0; i < 3; i++) { tabs.Add(new GInfoWindowTab("Tab " + i.ToString(), i.ToString())); } iwTabs.tabs = tabs; GMap1.Add(iwTabs); /****** INFOWINDOWTAB 2 ******/ GInfoWindowTabs iwTabs2 = new GInfoWindowTabs(); GMarker icono = new GMarker(new GLatLng(5, 19)); iwTabs2.gMarker = icono; iwTabs2.tabs = tabs; GMap1.Add(iwTabs2); }
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 (!IsPostBack) { gvListadoClientes.DataSource = conClientes.ListadoClientes(); gvListadoClientes.DataBind(); conZonas.cargarProvincia(ddlFiltrosProvincias); //cargarClientesEnMapa(clientesMap); //me centro en argentina GLatLng ubicacion = new GLatLng(-13.533406, -88.4127875);//(-35.3139685, -65.104704);//(40.381090863719436, -3.6222052574157715); GMap1.setCenter(ubicacion, 4); //Establecemos alto y ancho en px GMap1.Height = 600; GMap1.Width = 558; //Adiciona el control de la parte izq superior (moverse, ampliar y reducir) GMap1.Add(new GControl(GControl.preBuilt.LargeMapControl)); //GControl.preBuilt.MapTypeControl: permite elegir un tipo de mapa y otro. GMap1.Add(new GControl(GControl.preBuilt.MapTypeControl)); cargarClientesEnMapa(clientesMap); GMap1.enableHookMouseWheelToZoom = true; //Tipo de mapa a mostrar GMap1.mapType = GMapType.GTypes.Normal; //Moverse con el cursor del teclado GMap1.enableGKeyboardHandler = true; } }
protected void Page_Load(object sender, EventArgs e) { GMap1.setCenter(new GLatLng(40.639722, -73.778889), 12); var uiOptions = new GMapUIOptions() { controls_maptypecontrol = true, }; GMap1.Add(new GMapUI(uiOptions)); var styledMapOptions = new GStyledMapOptions("Styled"); var redStyler = new GMapTypeStyler(Color.Red) { Gamma = 0.9, }; var blueStyler = new GMapTypeStyler(Color.Blue) { Weight = 5 }; var styles = new List <GMapTypeStyle>() { new GMapTypeStyle(GMapTypeStyleElementType.Geometry, GMapTypeStyleFeatureType.Transit__Station__Airport, redStyler), new GMapTypeStyle(GMapTypeStyleElementType.Geometry__Stroke, GMapTypeStyleFeatureType.Road, blueStyler) }; var styledMap = new GStyledMapType(styledMapOptions, styles); GMap1.Add(styledMap, true); }
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; }
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.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); } }
protected void Page_Load(object sender, EventArgs e) { System.Text.StringBuilder sb = new System.Text.StringBuilder(); GLatLng center = new GLatLng(44, 5); GMap1.setCenter(center); sb.Append("var markers=[];"); sb.Append("function subgurim_Add()"); sb.Append("{"); GMarker marker = new GMarker(GMap1.GMap_Id + ".getCenter()"); sb.Append(marker.ToString(GMap1.GMap_Id)); sb.AppendFormat("markers.push({0})", marker.ID); sb.Append("}"); sb.Append("function subgurim_Delete()"); sb.Append("{"); sb.Append("if (markers.length > 0) { markers.pop().setMap(null); }"); sb.Append("}"); sb.Append("function subgurim_Remove()"); sb.Append("{"); sb.Append("for (var i = 0; i < markers.length; i++) { markers[i].setMap(null); }"); sb.Append("markers = [];"); sb.Append("}"); GMap1.Add(sb.ToString()); }
protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["article"] == null) { Response.Redirect("UI_HomePage.aspx"); } try { string qr = "select * from Article, Category where Article.IDCategory =Category.IDCategory and Article.IDArticle = '" + Request.QueryString["article"] + "'"; object tb = cnDb.xlDataDSet(qr); dtlDetail.DataSource = tb; dtlDetail.DataBind(); lbSource.Text = cnDb.getOneData("select Source from Article where IDArticle = '" + Request.QueryString["article"] + "' ").ToString(); }catch (Exception) { Response.Redirect("UI_HomePage.aspx"); } try { //Map GMap1.addControl(new GControl(GControl.preBuilt.GOverviewMapControl)); GMap1.addControl(new GControl(GControl.preBuilt.LargeMapControl)); string toaDo = cnDb.getOneData("select MapAdd from Article where IDArticle = '" + Request.QueryString["article"] + "' ").ToString(); toaDo = toaDo.Trim(); string[] kinhViDo = Regex.Split(toaDo, ","); double kinhDo = double.Parse(kinhViDo[0], System.Globalization.NumberStyles.Any, CultureInfo.InvariantCulture); double viDo = double.Parse(kinhViDo[1], System.Globalization.NumberStyles.Any, CultureInfo.InvariantCulture); GMarker marker = new GMarker(new GLatLng(kinhDo, viDo)); GInfoWindow window = new GInfoWindow(marker, "<center><b>Điểm đến</b></center>", true); GMap1.addInfoWindow(window); }catch (Exception) { // Tọa độ sai GMap1.Visible = false; } }
protected void Page_Load(object sender, EventArgs e) { GDirection gdirection = new GDirection(true); gdirection.errorMessage = "Ups"; GMap1.Add(gdirection); }
public void llamarMapa() { double Longitud; //String x = txtLongitud.Text.ToString(); // Longitud = Convert.ToDouble(x); Longitud = double.Parse(txtLongitud.Text.ToString(), System.Globalization.NumberFormatInfo.InvariantInfo); // Longitud = double.Parse(txtLongitud.Text.ToString ()); double Latitud; Latitud = double.Parse(txtLatitud.Text, System.Globalization.NumberFormatInfo.InvariantInfo); GMap1.Visible = true; lblMapa.Visible = true; GMap1.resetMarkers(); if (Longitud > 0) { Longitud = Longitud * -1; } var glatlng = new Subgurim.Controles.GLatLng(Latitud, Longitud); GMap1.setCenter(glatlng, 16, Subgurim.Controles.GMapType.GTypes.Normal); var oMarker = new Subgurim.Controles.GMarker(glatlng); GMap1.Add(oMarker); }
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); } }
protected void Page_Load(object sender, EventArgs e) { ContextMenuControl contextMenuControl = new ContextMenuControl(); contextMenuControl.dirsFromText = "Desde aquí"; contextMenuControl.dirsToText = "Hasta aquí"; contextMenuControl.addDestinationText = "Añadir destino"; contextMenuControl.centerMapText = "Centrar mapa"; contextMenuControl.removePointText = "Eliminar punto"; contextMenuControl.whatsHereText = "¿Qué hay aquí?"; contextMenuControl.zoomInText = "Acercar"; contextMenuControl.zoomOutText = "Alejar"; contextMenuControl.fromText = "desde aquí hasta"; contextMenuControl.toText = "hasta aquí desde"; contextMenuControl.startAddressText = "Dirección inicial"; contextMenuControl.endAddressText = "Dirección final"; contextMenuControl.byCarText = "En coche"; contextMenuControl.avoidHighwaysText = "Evitar autopistas"; contextMenuControl.dragOrText = "Arrastrar o"; contextMenuControl.removeThisPointText = "eliminar este punto"; contextMenuControl.getDirectionText = "Buscar"; contextMenuControl.directionText = "Dirección"; contextMenuControl.previousText = "previo"; contextMenuControl.nextText = "posterior"; contextMenuControl.addressText = "Dirección"; GMap1.Add(new GControl(contextMenuControl)); }
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) { DragZoomControl dragZoomControl = new DragZoomControl(); DragZoomOtherOptions dragZoomOtherOptions = new DragZoomOtherOptions(); dragZoomOtherOptions.backButtonEnabled = true; dragZoomOtherOptions.backButtonHTML = "Go back"; dragZoomOtherOptions.buttonHTML = "Zoom"; dragZoomOtherOptions.minDragSize = 5; dragZoomControl.dragZoomOtherOptions = dragZoomOtherOptions; dragZoomControl.dragZoomOtherOptions = dragZoomOtherOptions; DragZoomCallbacks dragZoomCallbacks = new DragZoomCallbacks(); dragZoomCallbacks.buttonclick = "function(){alert('Button Click')}"; dragZoomControl.dragZoomCallbacks = dragZoomCallbacks; DragZoomBoxStyleOptions dragZoomBoxStyleOptions = new DragZoomBoxStyleOptions(); dragZoomBoxStyleOptions.opacity = 0.5; dragZoomBoxStyleOptions.fillColor = Color.Red; dragZoomControl.dragZoomBoxStyleOptions = dragZoomBoxStyleOptions; GControl dragzoom = new GControl(dragZoomControl, new GControlPosition(GControlPosition.position.Top_Left)); GMap1.Add(dragzoom); }
protected void Page_Load(object sender, EventArgs e) { GLatLng latLng = new GLatLng(50, 10); GMap1.setCenter(latLng, 4); GIcon icon = new GIcon(); icon.markerIconOptions = new MarkerIconOptions(50, 50, Color.Blue); GMarker marker = new GMarker(latLng, icon); GInfoWindow window = new GInfoWindow(marker, "You can use the Map Icon Maker as any other marker"); GMap1.Add(window); GIcon icon2 = new GIcon(); icon2.labeledMarkerIconOptions = new LabeledMarkerIconOptions(Color.Gold, Color.White, "A", Color.Green); GMarker marker2 = new GMarker(latLng + new GLatLng(3, 3), icon2); GInfoWindow window2 = new GInfoWindow(marker2, "You can use the Map Icon Maker as any other marker"); GMap1.Add(window2); GIcon icon3 = new GIcon(); icon3.flatIconOptions = new FlatIconOptions(25, 25, Color.Red, Color.Black, "B", Color.White, 15, FlatIconOptions.flatIconShapeEnum.roundedrect); GMarker marker3 = new GMarker(latLng + new GLatLng(-3, -3), icon3); GInfoWindow window3 = new GInfoWindow(marker3, "You can use the Map Icon Maker as any other marker"); GMap1.Add(window3); }
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 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 arreglarMapa() { GMap1.Add(new GControl(GControl.preBuilt.LargeMapControl)); GMap1.enableHookMouseWheelToZoom = true; StringBuilder sb = new StringBuilder(); sb.Append("function(marker, point) {"); GLatLng latlng = new GLatLng("point"); GInfoWindow window = new GInfoWindow(latlng, "<div style=\"height:140px;\"><blink>Loading...</blink></div>"); sb.Append(window.ToString(GMap1.GMap_Id)); sb.Append("}"); GMap1.Add(new GListener(GMap1.GMap_Id, GListener.Event.click, sb.ToString())); StringBuilder sb2 = new StringBuilder(); sb2.Append("function goTo(point){"); GLatLng point = new GLatLng("point"); sb2.AppendFormat("{0}.setZoom(11);", GMap1.GMap_Id); GMove move = new GMove(1, point); sb2.Append(move.ToString(GMap1.GMap_Id)); GMarker marker = new GMarker(point); sb2.Append(marker.ToString(GMap1.GMap_Id)); sb2.Append("}"); GMap1.Add(sb2.ToString()); }
protected void Page_Load(object sender, EventArgs e) { GLatLng sw = new GLatLng(40, 15); GLatLng ne = sw + new GLatLng(5, -10.2); GLatLngBounds latlngbounds = new GLatLngBounds(sw, ne); GMap1.Add(new GMarker(latlngbounds.getNorthEast())); GMap1.Add(new GMarker(latlngbounds.getSouthWest())); GMap1.GZoom = GMap1.getBoundsZoomLevel(latlngbounds); GMap1.setCenter(latlngbounds.getCenter()); GLatLng sw2 = new GLatLng(42, 7); GLatLng ne2 = sw2 + new GLatLng(5, 5); GLatLngBounds latlngbounds2 = new GLatLngBounds(sw2, ne2); GLatLng swBig = new GLatLng(35, 0); GLatLng neBig = swBig + new GLatLng(15, 15); GLatLngBounds latlngboundsBig = new GLatLngBounds(swBig, neBig); GLatLng inside = latlngbounds.getCenter(); GLatLng outside = neBig + new GLatLng(10, 10); bool isInside = latlngbounds.contains(inside); bool isOutSide = !latlngbounds.contains(outside); bool intersect = latlngbounds.intersects(latlngbounds2); bool contains = latlngboundsBig.containsBounds(latlngbounds); }
protected void Page_Load(object sender, EventArgs e) { GLatLng latlon = new GLatLng(10.2, 22); GMap1.setCenter(latlon, 4); GMarker icono = new GMarker(latlon); GInfoWindow window = new GInfoWindow(icono, "Ejemplo de <b>infoWindow</b>", false, GListener.Event.mouseover); GMap1.Add(window); GPolygon polygon = new GPolygon(); polygon.points.Add(new GLatLng(9, 25)); polygon.points.Add(new GLatLng(3, 22)); polygon.points.Add(new GLatLng(1, 26)); polygon.close(); GPolyline polyline = new GPolyline(polygon); GInfoWindow window2 = new GInfoWindow(); //window2.gPolygon = polygon; //window2.html = "GPolygon"; window2.gPolyline = polyline; window2.html = "polyline"; window2.opened = true; window2.sourceEvent = GListener.Event.click; GMap1.Add(window2); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { //// GMap1.Version = "2.43"; //GMap1.enableDragging = false; //GMap1.enableGoogleBar = true; GMap1.Language = "es"; GMap1.Add(new GControl(GControl.preBuilt.LargeMapControl)); GLatLng latlong = new GLatLng(10.856522627179888, -84.59865722656251); //LATITUD Y LONGITUD POR DEFECTO DEL MAPA GMap1.setCenter(latlong); GCustomCursor customCursor = new GCustomCursor(cursor.crosshair, cursor.text); //CURSOR POR DEFECTO GMap1.Add(customCursor); GMap1.Add(new GListener(GMap1.GMap_Id, GListener.Event.click, string.Format(@" function(event) {{ if (!event) return; var ev = new serverEvent('Click', {0}); ev.addArg({0}.getDiv().offsetWidth); ev.addArg({0}.getDiv().offsetHeight); ev.addArg(event.latLng.lat()); ev.addArg(event.latLng.lng()); ev.send(); }} ", GMap1.GMap_Id))); //guargar estado original Session["lat"] = latlong.lat.ToString(); Session["lng"] = latlong.lng.ToString(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request.QueryString["province"] != null && Request.QueryString["city"] != null) { Bll.SupplierBll sb = new Bll.SupplierBll(); DataTable dt = sb.GetAny("select * from tab_suppliers where province like N'" + Request.QueryString["province"] + "' and city like N'" + Request.QueryString["city"] + "'"); GMap1.Add(new GControl(GControl.preBuilt.GOverviewMapControl)); GMap1.Add(new GControl(GControl.preBuilt.LargeMapControl)); GMarker marker; GInfoWindow window; double lat, lng, clat = 0.0, clng = 0.0; foreach (DataRow dr in dt.Rows) { lat = Convert.ToDouble(dr["lat"]); lng = Convert.ToDouble(dr["lng"]); clat += lat; clng += lng; marker = new GMarker(new GLatLng(lat, lng)); window = new GInfoWindow(marker, "<center><b>" + dr["supplier"].ToString() + "</b><br />" + dr["branch"].ToString() + "</center>", false); GMap1.Add(window); } clat /= dt.Rows.Count; clng /= dt.Rows.Count; GMap1.enableHookMouseWheelToZoom = true; GMap1.setCenter(new GLatLng(clat, clng), 12); } } }
protected void Page_Load(object sender, EventArgs e) { GAdsManagerOptions options = new GAdsManagerOptions(1, 30); options.style = GAdsManagerOptions.GAdsManagerStyleEnum.adunit; GMap1.Add(new GAdsManager("YourPublisherID", GAdsManager.HelpSubgurimEnum.FullHelp, options)); }
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) { GLatLng latlng = new GLatLng(46, 21); GMap1.setCenter(latlng, 4); List <GLatLng> puntos = new List <GLatLng>(); puntos.Add(latlng + new GLatLng(0, 8)); puntos.Add(latlng + new GLatLng(-0.5, 4.2)); puntos.Add(latlng); puntos.Add(latlng + new GLatLng(3.5, -4)); puntos.Add(latlng + new GLatLng(4.79, +2.6)); GPolygon poligono = new GPolygon(puntos, "557799", 3, 0.5, "237464", 0.5); poligono.close(); GMap1.Add(poligono); List <GLatLng> puntos2 = new List <GLatLng>(); puntos2.Add(latlng + new GLatLng(5, -8)); puntos2.Add(latlng + new GLatLng(5, -6)); puntos2.Add(latlng + new GLatLng(5, -4)); puntos2.Add(latlng); puntos2.Add(latlng + new GLatLng(-5, 0)); GPolygon poligono2 = new GPolygon(puntos2, "000000", 3, 1, "654321", 1); GMap1.Add(poligono2); GPolygon poligono3 = new GPolygon(new List <GLatLng>(), "00ff00", 3, 1, "ff0044", 1); poligono3.createPolygon(latlng + new GLatLng(-6, -7.5), 7, 4, Math.PI / 3); GMap1.Add(poligono3); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { GMap1.Add(new GListener(GMap1.GMap_Id, GListener.Event.click, string.Format(@" function(event) {{ if (!event) return; var ev = new serverEvent('Click', {0}); ev.addArg({0}.getDiv().offsetWidth); ev.addArg({0}.getDiv().offsetHeight); ev.addArg(event.latLng.lat()); ev.addArg(event.latLng.lng()); ev.send(); }} ", GMap1.GMap_Id))); // GMap1.addListener(new GListener(GMap1.GMap_Id, GListener.Event.infowindowclose, // string.Format(@" // function() // {{ // var ev = new serverEvent('InfoWindowClose', {0}); // ev.addArg('My Argument'); // ev.send(); // }} // ", GMap1.GMap_Id))); } }
protected void Page_Load(object sender, EventArgs e) { GControl extMapType = new GControl(new ExtMapTypeControl(true, true, true, true, true)); GMap1.Add(extMapType); GMap1.setCenter(new GLatLng(47, -122)); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { GMap1.Add(new GControl(GControl.preBuilt.LargeMapControl)); GMap1.Add(new GControl(GControl.preBuilt.MapTypeControl)); } }
protected void Page_Load(object sender, EventArgs e) { GMap1.setCenter(new GLatLng(37.339085, -121.8914807), 18); GMap1.mapType = GMapType.GTypes.Hybrid; GMap1.Add(GMapType.GTypes.Physical); GMap1.Add(new GControl(GControl.preBuilt.MapTypeControl)); GMap1.enableRotation = true; }