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");
        }
    }
        protected string GMap1_ServerEvent(object s, GAjaxServerEventOtherArgs e)
        {
            string js = string.Empty;

            switch (e.eventName)
            {
            case "Click":
                GLatLng latlng = new GLatLng(
                    Convert.ToDouble(e.eventArgs[2], new System.Globalization.CultureInfo("en-US", false)),
                    Convert.ToDouble(e.eventArgs[3], new System.Globalization.CultureInfo("en-US", false)));

                GInfoWindowOptions options = new GInfoWindowOptions();
                options.onCloseFn = string.Format(@"
                function()
                {{
                    var ev = new serverEvent('InfoWindowClose', {0});
                    ev.addArg('My Argument');
                    ev.send();
                }}
            ", GMap1.GMap_Id);
                GInfoWindow window = new GInfoWindow(latlng, string.Format("Window Size (px): ({0},{1}). Close Me.", e.eventArgs[0], e.eventArgs[1]), options);

                //guardar punto
                Session["lat"] = latlng.lat.ToString();
                Session["lng"] = latlng.lng.ToString();

                js = window.ToString(e.who);
                break;
            }
            return(js);
        }
        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 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));
        }
Beispiel #5
0
    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 void Page_Load(object sender, EventArgs e)
        {
            GLatLng latlon = new GLatLng(41.65, 0.91);
            GMap1.setCenter(latlon, 4);

            GInfoWindowOptions options = new GInfoWindowOptions();
            options.zoomLevel = 14;
            options.mapType = GMapType.GTypes.Hybrid;

            GShowMapBlowUp mBlowUp = new GShowMapBlowUp(new GMarker(latlon), options);

            GMap1.Add(mBlowUp);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            GLatLng latlon = new GLatLng(41.65, 0.91);

            GMap1.setCenter(latlon, 4);

            GInfoWindowOptions options = new GInfoWindowOptions();

            options.zoomLevel = 14;
            options.mapType   = GMapType.GTypes.Hybrid;

            GShowMapBlowUp mBlowUp = new GShowMapBlowUp(new GMarker(latlon), options);

            GMap1.Add(mBlowUp);
        }
        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)
        {
            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.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));
        }
Beispiel #11
0
        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 (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 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);
    }
