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");
        }
    }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }
예제 #4
0
        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);
        }
예제 #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            GMap1.Add(new GMapUI());

            GMapUIOptions options = new GMapUIOptions();
            options.maptypes_hybrid = false;
            options.keyboard = false;
            options.maptypes_physical = false;
            options.zoom_scrollwheel = false;

            GMap2.Add(new GMapUI(options));
        }
예제 #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            GMap1.Add(new GMapUI());

            GMapUIOptions options = new GMapUIOptions();

            options.maptypes_hybrid   = false;
            options.keyboard          = false;
            options.maptypes_physical = false;
            options.zoom_scrollwheel  = false;

            GMap2.Add(new GMapUI(options));
        }
예제 #7
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            GMap1.reset();

            GMap1.Add(new GMapUI());

            GMapUIOptions options = new GMapUIOptions();

            options.maptypes_hybrid   = false;
            options.keyboard          = false;
            options.maptypes_physical = false;
            options.zoom_scrollwheel  = false;

            GMap1.Add(new GControl(GControl.extraBuilt.TextualOnClickCoordinatesControl, new GControlPosition(GControlPosition.position.Top_Right)));
            GMap1.setCenter(new GLatLng(23.736819471992295, -99.14335536956787), 13);
            GMap1.enableGKeyboardHandler = true;
        }
예제 #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                GMap1.Add(new GMapUI());
                PGJ.ConnectServer();
                PGJ.CargaCombo(ddlDelito, "CAT_DELITO", "ID_DLTO", "DLTO");
                GMapUIOptions options = new GMapUIOptions();
                options.maptypes_hybrid   = false;
                options.keyboard          = false;
                options.maptypes_physical = false;
                options.zoom_scrollwheel  = false;

                GMap1.Add(new GControl(GControl.extraBuilt.TextualOnClickCoordinatesControl, new GControlPosition(GControlPosition.position.Top_Right)));
                GMap1.setCenter(new GLatLng(23.736819471992295, -99.14335536956787), 13);
                GMap1.enableGKeyboardHandler = true;
            }
        }
예제 #9
0
        private void InitializeGoogleMaps()
        {
            GMap1.Add(new GMapUI());

            GMapUIOptions options = new GMapUIOptions();
            options.maptypes_hybrid = false;
            options.keyboard = false;
            options.maptypes_physical = false;
            options.zoom_scrollwheel = true;

            GMap1.Add(new GMapUI(options));

            GControl control = new GControl(GControl.preBuilt.LargeMapControl);
            GControl control2 = new GControl(GControl.preBuilt.MenuMapTypeControl, new GControlPosition(GControlPosition.position.Top_Right));

            GMap1.Add(control);
            GMap1.Add(control2);

            GMap1.Add(new GControl(GControl.preBuilt.GOverviewMapControl, new GControlPosition(GControlPosition.position.Bottom_Left)));
        }
예제 #10
0
        private void InitializeGoogleMaps()
        {
            GMap1.Add(new GMapUI());

            GMapUIOptions options = new GMapUIOptions();

            options.maptypes_hybrid   = false;
            options.keyboard          = false;
            options.maptypes_physical = false;
            options.zoom_scrollwheel  = true;

            GMap1.Add(new GMapUI(options));

            GControl control  = new GControl(GControl.preBuilt.LargeMapControl);
            GControl control2 = new GControl(GControl.preBuilt.MenuMapTypeControl, new GControlPosition(GControlPosition.position.Top_Right));

            GMap1.Add(control);
            GMap1.Add(control2);

            GMap1.Add(new GControl(GControl.preBuilt.GOverviewMapControl, new GControlPosition(GControlPosition.position.Bottom_Left)));
        }
예제 #11
0
    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);
    }
