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 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 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;
        }
 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);
     }
 }
Example #5
0
        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);
            }
        }
Example #6
0
    //本函数为谷歌地图
    public int fillbranchmap(GMap GMap1, DataTable dt, ref string continue2class, ref string supplierlistcontentikang, ref string supplierlistcontentciming, ref string supplierlistcontentmeinian)
    {
        GMap1.reset();

        GMap1.Add(new GControl(GControl.preBuilt.GOverviewMapControl));
        GMap1.Add(new GControl(GControl.preBuilt.LargeMapControl));

        GIcon baseIcon = new GIcon();

        baseIcon.shadow           = "http://www.google.cn/mapfiles/shadow50.png";
        baseIcon.iconSize         = new GSize(20, 34);
        baseIcon.shadowSize       = new GSize(37, 34);
        baseIcon.iconAnchor       = new GPoint(9, 34);
        baseIcon.infoWindowAnchor = new GPoint(9, 2);

        GIcon       letteredIcon;
        GMarker     marker;
        GInfoWindow window;
        double      lat, lng, clat = 0.0, clng = 0.0;
        int         index = 0;
        string      letter, lilist = "", ballooncontent;

        supplierlistcontentikang   = "";
        supplierlistcontentciming  = "";
        supplierlistcontentmeinian = "";
        int itemik = 0, itemcm = 0, itemmn = 0;

        foreach (DataRow dr in dt.Rows)
        {
            letter             = ((char)((int)'A' + index++)).ToString();
            letteredIcon       = new GIcon(baseIcon);
            letteredIcon.image = "http://www.google.cn/mapfiles/marker" + letter + ".png";

            lat    = Convert.ToDouble(dr["lat"]);
            lng    = Convert.ToDouble(dr["lng"]);
            clat  += lat;
            clng  += lng;
            marker = new GMarker(new GLatLng(lat, lng), letteredIcon);

            string sgm = "http://ditu.google.cn/maps?q=" + Server.UrlEncode(Server.UrlEncode(dr["branch"].ToString())) + "&hl=zh-CN&ie=UTF8"
                         + "&ll=" + lat + "," + lng + "&hq=" + Server.UrlEncode(Server.UrlEncode(dr["address"].ToString())) + "&z=15";

            //string sgm = "http://ditu.google.cn/maps?q=" + dr["branch"].ToString() + "&hl=zh-CN&ie=UTF8"
            //+ "&ll=" + lat + "," + lng + "&hq=" + dr["address"].ToString() + "&z=15";

            ballooncontent = "<center><b>" + dr["supplier"].ToString() + "</b><br />"
                             + "<A href='javascript:void(window.open(\"" + sgm + "\",\"_blank\"));'>" + dr["branch"].ToString() + "</A><br />"
                             + "</center>";
            window = new GInfoWindow(marker, ballooncontent, false);
            GMap1.Add(window);

            if (dt.Rows.Count == 1)
            {
                continue2class = "";
                lilist         = fillsupplierlist(index, letteredIcon.image, dr["supplier"].ToString(), dr["branch"].ToString(), dr["address"].ToString(), dr["id"].ToString(), true) + "\n\n";
            }
            else
            {
                lilist = fillsupplierlist(index, letteredIcon.image, dr["supplier"].ToString(), dr["branch"].ToString(), dr["address"].ToString(), dr["id"].ToString(), false) + "\n\n";
            }

            if (dr["supplier"].ToString() == "爱康国宾")
            {
                supplierlistcontentikang += lilist;
                itemik++;
            }
            else if (dr["supplier"].ToString() == "美年大健康")
            {
                supplierlistcontentmeinian += lilist;
                itemmn++;
            }
            else //if (dr["supplier"].ToString() == "慈铭体检")
            {
                supplierlistcontentciming += lilist;
                itemcm++;
            }
        }


        clat /= dt.Rows.Count;
        clng /= dt.Rows.Count;
        GMap1.enableHookMouseWheelToZoom = true;
        GMap1.setCenter(new GLatLng(clat, clng), 12);

        int itemmax = Math.Max(itemik, Math.Max(itemmn, itemcm));

        return(itemmax);
    }