Beispiel #13
0
        public ActionResult LoadMap(GMap GMap1)
        {
            GMap1.Height = 450;
            GMap1.Width = 800;
            GMap1.enableDragging = true;
            GMap1.Language = "es";
            GMap1.enableHookMouseWheelToZoom = true;
            GMap1.enableGKeyboardHandler = true;

            GMap1.addControl(new GControl(GControl.preBuilt.GOverviewMapControl));
            GMap1.addControl(new GControl(GControl.preBuilt.LargeMapControl3D));
            GMap1.addControl(new GControl(new CarouselMapTypeControl()));
            GMap1.setCenter(new GLatLng(18.8, -70.2), 8);

            //Marker Santo Domingo

            GMarker markerStoDgo = new GMarker(new GLatLng(18.5016629749131, -69.796600313872));
            GInfoWindowOptions optionsStoDgo = new GInfoWindowOptions("Detalles Estadisticos de Santo Domingo", @"<div style='margin-top:60px'>
                                                                                                                    <table>
                                                                                                                        <tr>
                                                                                                                            <td style='width:450px'><b>Educacion</b></td>
                                                                                                                            <td style='width:450px'><b>Vivienda</b></td>
                                                                                                                            <td style='width:450px'><b>Empleo</b></td>
                                                                                                                            <td style='width:450px'><b>Salud</b></td>
                                                                                                                            <td style='width:450px'><b>Pobreza</b></td>
                                                                                                                            <td style='width:450px'><b>Poblacion</b></td>
                                                                                                                        </tr>
                                                                                                                        <tr>
                                                                                                                            <td style='width:450px'><a href='Home/Add/detalles.cshtml?provincia=SantoDomingo&tabla=Vacunacion'>a</a></td>
                                                                                                                            <td style='width:450px'><a href='http://google.com'>b</a></td>
                                                                                                                            <td style='width:450px'><a href='http://google.com'>c</a></td>
                                                                                                                            <td style='width:450px'><a href='http://google.com'>e</a></td>
                                                                                                                            <td style='width:450px'><a href='http://google.com'>f</a></td>
                                                                                                                            <td style='width:450px'><a href='http://google.com'>g</a></td>
                                                                                                                        </tr>
                                                                                                                    </table>
                                                                                                                </div>");
            GInfoWindow windowStoDgo = new GInfoWindow(markerStoDgo, "Santo Domingo", optionsStoDgo);
            GMap1.addInfoWindow(windowStoDgo);

            //GMarker markerStoDgo = new GMarker(new GLatLng(18.5016629749131, -69.796600313872));
            //GInfoWindow windowStoDgo = new GInfoWindow(markerStoDgo, "<center><a href='Santo Domingo'>Prueba<a></center>", true);
            //GMap1.addInfoWindow(windowStoDgo);

            ////Marker Samana

            //GMarker markerSamana = new GMarker(new GLatLng(19.2449631444, -69.4505309779197));
            //GInfoWindow windowSamana = new GInfoWindow(markerSamana, "<center><a href='Samana'>Prueba<a></center>", true);
            //GMap1.addInfoWindow(windowSamana);

            ////Marker La Romana

            //GMarker markerRomana = new GMarker(new GLatLng(18.5016629749131, -68.8957214076072));
            //GInfoWindow windowRomana = new GInfoWindow(markerRomana, "<center><a href='Romana'>Prueba<a></center>", true);
            //GMap1.addInfoWindow(windowRomana);

            ////Marker La San Cristobal

            //GMarker markerSanCris = new GMarker(new GLatLng(18.5381238176514, -70.1976012904197));
            //GInfoWindow windowsSanCris = new GInfoWindow(markerSanCris, "<center><a href='SanCristobal'>Prueba<a></center>", true);
            //GMap1.addInfoWindow(windowsSanCris);

            ////Marker La San Barahona

            //GMarker markerBarahona = new GMarker(new GLatLng(18.136629600166, -71.2193298060447));
            //GInfoWindow windowsBarahona = new GInfoWindow(markerBarahona, "<center><a href='Barahona'>Prueba<a></center>", true);
            //GMap1.addInfoWindow(windowsBarahona);

            return View();
        }
Beispiel #14
0
        protected void btnViewStore_Click(object sender, EventArgs e)
        {
            Storewebservice.StoredetailsService st = new Storewebservice.StoredetailsService();
            Storewebservice.Storedetails details = st.getstoredetails(txtStore.Text);
            lblStorename.Text = details.method_storename;
            lblst.Text = details.method_storestreet;
            lblstorecity.Text = details.method_storecity;
            lblstoreZip.Text = details.method_storezip;
            lblPhnum.Text = details.method_storephone;
            //string address = details.method_storestreet+", " +details.method_storecity + "," + details.method_storezip;
            string address = "63rd and holmes, Kansas City, Missouri";
            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();
                    }

                }

                lblLat.Text = latitude1;
                lblLong.Text = longitude1;
                GMap1.addGMapUI(new GMapUI());
                GMapUIOptions options = new GMapUIOptions();
                GLatLng latlong = new GLatLng(double.Parse(latitude1), double.Parse(longitude1));
                GMapType.GTypes maptype = GMapType.GTypes.Normal;
                GMap1.setCenter(latlong, 15, maptype);
                //GMap1.GZoom = 9;
                PinLetter pinLetter = new PinLetter("Y", Color.Yellow, Color.Black);

                GMap1.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);
                GMap1.addInfoWindow(mbUp);
                //GMarker gm = new GMarker(latlong);

                //GMap1.addGMarker(gm);

                // GMap1.addControl(new GControl(GControl.extraBuilt.MarkCenter));
                //GMap1.addControl(new GControl(GControl.extraBuilt.TextualCoordinatesControl));

                // Response.Redirect("http://maps.google.com/?q=" + latitude1 + "," + longitude1);
            }
            catch (Exception)
            {
                Response.Write("invalid adress");
            }
        }