예제 #12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["longitude"] == null || Session["latitude"] == null)
        {
            if (Request.Form["txtLng"] == null || Request.Form["txtLat"] == null)
            {
                Response.Redirect("~/requestLocation.aspx");
            }
            else
            {
                Session["longitude"] = Request.Form["txtLng"];
                Session["latitude"] = Request.Form["txtLat"];
            }
        }

        double myX = 0;
        double myY = 0;

        try
        {
            myX = Double.Parse(Session["longitude"].ToString(), System.Globalization.CultureInfo.GetCultureInfo("en-us"));
            myY = Double.Parse(Session["latitude"].ToString(), System.Globalization.CultureInfo.GetCultureInfo("en-us"));
        }
        catch (Exception)
        {
            Response.Redirect("~/overview.aspx");
        }

        GLatLng p1 = new GLatLng();

        p1.lat = myY;
        p1.lng = myX;

        GMap1.setCenter(p1, 15);

        GMap1.addGMapUI(new GMapUI());

        GMap1.Height = 400;
        GMap1.Width = 800;

        GMapUIOptions options = new GMapUIOptions();
        options.maptypes_hybrid = true;
        options.keyboard = true;
        options.maptypes_physical = true;
        options.zoom_scrollwheel = true;

        GIcon icoon = new GIcon();
        icoon.image = "img/userLocation.png";
        icoon.iconSize = new GSize(32, 32);
        icoon.shadowSize = new GSize(60, 32);

        GMarker marker1 = new GMarker(p1, icoon);
        GMap1.addGMarker(marker1);

        GInfoWindow userWindow = new GInfoWindow();
        userWindow.gMarker = marker1;
        userWindow.html = "<h3>U bevindt zich hier</h3>";
        GMap1.addInfoWindow(userWindow);

        Api api = new Api();
        XDocument doc = api.getApiData("stations/", "NL", "xml");

        foreach (XElement d in doc.Descendants("stations").Descendants("station"))
        {
            string lat = d.Attribute("locationY").Value;
            string lng = d.Attribute("locationX").Value;

            double y = Double.Parse(lat, System.Globalization.CultureInfo.GetCultureInfo("en-us"));
            double x = Double.Parse(lng, System.Globalization.CultureInfo.GetCultureInfo("en-us"));

            double distance = GetDistanceBetweenPoints(myX, myY, x, y);

            Station s = new Station(d.Value.ToString(), y, x, distance);
            stations.Add(s);
        }

        var stationsQueryAble = stations.AsQueryable();
        stationsQueryAble = stationsQueryAble.OrderBy(stat => stat.afstandTotHuidigeLocatie);

        stations = stationsQueryAble.ToList();

        for (int i = 0; i < 5; i++)
        {
            GLatLng p2 = new GLatLng();
            p2.lat = stations[i].locY;
            p2.lng = stations[i].locX;
            GMarker marker = new GMarker(p2);
            GMap1.addGMarker(marker);

            GInfoWindow win1 = new GInfoWindow();

            win1.gMarker = marker;
            win1.html = "<h3><a href='overview.aspx?station=" + stations[i].stationNaam + "'>" + stations[i].stationNaam + " station</a></h3><p>afstand: " + Math.Round(stations[i].afstandTotHuidigeLocatie, 2) + "km</p>";
            GMap1.addInfoWindow(win1);
        }
    }
예제 #13
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");
            }
        }
