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 Submit_Click(object sender, EventArgs e) { locator.locate find = new locator.locate(); string q = txtblood.Text; string r = txtZip.Text; string ab = find.locate0(r, q); string bc = find.locate1(r, q); string cd = find.locate2(r, q); string de = find.counting(r, q); Label1.Text = de; string address = ab + "," + bc + "," + cd + "," + r; string latitude1 = ""; string longitude1 = ""; // Response.Redirect("http://where.yahooapis.com/geocode?location=" +address ); XmlTextReader xtr = new XmlTextReader("http://where.yahooapis.com/geocode?location=" + address); xtr.WhitespaceHandling = WhitespaceHandling.Significant; //Response.Write(xtr.ToString()); try { while (xtr.Read()) { if (xtr.Name.ToString() == "latitude") { latitude1 = xtr.ReadString().ToString(); } if (xtr.Name.ToString() == "longitude") { longitude1 = xtr.ReadString().ToString(); } } GMap2.addGMapUI(new GMapUI()); GMapUIOptions options = new GMapUIOptions(); GLatLng latlong = new GLatLng(double.Parse(latitude1), double.Parse(longitude1)); GMapType.GTypes maptype = GMapType.GTypes.Normal; GMap2.setCenter(latlong, 15, maptype); //GMap2.GZoom = 9; PinLetter pinLetter = new PinLetter("o", Color.Red, Color.Black); GMap2.addGMarker(new GMarker(latlong, new GMarkerOptions(new GIcon(pinLetter.ToString(), pinLetter.Shadow())))); GMarker marker = new GMarker(latlong); GInfoWindowOptions IWoptions = new GInfoWindowOptions(12, maptype); GInfoWindow mbUp = new GInfoWindow(marker, address, IWoptions); GMap2.addInfoWindow(mbUp); } catch (Exception) { Response.Write("invalid adress"); } }
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) { 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); }
private void AddMarkers() { List<Tree> trees = bl.GetAllTrees("School101", "School101"); foreach (var tree in trees) { double lat; if (!double.TryParse(tree.Latitude, out lat)) continue; double lng; if (!double.TryParse(tree.Longitude, out lng)) continue; var latlng = new GLatLng(lat, lng); var icon = new GIcon(Helper.GetTreeIcon(tree.TreeType)); icon.iconSize = new GSize(10, 10); icon.iconAnchor = new GPoint(7, 7); var options = new GMarkerOptions(icon, true, Helper.GetTreeType(tree.TreeType) + " " + tree.ID); GMarker marker = new GMarker(latlng, options); map.Add(marker); string popupContent = string.Format(@" <h2>{0} {1}</h2> <p>Координати: {2}, {3}<p/> <p>Точност: {4}<p/> <p>Добавено на: {5}<p/> ", Helper.GetTreeType(tree.TreeType), tree.ID, tree.Latitude, tree.Latitude, tree.Accuracy, tree.DateAdded); GListener listener = new GListener(marker.ID, GListener.Event.click, string.Format(@" function () {{ var w = new google.maps.InfoWindow(); w.setContent('{0}'); w.open({1}, {2}); }}", popupContent, map.GMap_Id, marker.ID)); map.Add(listener); } }
protected string GMap1_Click(object s, Subgurim.Controles.GAjaxServerEventArgs e) { GMap gmap = new GMap(e.map); // GMarker and GInfoWindow GMarker marker = new GMarker(e.point); GInfoWindow window = new GInfoWindow(marker, "Cool!!", true); gmap.Add(window); // Movement //gmap.addMovement(1000, e.point + new GLatLng(25, 38)); //gmap.addMovement(1000, e.point); // Polylines if (e.point != e.center) { List <GLatLng> points = new List <GLatLng>(); points.Add(e.center); points.Add(e.point); gmap.Add(new GPolyline(points, Color.Yellow)); } // Controls gmap.Add(new GControl(GControl.extraBuilt.MarkCenter)); gmap.Add(new GControl(GControl.preBuilt.LargeMapControl)); gmap.Add(new GControl(GControl.preBuilt.MapTypeControl)); // Maybe... anything? ;) gmap.enableHookMouseWheelToZoom = false; gmap.mapType = GMapType.GTypes.Satellite; return(gmap.ToString()); }
protected void Page_Load(object sender, EventArgs e) { GMap1.Height = 500; GLatLng latlng = new GLatLng(46, 21); GMap1.setCenter(latlng, 4); List<GLatLng> points = new List<GLatLng>(); points.Add(latlng + new GLatLng(0, 8)); points.Add(latlng + new GLatLng(-0.5, 4.2)); points.Add(latlng); points.Add(latlng + new GLatLng(3.5, -4)); points.Add(latlng + new GLatLng(4.79, +2.6)); GPolyline line = new GPolyline(points, "FF0000", 2); GMap1.Add(line); GMarker marker = new GMarker(latlng); GMap1.Add(marker); GInfoWindowOptions options = new GInfoWindowOptions(); options.zoomLevel = 14; options.mapType = GMapType.GTypes.Hybrid; GShowMapBlowUp mBlowUp = new GShowMapBlowUp(new GLatLng(string.Format("{0}.getLatLng()", marker.ID)), options); GListener listener = new GListener(GMap1.GMap_Id, GListener.Event.click, string.Format(@"function(){{{0};}}", mBlowUp.ToString(GMap1.GMap_Id))); GMap1.Add(listener); GMap1.Add(new SnapToToute(marker, line)); }
public void setFireUnitInfo(GMarker marker, GMarkerRect rect) { this.getmarker = marker; this.getrect = rect; if (getmarker != null) { clearField(); lbBatteryID.Text = main.detailMarkers[getmarker].GetFireUnitBatteryID(); lbDetail.Text = main.detailMarkers[getmarker].GetFireUnitDetail(); lbNumber.Text = main.detailMarkers[getmarker].GetFireUnitNumber(); lbPosition.Text = PositionConverter.ParsePointToString(main.detailMarkers[getmarker].GetFireUnitPoint(), cmbPosition.Text); lbType.Text = main.detailMarkers[getmarker].GetFireUnitType(); lbStatus.Text = main.detailMarkers[getmarker].GetFireUnitStatus(); //if (main.detailMarkers[getmarker].GetFireUnitStatus() == "OP") //{ // lbStatus.Text = "OP"; //} //else if (main.detailMarkers[getmarker].GetFireUnitStatus() == "Limited") //{ // lbStatus.Text = "Limited"; //} //else if (main.detailMarkers[getmarker].GetFireUnitStatus() == "NonOP") //{ // lbStatus.Text = "NonOP"; //} } }
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 string GMap1_DragEnd(object s, GAjaxServerEventArgs e) { GMarker marker = new GMarker(e.point); GInfoWindow window = new GInfoWindow(marker, "DragEnd - " + DateTime.Now.ToString(), false); return(window.ToString(e.map)); }
protected void Page_Load(object sender, EventArgs e) { BLLstore BLLstore = new BLLstore(); String s = Request.QueryString["storeid"]; Store store = new Store(); store = BLLstore.getStore(Convert.ToInt16(s)); comments = new List<Comment>(); try { storename = store.name; city = store.city; type = store.Type.name; tag1 = store.tag1; tag2 = store.tag2; viewStoreMap.Width = 600; viewStoreMap.Height = 250; GLatLng p = new GLatLng(store.latitude, store.longitude); GMarker m = new GMarker(p); viewStoreMap.setCenter(p, 16); viewStoreMap.addGMarker(m); comments = BLLstore.getCommentsForStore(store.id); rptComments.DataSource = comments; rptComments.DataBind(); } catch(Exception ex) { Response.Write(ex.Message); } }
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) { 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(!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) { 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; } }
public void mapa(double lat, double lon, string _nombres, int _items_entregados, int _entregas) { GLatLng ubicacion = new GLatLng(lat, lon); GMap.setCenter(ubicacion, 15); //Establecemos alto y ancho en px GMap.Height = 600; GMap.Width = 940; //Adiciona el control de la parte izq superior (moverse, ampliar y reducir) GMap.Add(new GControl(GControl.preBuilt.LargeMapControl)); //GControl.preBuilt.MapTypeControl: permite elegir un tipo de mapa y otro. GMap.Add(new GControl(GControl.preBuilt.MapTypeControl)); //Con esto podemos definir el icono que se mostrara en la ubicacion //#region Crear Icono GIcon iconPropio = new GIcon(); iconPropio.image = "../Images/marcadornestle1.png"; iconPropio.shadow = "../Images/marcadorsombranestle1.png";; iconPropio.iconSize = new GSize(32, 32); iconPropio.shadowSize = new GSize(29, 16); iconPropio.iconAnchor = new GPoint(10, 18); iconPropio.infoWindowAnchor = new GPoint(10, 9); //#endregion //Pone la marca de gota de agua con el nombre de la ubicacion GMarker marker = new GMarker(ubicacion, iconPropio); string strMarker = "<div style='width: 200px; border-radius: 35px; ; height: 150px'><b>" + "<span style='color:#ff7e00'>Establecimiento: </span>" + _nombres + "</b><br>" + " Items Entregados: " + _items_entregados + " <br /> Cantidad de Entregas: " + _entregas + "<br />" + "" + "<br /><br><br></div>"; /*string strMarker = "<div style='width: 250px; height: 185px'><b>" + * "<span style='color:#ff7e00'>es</span>ASP.NET</b><br>" + * " C/ C/ Nombre de Calle, No X <br /> 28031 Madrid, España <br />" + * "Tel: +34 902 00 00 00 <br />Fax: +34 91 000 00 00<br />" + * "Web: <a href='http://www.esASP.net/' class='txtBKM' >www.esASP.net</a>" + * "<br />Email: <a href='mailto:[email protected]' class='txtBKM'>" + * "[email protected]</a><br><br></div>"; */ GInfoWindow window = new GInfoWindow(marker, strMarker, false, GListener.Event.mouseover); GMap.Add(window); GMap.enableHookMouseWheelToZoom = true; //Tipo de mapa a mostrar //GMap.mapType = GMapType.GTypes.Normal; GMapType.GTypes maptype = GMapType.GTypes.Normal; GLatLng latlong = new GLatLng(-0.185631, -78.484490); GMap.setCenter(latlong, 12, maptype); //Moverse con el cursor del teclado GMap.enableGKeyboardHandler = true; }
protected void Page_Load(object sender, EventArgs e) { BLLstore BLLstore = new BLLstore(); String s = Request.QueryString["storeid"]; Store store = new Store(); store = BLLstore.getStore(Convert.ToInt16(s)); comments = new List <Comment>(); try { storename = store.name; city = store.city; type = store.Type.name; tag1 = store.tag1; tag2 = store.tag2; viewStoreMap.Width = 600; viewStoreMap.Height = 250; GLatLng p = new GLatLng(store.latitude, store.longitude); GMarker m = new GMarker(p); viewStoreMap.setCenter(p, 16); viewStoreMap.addGMarker(m); comments = BLLstore.getCommentsForStore(store.id); rptComments.DataSource = comments; rptComments.DataBind(); } catch (Exception ex) { Response.Write(ex.Message); } }
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) { 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 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) { 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 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 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) { 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 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) { 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) //{ 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); } } //} }
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) { GLatLng latlng = new GLatLng(42.12, -1.145); GMap1.setCenter(latlng, 5, GMapType.GTypes.Hybrid); GMarker marker = new GMarker(latlng); GInfoWindowOptions windowOptions = new GInfoWindowOptions(12, GMapType.GTypes.Normal); //GShowMapBlowUp mbUp = new GShowMapBlowUp(marker, false, IWoptions); //GMap1.addShowMapBlowUp(mbUp); GInfoWindow mbUp = new GInfoWindow(marker, "I'm an infoWindow", windowOptions); GMap1.Add(mbUp); GMap1.Add(new GMarker(latlng + new GLatLng(2, 1))); GMarkerOptions markerOptions = new GMarkerOptions(); markerOptions.clickable = false; GMarker marker2 = new GMarker(latlng + new GLatLng(-1, 2.5), markerOptions); GMap1.Add(marker2); GMarker markerDraggable = new GMarker(latlng + new GLatLng(-2, -1)); GMarkerOptions mOpts = new GMarkerOptions(); mOpts.draggable = true; markerDraggable.options = mOpts; // string jsStart = "function() {" + GMap1.GMap_Id + ".closeInfoWindow();}"; // string jsEnd = "function() {" + markerDraggable.ID + ".openInfoWindowHtml('<a href=\"http://www.playsudoku.biz\" target=\"_blank\">Play Sudoku</a>');}"; string jsStart = "function() { if (typeof variable !== myInfoWindow) {myInfoWindow.close(); } }"; string jsEnd = "function() { myInfoWindow = new google.maps.InfoWindow({ content: '<a href=\"http://www.playsudoku.biz\" target=\"_blank\">Play Sudoku</a>' }); myInfoWindow.open(" + GMap1.GMap_Id + "," + markerDraggable.ID + "); }"; GMap1.Add(new GListener(markerDraggable.ID, GListener.Event.dragstart, jsStart)); GMap1.Add(new GListener(markerDraggable.ID, GListener.Event.dragend, jsEnd)); GMap1.Add(markerDraggable); }
protected string GMap1_Click(object s, Subgurim.Controles.GAjaxServerEventArgs e) { GMap gmap = new GMap(e.map); // GMarker and GInfoWindow GMarker marker = new GMarker(e.point); GInfoWindow window = new GInfoWindow(marker, "Cool!!", true); gmap.Add(window); // Movement //gmap.addMovement(1000, e.point + new GLatLng(25, 38)); //gmap.addMovement(1000, e.point); // Polylines if (e.point != e.center) { List<GLatLng> points = new List<GLatLng>(); points.Add(e.center); points.Add(e.point); gmap.Add(new GPolyline(points, Color.Yellow)); } // Controls gmap.Add(new GControl(GControl.extraBuilt.MarkCenter)); gmap.Add(new GControl(GControl.preBuilt.LargeMapControl)); gmap.Add(new GControl(GControl.preBuilt.MapTypeControl)); // Maybe... anything? ;) gmap.enableHookMouseWheelToZoom = false; gmap.mapType = GMapType.GTypes.Satellite; return gmap.ToString(); }
public void setFireUnitInfo(GMarker marker, GMarkerRect rect) { this.getmarker = marker; this.getrect = rect; if (getmarker != null) { clearField(); txtBatteryID.Text = main.detailMarkers[getmarker].GetFireUnitBatteryID(); txtDetail.Text = main.detailMarkers[getmarker].GetFireUnitDetail(); txtNumber.Text = main.detailMarkers[getmarker].GetFireUnitNumber(); txtPosition.Text = PositionConverter.ParsePointToString(main.detailMarkers[getmarker].GetFireUnitPoint(), cmbPosition.Text); cmbType.Text = main.detailMarkers[getmarker].GetFireUnitType(); if (main.detailMarkers[getmarker].GetFireUnitStatus() == "OP") { radioButton3.Checked = true; } else if (main.detailMarkers[getmarker].GetFireUnitStatus() == "Limited") { radioButton2.Checked = true; } else if (main.detailMarkers[getmarker].GetFireUnitStatus() == "NonOP") { radioButton1.Checked = true; } } }
protected void Page_Load(object sender, EventArgs e) { GMap1.Add(new GMapUI()); GMap1.GZoom = 2; GMap2.Add(new GMapUI()); GMap2.GZoom = 2; List <GMarker> markers = new List <GMarker>(); Random r = new Random(); for (int i = 0; i < 200; i++) { GMarker gMarker = new GMarker(new GLatLng(r.Next(0, 60), r.Next(-30, 30))); markers.Add(gMarker); GListener listener = new GListener(gMarker.ID, GListener.Event.click, string.Format(@"function () {{ var w = new google.maps.InfoWindow(); w.setContent('<center>{0}</center>'); w.open({1}, {2});}}", i, GMap1.GMap_Id, gMarker.ID)); GMap1.Add(listener); } GMap2.markerClusterer = new MarkerClusterer(markers); MarkerClustererStyleOptions markerClustererStyleOptions = new MarkerClustererStyleOptions(); markerClustererStyleOptions.textColor = Color.Yellow; MarkerClustererOptions markerClustererOptions = new MarkerClustererOptions(60, 10); MarkerClustererStyleOptions styleOptionsA = new MarkerClustererStyleOptions(); styleOptionsA.height = 36; styleOptionsA.width = 40; styleOptionsA.anchor_x = 6; styleOptionsA.anchor_y = 0; styleOptionsA.textColor = Color.Blue; styleOptionsA.url = "http://gmaps-utility-library.googlecode.com/svn/trunk/markerclusterer/1.0/images/conv40.png"; MarkerClustererStyleOptions styleOptionsB = new MarkerClustererStyleOptions(); styleOptionsB.height = 35; styleOptionsB.width = 35; styleOptionsB.anchor_x = 16; styleOptionsB.anchor_y = 0; styleOptionsB.textColor = Color.WhiteSmoke; styleOptionsB.url = "http://gmaps-utility-library.googlecode.com/svn/trunk/markerclusterer/1.0/images/people35.png"; markerClustererOptions.markerClustererStylesOptions.Add(styleOptionsA); markerClustererOptions.markerClustererStylesOptions.Add(styleOptionsB); MarkerClusterer markerClusterer = new MarkerClusterer(markers, markerClustererOptions); GMap1.markerClusterer = markerClusterer; }
private void btnAddMarker_Click(object sender, EventArgs e) { string name = txtNumber.Text; PointLatLng point = PositionConverter.ParsePointFromString(txtPosition.Text); foreach (Control c in Controls) { if (c is TextBox) { if (c.Text == "") { if (c != txtRemark) { MessageBox.Show("กรุณากรอกข้อมูลให้ครบถ้วน", "คำเตือน", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } } } } if (editMode == true) { main.detailMarkers.Remove(getmarker); main.markerOverlay.Markers.Remove(getmarker); main.markerOverlay.Markers.Remove(getrect); AutoIncrementID -= 1; Image image = Image.FromFile("Images/icon/FIxedPoint.png"); GMarker marker = new GMarker(point, name, image); GMarkerRect rect = new GMarkerRect(marker); //Add Data to dictionary FixedPoint fixedPoint = new FixedPoint("FP" + "0" + (AutoIncrementID += 1).ToString(), txtNumber.Text, checkType, txtLabel.Text, checkSIM, txtRemark.Text, point); main.detailMarkers.Add(marker, fixedPoint); // TODO : Manage data before adding to overlay main.markerOverlay.Markers.Add(marker); main.markerOverlay.Markers.Add(rect); this.seteditMode(false); MessageBox.Show("แก้ไขสำเร็จ"); clearField(); } else { // TODO : Selecting image to display as marker Image image = Image.FromFile("Images/icon/FIxedPoint.png"); GMarker marker = new GMarker(point, name, image); GMarkerRect rect = new GMarkerRect(marker); //Add Data to dictionary FixedPoint fixedPoint = new FixedPoint("FP" + "0" + (AutoIncrementID += 1).ToString(), txtNumber.Text, checkType, txtLabel.Text, checkSIM, txtRemark.Text, point); main.detailMarkers.Add(marker, fixedPoint); // TODO : Manage data before adding to overlay main.markerOverlay.Markers.Add(marker); main.markerOverlay.Markers.Add(rect); MessageBox.Show("เพิ่มมาร์คเกอร์ " + marker.Name + " บนแผนที่แล้ว", "FixedPoint Marker"); clearField(); } }
protected void MuestraUbicacionEnMapa(Double latitud, double longitud, string mensajeVentana, int zoom) { MapaPrueba.setCenter(new GLatLng(latitud, longitud), zoom, TipoMapa); Marcador = new GMarker(new GLatLng(latitud, longitud)); Marcador.options = MarketOPciones; Session["Marcador"] = Marcador; ventana = new GInfoWindow(Marcador, mensajeVentana, true); MapaPrueba.Add(ventana); }
public void mostrarDireccion(string lat, string lng) { gmap1.resetMarkers(); gmap1.setCenter(new GLatLng(Convert.ToDouble(lat), Convert.ToDouble(lng)), 17); GLatLng latlng = new GLatLng(Convert.ToDouble(lat), Convert.ToDouble(lng)); GMarker ii = new GMarker(latlng); gmap1.Add(ii); }
private void setupMap() { GLatLng latLng = new GLatLng(40, 10); GMap1.GCenter = latLng; GMarker marker = new GMarker(latLng); GMap1.Add(marker); }
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) { GMap1.addControl(new GControl(GControl.preBuilt.GOverviewMapControl)); GMap1.addControl(new GControl(GControl.preBuilt.LargeMapControl)); GMarker marker = new GMarker(new GLatLng(39.5, -3.2)); GInfoWindow window = new GInfoWindow(marker, "<center><b>GoogleMaps.Subgurim.NET</b></center>", true); GMap1.addInfoWindow(window); }
protected void Page_Load(object sender, EventArgs e) { GLatLng latLng = new GLatLng(40, 0); GMarker marker = new GMarker(latLng); marker.AddMarkerTracker(); GMap1.Add(marker); GMap1.GCenter = latLng + new GLatLng(8, 8); }
private void CargarMapa(string region, string provincia, string comuna, string direccion, GLatLng coordenadas) { //GLatLng ubicacion = new GLatLng(coordenadas); GMap1.setCenter(coordenadas, 15); GMap1.Height = 460; GMap1.Width = 560; //Adiciona el control de la parte izq superior (moverse, ampliar y reducir) GMap1.addControl(new GControl(GControl.preBuilt.LargeMapControl)); //GControl.preBuilt.MapTypeControl: permite elegir un tipo de mapa y otro. GMap1.addControl(new GControl(GControl.preBuilt.MapTypeControl)); //Pone la marca de gota de agua con el nombre de la ubicacion GMarker marker = new GMarker(coordenadas); string strMarker = "<div style='width: 185px; height: 100px'><b>" + "SGME_MAPS</b><br> " + region + "<br />" + comuna + ", " + provincia + "<br />" + "" + direccion + "</div>"; GInfoWindow window = new GInfoWindow(marker, strMarker, true); GMap1.addInfoWindow(window); GMap1.enableHookMouseWheelToZoom = true; //Tipo de mapa a mostrar GMap1.mapType = GMapType.GTypes.Normal; //Moverse con el cursor del teclado GMap1.enableGKeyboardHandler = true; GMap1.ShowMapTypeControl = true; //GMap1.GZoom = 9; //GMap1.Add(new GControl(GControl.preBuilt.LargeMapControl)); //GeoCoding geoCoding = new GeoCoding(); //geoCoding.show = GeoCoding.ShowEnum.infowindow; //geoCoding.openedOnLoad = true; //geoCoding.errorText = "Not found"; //geoCoding.buttonText = "Search"; //geoCoding.infoText = "GeoCode"; //geoCoding.baseCountryCode = "au"; // Search Newcastle, and you'll find it elsewhere... //// geoCoding.viewport = new GLatLngBounds(new GLatLng(44, 14), new GLatLng(46, 16)); //geoCoding.showErrorCode = true; //GMap1.Add(geoCoding); //Con esto podemos definir el icono que se mostrara en la ubicacion //#region Crear Icono //GIcon iconPropio = new GIcon(); //iconPropio.image = "../images/iconBuilding.png"; //iconPropio.shadow = "../images/iconBuildingS.png"; //iconPropio.iconSize = new GSize(32, 32); //iconPropio.shadowSize = new GSize(29, 16); //iconPropio.iconAnchor = new GPoint(10, 18); //iconPropio.infoWindowAnchor = new GPoint(10, 9); //#endregion }
// Methods protected void btnSearchByKeyword_Click(object sender, EventArgs e) { GeoCode code = GMap.geoCodeRequest(this.GetKeywords(), this.ctlGoogleMap.Key); if (code.Status.code == 200) { this.ctlGoogleMap.setCenter(code.Placemark.coordinates); GMarker gMarker = new GMarker(code.Placemark.coordinates); GInfoWindow infoWindow = new GInfoWindow(gMarker, "<center><b>" + code.Placemark.address + "</b></center>", false, GListener.Event.mouseover); this.ctlGoogleMap.addInfoWindow(infoWindow); } }
protected void Page_Load(object sender, EventArgs e) { GMap1.Add(new GMapUI()); GMap1.GZoom = 2; GMap2.Add(new GMapUI()); GMap2.GZoom = 2; List<GMarker> markers = new List<GMarker>(); Random r = new Random(); for (int i = 0; i < 200; i++) { GMarker gMarker = new GMarker(new GLatLng(r.Next(0, 60), r.Next(-30, 30))); markers.Add(gMarker); GListener listener = new GListener(gMarker.ID, GListener.Event.click, string.Format(@"function () {{ var w = new google.maps.InfoWindow(); w.setContent('<center>{0}</center>'); w.open({1}, {2});}}", i, GMap1.GMap_Id, gMarker.ID)); GMap1.Add(listener); } GMap2.markerClusterer = new MarkerClustererPlus(markers); MarkerClustererPlusStyleOptions markerClustererStyleOptions = new MarkerClustererPlusStyleOptions(); markerClustererStyleOptions.textColor = Color.Yellow; MarkerClustererPlusOptions markerClustererOptions = new MarkerClustererPlusOptions(60, 10); MarkerClustererPlusStyleOptions styleOptionsA = new MarkerClustererPlusStyleOptions(); styleOptionsA.height = 36; styleOptionsA.width = 40; styleOptionsA.anchor_x = 6; styleOptionsA.anchor_y = 0; styleOptionsA.textColor = Color.Blue; styleOptionsA.FontFamily = "Verdana"; styleOptionsA.url = "http://gmaps-utility-library.googlecode.com/svn/trunk/markerclusterer/1.0/images/conv40.png"; MarkerClustererPlusStyleOptions styleOptionsB = new MarkerClustererPlusStyleOptions(); styleOptionsB.height = 35; styleOptionsB.width = 35; styleOptionsB.anchor_x = 16; styleOptionsB.anchor_y = 0; styleOptionsB.textColor = Color.WhiteSmoke; styleOptionsB.TextDecoration = "underline"; styleOptionsB.url = "http://gmaps-utility-library.googlecode.com/svn/trunk/markerclusterer/1.0/images/people35.png"; markerClustererOptions.markerClustererStylesOptions.Add(styleOptionsA); markerClustererOptions.markerClustererStylesOptions.Add(styleOptionsB); markerClustererOptions.Title = "Using Clusterer Plus"; MarkerClustererPlus markerClusterer = new MarkerClustererPlus(markers, markerClustererOptions); GMap1.markerClusterer = markerClusterer; }
protected string GMap1_Click(object s, GAjaxServerEventArgs e) { GMarker marker = new GMarker(e.point); GInfoWindow window = new GInfoWindow(marker, string.Format(@"<b>GLatLngBounds</b><br />SW = {0}<br/>NE = {1}", e.bounds.getSouthWest().ToString(), e.bounds.getNorthEast().ToString()) , true); return window.ToString(e.map); }
protected void Page_Load(object sender, EventArgs e) { //مواقع البيوت على الخريطه //some test //مدينة بغداد GLatLng latlng = new GLatLng(33.303708016355245, 44.3720680475235); GLatLng latlng1 = new GLatLng(33.30494095074294, 44.3713653087616); GLatLng latlng2 = new GLatLng(33.306223184015565, 44.37358617782593); //مدينة كربلاء GLatLng latlng3 = new GLatLng(32.615039238431486, 44.03835028409958); GLatLng latlng4 = new GLatLng(32.61548656961024, 44.03770387172699); GLatLng latlng5 = new GLatLng(32.61622759816053, 44.037339091300964); GMap1.enableHookMouseWheelToZoom = true; GMap1.setCenter(latlng, 7, GMapType.GTypes.Hybrid); //اضهار صورة مقربة للموقع //GMarker marker = new GMarker(latlng); //GInfoWindowOptions IWoptions = new GInfoWindowOptions(17, GMapType.GTypes.Hybrid); //GShowMapBlowUp mbUp = new GShowMapBlowUp(marker, false, IWoptions); //gMap.addShowMapBlowUp(mbUp); GInfoWindowTabs iwTabs = new GInfoWindowTabs(); GMarker icono1 = new GMarker(latlng); iwTabs.gMarker = icono1; iwTabs.point = latlng; List<GInfoWindowTab> tabs = new List<GInfoWindowTab>(); tabs.Add(new GInfoWindowTab("معلومات عامه " , "نكتب بعض المعلومات")); tabs.Add(new GInfoWindowTab("صور ", "نضغ بعض الصور")); tabs.Add(new GInfoWindowTab("الإتصال ", "<div class='info' >الإتصال بالمكتب العقاري</div>")); iwTabs.tabs = tabs; GMap1.addInfoWindowTabs(iwTabs); GMarker icono2 = new GMarker(latlng3); GInfoWindow window2 = new GInfoWindow(icono2, "عماره <b>عماره سلام ان شاء الله</b>", false, GListener.Event.click); GMap1.addInfoWindow(window2); GInfoWindowTabs iwTabs2 = new GInfoWindowTabs(); GMarker icono = new GMarker(latlng5); iwTabs2.gMarker = icono; iwTabs2.tabs = tabs; GMap1.addInfoWindowTabs(iwTabs2); }
protected void Page_Load(object sender, EventArgs e) { GMap1.Visible = true; GMap2.Visible = false; GMap3.Visible = false; if (cbodistritos.SelectedValue.ToString() == "1") { lbldireccion.Text = "Av. Oscar R. Benavides, 4706 - Bellavista"; GLatLng latlng = new GLatLng(-12.053183880322681, -77.09490269422531); GMap1.setCenter(latlng, 17, GMapType.GTypes.Hybrid); GMarker marker = new GMarker(latlng); GInfoWindowOptions IWoptions = new GInfoWindowOptions(12, GMapType.GTypes.Normal); GInfoWindow mbUp = new GInfoWindow(marker, "Av. Oscar R. Benavides, 4706 - Bellavista", IWoptions); GMap1.addInfoWindow(mbUp); GMap1.addGMarker(new GMarker(latlng + new GLatLng(2, 1))); GMap1.enableHookMouseWheelToZoom = true; } else if (cbodistritos.SelectedValue.ToString() == "2") { lbldireccion.Text = "Av. Arequipa 2210 - Lince"; GMap2.Visible = true; GMap1.Visible = false; GMap3.Visible = false; GLatLng latlng = new GLatLng(-12.086198524323004, -77.0346736907959); GMap2.setCenter(latlng, 17, GMapType.GTypes.Hybrid); GMarker marker = new GMarker(latlng); GInfoWindowOptions IWoptions = new GInfoWindowOptions(12, GMapType.GTypes.Normal); GInfoWindow mbUp = new GInfoWindow(marker, "Av. Arequipa 2210 - Lince", IWoptions); GMap2.addInfoWindow(mbUp); GMap2.addGMarker(new GMarker(latlng + new GLatLng(2, 1))); GMap2.enableHookMouseWheelToZoom = true; } else if (cbodistritos.SelectedValue.ToString() == "3") { lbldireccion.Text = "Av. Larco 2210 - Miraflores"; GMap3.Visible = true; GMap2.Visible = false; GMap1.Visible = false; GLatLng latlng = new GLatLng(-12.120984474783656, -77.02883720397949); GMap3.setCenter(latlng, 17, GMapType.GTypes.Hybrid); GMarker marker = new GMarker(latlng); GInfoWindowOptions IWoptions = new GInfoWindowOptions(12, GMapType.GTypes.Normal); GInfoWindow mbUp = new GInfoWindow(marker, "Av. Larco 2210 - Miraflores", IWoptions); GMap3.addInfoWindow(mbUp); GMap3.addGMarker(new GMarker(latlng + new GLatLng(2, 1))); GMap3.enableHookMouseWheelToZoom = true; } }
protected string OnGoogleMapClick(object s, GAjaxServerEventArgs e) { GMarker marker = new GMarker(e.point); GInfoWindow window = new GInfoWindow(marker, string.Format( @"<b>GLatLngBounds</b><br/>NE = {0}", e.bounds.getNorthEast()), true); this.coordinates = e.bounds.getNorthEast().ToString().Split(','); return window.ToString(e.map); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { GLatLng ubicacion = new GLatLng(40.381090863719436, -3.6222052574157715); GMap1.setCenter(ubicacion, 15); //Establecemos alto y ancho en px GMap1.Height = 560; GMap1.Width = 660; //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)); //Con esto podemos definir el icono que se mostrara en la ubicacion //#region Crear Icono //GIcon iconPropio = new GIcon(); //iconPropio.image = "../images/iconBuilding.png"; //iconPropio.shadow = "../images/iconBuildingS.png"; //iconPropio.iconSize = new GSize(32, 32); //iconPropio.shadowSize = new GSize(29, 16); //iconPropio.iconAnchor = new GPoint(10, 18); //iconPropio.infoWindowAnchor = new GPoint(10, 9); //#endregion //Pone la marca de gota de agua con el nombre de la ubicacion GMarker marker = new GMarker(ubicacion); string strMarker = "<div style='width: 250px; height: 185px'><b>" + "<span style='color:#ff7e00'>es</span>ASP.NET</b><br>" + " C/ C/ Nombre de Calle, No X <br /> 28031 Madrid, España <br />" + "Tel: +34 902 00 00 00 <br />Fax: +34 91 000 00 00<br />" + "Web: <a href='http://www.esASP.net/' class='txtBKM' >www.esASP.net</a>" + "<br />Email: <a href='mailto:[email protected]' class='txtBKM'>" + "[email protected]</a><br><br></div>"; GInfoWindow window = new GInfoWindow(marker, strMarker, true); GMap1.Add(window); 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) { GLatLng latlng = new GLatLng(44, 9); GLatLng relativo = new GLatLng(2, -6); GMarker marker1 = new GMarker(latlng + relativo); GMarker marker2 = new GMarker(latlng - relativo); GMarker marker3 = new GMarker(latlng + relativo + relativo); GMap1.setCenter(latlng, 4, GMapType.GTypes.Hybrid); GInfoWindow window = new GInfoWindow(latlng, "InfoWindow. Close me please."); GInfoWindowOptions options1 = new GInfoWindowOptions(); options1.onCloseFn = "function(){alert('Thanks! You have closed me ;D')}"; window.options = options1; GMap1.Add(window); }
protected void Page_Load(object sender, EventArgs e) { GMap1.setCenter(new GLatLng(35.014975, 135.782479), 17); ExtStreetViewControl extStreetViewControl = new ExtStreetViewControl(); //extStreetViewControl.controlStatus = ExtStreetViewControl.ControlStatusEnum.MINI; //extStreetViewControl.hidden = true; //extStreetViewControl.latlng = new GLatLng(35, 135.7); extStreetViewControl.mainContent = ExtStreetViewControl.MainContentEnum.STREETVIEW; //extStreetViewControl.pov = new GPov(1, 1, 1); extStreetViewControl.size = new GSize(200, 150); GMarker marker = new GMarker(new GLatLng(35.014975, 135.782479)); extStreetViewControl.marker = marker; GMap1.Add(new GControl(extStreetViewControl)); }
protected void Page_Load(object sender, EventArgs e) { GMarker marker = new GMarker(new GLatLng(35.68, 139.69)); InfoBoxOptions options = new InfoBoxOptions(); options.PixelOffset = new GSize(-140, 0); options.BoxStyle = "{ opacity: 0.75, width: '280px' }"; InfoBox infoBox = new InfoBox(marker, "<div class=\"box\">I'm an info box!</div>", true, options); GMap1.Add(new GControl(GControl.preBuilt.ScaleControl)); GMap1.setCenter(new GLatLng(35.68, 139.69)); GMap1.Add(infoBox); }
protected void btnGetCoords_Click(object sender, EventArgs e) { string[] location = new string[2]; location[0] = hdnLat.Value; location[1] = hdnLong.Value; double x = Double.Parse(location[0], System.Globalization.CultureInfo.GetCultureInfo("en-us")); double y = Double.Parse(location[1], System.Globalization.CultureInfo.GetCultureInfo("en-us")); GLatLng p = new GLatLng(x, y); GMarker m = new GMarker(p); addStoreMap.setCenter(p, 16); addStoreMap.addGMarker(m); btnSubmitStore.Visible = true; }
protected void Page_Load(object sender, EventArgs e) { GMap1.setCenter(new GLatLng(41, 3), 3); GMap1.Add(new GControl(GControl.preBuilt.LargeMapControl)); GMarker m1 = new GMarker(new GLatLng(41, 3)); MarkerManager mManager = new MarkerManager(); mManager.Add(m1, 2); List<GMarker> mks = new List<GMarker>(); List<GInfoWindow> iws = new List<GInfoWindow>(); Random r = new Random(); double ir1, ir2; GMarker mkr; for (int i = 0; i < 10; i++) { ir1 = (double)r.Next(40) / 10.0 - 2.0; ir2 = (double)r.Next(40) / 10.0 - 2.0; mkr = new GMarker(m1.point + new GLatLng(ir1, ir2)); mks.Add(mkr); GMap1.Add(new GListener(mkr.ID, GListener.Event.click, "function(){alert('" + i + "');}")); } for (int i = 0; i < 5; i++) { ir1 = (double)r.Next(40) / 20.0 - 1; ir2 = (double)r.Next(40) / 20.0 - 1; mkr = new GMarker(m1.point + new GLatLng(ir1, ir2)); GInfoWindow window = new GInfoWindow(mkr, i.ToString()); iws.Add(window); } mManager.Add(mks, 6, 8); mManager.Add(iws, 7, 8); GMap1.markerManager = mManager; }
public void LlenarMapaConClientes(ArrayList clientes, GMap map) { GLatLng ubicacion; GMarker marker; string strMarker; foreach (ZoCliente c in clientes) { ubicacion = new GLatLng(c.Latitud, c.Longitud); //Pone la marca de gota de agua con el nombre de la ubicacion marker = new GMarker(ubicacion); strMarker = "<div style='width: 150px; height: 85px'><b>" + "<span style='color:#ff7e00'></span></b><br>" + " " + c.RazSoc + " <br /> " + c.DirSuc + " <br />" + "</div>"; GInfoWindow window = new GInfoWindow(marker, strMarker, false); map.Add(window); } }
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) { GLatLng latlng = new GLatLng(41, -3.2); GMap1.setCenter(latlng, 5); GIcon icon = new GIcon(); icon.image = "http://labs.google.com/ridefinder/images/mm_20_red.png"; icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png"; icon.iconSize = new GSize(12, 20); icon.shadowSize = new GSize(22, 20); icon.iconAnchor = new GPoint(6, 20); icon.infoWindowAnchor = new GPoint(5, 1); GMarkerOptions mOpts = new GMarkerOptions(); mOpts.clickable = false; mOpts.icon = icon; GMarker marker = new GMarker(latlng, mOpts); GMap1.Add(marker); }