예제 #14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["IdUsuario"] == null)
            {
                Response.Redirect("Default.aspx");
            }
            if (!Page.IsPostBack)
            {
                HookOnFocus(this.Page as Control);
                ScriptManager.RegisterStartupScript(
                    this,
                    typeof(LugarHechos),
                    "ScriptDoFocus",
                    SCRIPT_DOFOCUS.Replace("REQUEST_LASTFOCUS", Request["__LASTFOCUS"]),
                    true);
                //--------
                Session["ID_LUGAR_HECHOS"] = Request.QueryString["ID_LUGAR_HECHOS"];

                Session["op"]   = Request.QueryString["op"];
                UNDD.Text       = Session["UNDD_DSCRPCION"].ToString();
                LBLUSUARIO.Text = Session["Us"].ToString();
                PUESTO.Text     = Session["PUESTO"].ToString();

                lblArbol.Text = Session["lblArbol"].ToString();
                GMap1.Add(new GMapUI());

                GMapUIOptions options = new GMapUIOptions();
                options.maptypes_hybrid   = false;
                options.keyboard          = false;
                options.maptypes_physical = false;
                options.zoom_scrollwheel  = false;

                GMap1.Add(new GControl(GControl.extraBuilt.TextualOnClickCoordinatesControl, new GControlPosition(GControlPosition.position.Top_Right)));
                GMap1.setCenter(new GLatLng(23.736819471992295, -99.14335536956787), 13);
                GMap1.enableGKeyboardHandler = true;

                if (Session["ID_ESTADO_NUC"] == null)
                {
                    Session["ID_ESTADO_NUC"] = "";
                }
                if (Session["ID_ESTADO_RAC"] == null)
                {
                    Session["ID_ESTADO_RAC"] = "";
                }
                if (Session["ID_ESTADO_NAC"] == null)
                {
                    Session["ID_ESTADO_NAC"] = "";
                }
                if (Session["ID_ESTADO_NUM"] == null)
                {
                    Session["ID_ESTADO_NUM"] = "";
                }
                if (Session["INICIAR_CARPETA"] == null)
                {
                    Session["INICIAR_CARPETA"] = "";
                }

                Session["ID_ESTADO_RAC"].ToString();
                Session["ID_ESTADO_NUC"].ToString();
                Session["ID_ESTADO_NAC"].ToString();
                Session["ID_ESTADO_NUM"].ToString();

                cargarFecha();
                //CARGAR FECHA DE INICIO Y HORA DE INICIO
                SqlCommand sqlFechaInicio = new SqlCommand("CargarFechaInicioExpedienteRobo ", Data.CnnCentral);
                sqlFechaInicio.CommandType = CommandType.StoredProcedure;
                sqlFechaInicio.Parameters.Add("@IdCarpeta", SqlDbType.Int);
                sqlFechaInicio.Parameters.Add("@IdMunicipioCarpeta", SqlDbType.Int);

                sqlFechaInicio.Parameters["@IdCarpeta"].Value          = int.Parse(Session["ID_CARPETA"].ToString());
                sqlFechaInicio.Parameters["@IdMunicipioCarpeta"].Value = int.Parse(Session["IdMunicipio"].ToString());

                SqlDataReader drFechaInicio = sqlFechaInicio.ExecuteReader();
                if (drFechaInicio.HasRows)
                {
                    drFechaInicio.Read();
                    txtFechaInicio.Text = drFechaInicio["FechaInicio"].ToString();
                }
                drFechaInicio.Close();


                if (Session["op"].ToString() == "Agregar")
                {
                    lblOperacion.Text    = "AGREGAR LUGAR DE LOS HECHOS";
                    IdCarpeta.Text       = Session["ID_CARPETA"].ToString();
                    cmdDelito.Enabled    = false;
                    lblOperacion.Visible = false;
                    try{
                        PGJ.CargaCombo(ddlTipoLugar, "CAT_LUGAR_TIPO", "ID_LGR_TPO", "LGR_TPO");
                        PGJ.CargaComboFiltrado(ddlMunicipio, "Cat_Municipio", "Id_Mncpio", "Mncpio", "Id_Pais=1 and Id_Estdo=28");
                        //cargarAgregarLugarHechos();
                        ddlTipoLugar.Items.Insert(0, "--SELECCIONE--");
                        ddlMunicipio.Items.Insert(0, "--SELECCIONE--");
                        ddlLocalidad.Items.Insert(0, "--SELECCIONE--");
                        ddlColonia.Items.Insert(0, "--SELECCIONE--");
                        ddlCalle.Items.Insert(0, "--SELECCIONE--");
                        ddlEntreCalle.Items.Insert(0, "--SELECCIONE--");
                        ddlYcalle.Items.Insert(0, "--SELECCIONE--");
                    }

                    catch (Exception ex)
                    {
                        Response.Redirect("LugarHechos.aspx?&op=Agregar");
                    }
                }
                else if (Session["op"].ToString() == "Modificar")
                {
                    //El Policia Investigador no puede modificar
                    if (Session["ID_PUESTO"].ToString() == "16" || Session["ID_PUESTO"].ToString() == "8")
                    {
                        cmdGuardar.Visible = false;
                    }

                    lblOperacion.Text = "CONSULTAR LUGAR DE LOS HECHOS";
                    cmdDelito.Enabled = true;
                    //try
                    //{
                    PGJ.CargaCombo(ddlTipoLugar, "CAT_LUGAR_TIPO", "ID_LGR_TPO", "LGR_TPO");
                    PGJ.CargaComboFiltrado(ddlMunicipio, "Cat_Municipio", "Id_Mncpio", "Mncpio", "Id_Pais=1 and Id_Estdo=28");
                    cargarLugarHechos();
                    llamarMapa();

                    PGJ.InsertarBitacora(int.Parse(Session["IdUsuario"].ToString()), Session["IP_MAQUINA"].ToString(), HttpContext.Current.Request.Url.AbsoluteUri, 5, "Consulto Lugar de Hechos IdLugarHechos=" + ID_LUGAR_HECHOS.Text + " IdCarpeta=" + Session["ID_CARPETA"], int.Parse(Session["IdModuloBitacora"].ToString()));

                    //}
                    //catch (Exception ex)
                    //{
                    //    Response.Redirect("LugarHechos.aspx?ID_LUGAR_HECHOS=" + Session["ID_LUGAR_HECHOS"].ToString() + "&op=Modificar");
                    //}
                }

                if (Session["op"].ToString() == "Agregar" && Session["INICIAR_CARPETA"].ToString() == "1")
                {
                    //INICIO-ocultando el menu cuando inicia carpeta

                    HyperLink linkRac = this.Page.Master.FindControl("hRac") as HyperLink;
                    linkRac.Text        = "";
                    linkRac.Visible     = false;
                    linkRac.Enabled     = false;
                    linkRac.NavigateUrl = "#";

                    HyperLink linkDerivada = this.Page.Master.FindControl("hDerivada") as HyperLink;
                    linkDerivada.Text        = "";
                    linkDerivada.Visible     = false;
                    linkDerivada.Enabled     = false;
                    linkDerivada.NavigateUrl = "#";

                    HyperLink linkNuc = this.Page.Master.FindControl("hlSec") as HyperLink;
                    linkNuc.Text        = "";
                    linkNuc.Visible     = false;
                    linkNuc.Enabled     = false;
                    linkNuc.NavigateUrl = "#";

                    HyperLink linkEstadistica = this.Page.Master.FindControl("hEstadistica") as HyperLink;
                    linkEstadistica.Text        = "";
                    linkEstadistica.Visible     = false;
                    linkEstadistica.Enabled     = false;
                    linkEstadistica.NavigateUrl = "#";

                    HyperLink linkBusqueda = this.Page.Master.FindControl("hBusquedaPersonasNSJP") as HyperLink;
                    linkBusqueda.Text        = "";
                    linkBusqueda.Visible     = false;
                    linkBusqueda.Enabled     = false;
                    linkBusqueda.NavigateUrl = "#";

                    HyperLink linkBusquedaPNL = this.Page.Master.FindControl("hBusquedaPNL") as HyperLink;
                    linkBusquedaPNL.Text        = "";
                    linkBusquedaPNL.Visible     = false;
                    linkBusquedaPNL.Enabled     = false;
                    linkBusquedaPNL.NavigateUrl = "#";

                    HyperLink linkEstadisticaNUC = this.Page.Master.FindControl("hEstadisticaNUC") as HyperLink;
                    linkEstadisticaNUC.Text        = "";
                    linkEstadisticaNUC.Visible     = false;
                    linkEstadisticaNUC.Enabled     = false;
                    linkEstadisticaNUC.NavigateUrl = "#";

                    HyperLink linkReportes = this.Page.Master.FindControl("HyperLinkEsta") as HyperLink;
                    linkReportes.Text        = "";
                    linkReportes.Visible     = false;
                    linkReportes.Enabled     = false;
                    linkReportes.NavigateUrl = "#";

                    HyperLink linkCS = this.Page.Master.FindControl("hCerrarSesion") as HyperLink;
                    linkCS.Text        = "";
                    linkCS.Visible     = false;
                    linkCS.Enabled     = false;
                    linkCS.NavigateUrl = "#";

                    //FIN-ocultando el menu cuando inicia carpeta
                }
            }
        }
예제 #15
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // niet gekend omdat dit al wordt uitgevoerd voor js? ergens anders zetten ipv page load?
        string location = lblLocation.Text;
        double myX = 51.025071;
        double myY = 4.483846;
        double shortestDistance = 0;
        double shortestDistanceInMeters = 0;
        string closestStation = "";

        double closestX;
        double closestY;

        GMap1.addGMapUI(new GMapUI());
        GMap1.Width = 800;
        GMap1.Height = 800;

        GMapUIOptions options = new GMapUIOptions();
        options.maptypes_hybrid = true;
        options.keyboard = true;
        options.maptypes_physical = true;
        options.zoom_scrollwheel = true;

        XmlDocument doc = new XmlDocument();
        string xmlPath = Server.MapPath("~/stations.xml");
        doc.Load(xmlPath);
        XmlNodeList nodeList = doc.DocumentElement.SelectNodes("station");

        foreach (XmlNode node in nodeList)
        {
                GLatLng p2 = new GLatLng();

                String lat = node.Attributes["locationX"].Value;
                String lng = node.Attributes["locationY"].Value;

                double y = Double.Parse(lat, System.Globalization.CultureInfo.GetCultureInfo("en-us"));
                double x = Double.Parse(lng, System.Globalization.CultureInfo.GetCultureInfo("en-us"));

                //
                double distance = afstandTussenTweePunten(myX, myY, x, y);

                if (shortestDistance == 0)
                {
                    shortestDistance = distance;
                }else if (distance < shortestDistance)
                {
                    closestX = x;
                    closestY = y;
                    shortestDistance = distance;
                    //shortestDistanceInMeters = shortestDistance / 10000000000000;
                    shortestDistanceInMeters = shortestDistance * 100000;
                    closestStation = node.InnerXml;
                }
                //

                p2.lat = x;
                p2.lng = y;

                GMarker marker = new GMarker(p2);
                GMap1.addGMarker(marker);

                GLatLng p1 = new GLatLng();
                p1.lat = x;
                p1.lng = y;

                if (node.InnerXml == closestStation)
                {
                    GMap1.setCenter(p1, 15);
                }

                GInfoWindow win1 = new GInfoWindow();
                win1.gMarker = marker;
                win1.html = "<h3>"+node.InnerXml+" station</h3>";
                GMap1.addInfoWindow(win1);
        }

        lblClosestStation.Text = "Het dichtstbijzijnde station is " + closestStation+", op een afstand van "+shortestDistanceInMeters+" meter";
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.Form["txtLat"] != null && Request.Form["txtLng"] != null)
        {
            var debugvar = Request.Form["txtLng"];
            Session["longitude"] = Request.Form["txtLng"];
            Session["latitude"] = Request.Form["txtLat"];
        }
        else
        {
            Response.Redirect("~/requestLocation.aspx");
        }

        double myX = Double.Parse(Session["longitude"].ToString(), System.Globalization.CultureInfo.GetCultureInfo("en-us"));
        double myY = Double.Parse(Session["latitude"].ToString(), System.Globalization.CultureInfo.GetCultureInfo("en-us"));

        double shortestDistance = 0;
        double shortestDistanceInMeters = 0;
        string closestStation = "";

        double closestX;
        double closestY;

        GLatLng p1 = new GLatLng();

        p1.lat = myY;
        p1.lng = myX;

        GMap1.setCenter(p1, 15);

        GMap1.addGMapUI(new GMapUI());

        GMap1.Height = 400;
        GMap1.Width = 800;

        GMapUIOptions options = new GMapUIOptions();
        options.maptypes_hybrid = true;
        options.keyboard = true;
        options.maptypes_physical = true;
        options.zoom_scrollwheel = true;

        GMarker marker1 = new GMarker();
        marker1.point = p1;
        GMap1.addGMarker(marker1);

        //beginnen met stations uit te lezen

        XmlDocument doc = new XmlDocument();
        string xmlPath = Server.MapPath("~/stations.xml");
        doc.Load(xmlPath);
        XmlNodeList nodeList = doc.DocumentElement.SelectNodes("station");

        foreach (XmlNode node in nodeList)
        {

            string lat = node.Attributes["locationY"].Value;
            string lng = node.Attributes["locationX"].Value;

            double y = Double.Parse(lng, System.Globalization.CultureInfo.GetCultureInfo("en-us"));
            double x = Double.Parse(lat, System.Globalization.CultureInfo.GetCultureInfo("en-us"));

            double distance = afstandTussenTweePunten(myX, myY, x, y);

            /*double distanceInMeters = distance / 10000000000000;
            distanceInMeters *= 100000000000000;*/

            if (distanceInMeters < 5000)
            {
                GLatLng p2 = new GLatLng();
                p2.lat = x;
                p2.lng = y;
                GMarker marker = new GMarker(p2);
                GMap1.addGMarker(marker);
                GInfoWindow win1 = new GInfoWindow();
                win1.gMarker = marker;
                win1.html = "<h3>" + node.InnerXml + " station</h3><p>afstand: " + distanceInMeters + "meter</p>";
                GMap1.addInfoWindow(win1);
            }
            else
            {

            }
        }
    }