예제 #1
0
 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);
 }
예제 #2
0
 protected void btnBuscarUbicacion_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(txtBusquedaUbicacion.Text))
     {
         string  key         = ConfigurationManager.AppSettings.Get("googlemaps.subgurim.net");
         GeoCode Informacion = GMap.geoCodeRequest(txtBusquedaUbicacion.Text, key);
         MapaPrueba.resetInfoWindows();
         Marcador = new GMarker(Informacion.Placemark.coordinates);
         PlantillaMensajeVentana = "<center>" + Informacion.Placemark.address + "</center>";
         MuestraUbicacionEnMapa(Marcador.point.lat, Marcador.point.lng, PlantillaMensajeVentana, 17);
     }
 }
예제 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            MapaPrueba.Language       = "es";
            MapaPrueba.GZoom          = 17;
            MapaPrueba.mapType        = TipoMapa;
            MapaPrueba.enableRotation = true;
            MarketOPciones.draggable  = true;
            Marcador.options          = MarketOPciones;
            MapaPrueba.Add(ventana);
            MapaPrueba.Add(new GMapUI());
            MapaPrueba.resetInfoWindows();
            if (Session["IdUsuario"] != null)
            {
                if (!IsPostBack)
                {
                    Session["MVDireccion"]         = MVDireccion;
                    Session["MVUsuario"]           = MVUsuario;
                    Session["MVTelefono"]          = MVTelefono;
                    Session["MVUbicacion"]         = MVUbicacion;
                    Session["MVCorreoElectronico"] = MVCorreoElectronico;
                    //Sesiones de la ubicacion
                    Session["TipoMapa"]                = TipoMapa;
                    Session["MarketOPciones"]          = MarketOPciones;
                    Session["Marcador"]                = Marcador;
                    Session["PlantillaMensajeVentana"] = PlantillaMensajeVentana;
                    Session["Zoom"]       = Zoom;
                    Session["DbLatitud"]  = DbLatitud;
                    Session["DbLongitud"] = DbLongitud;

                    MuestraPanel("General");

                    DDLDPais.DataSource     = MVDireccion.Paises();
                    DDLDPais.DataValueField = "UidPais";
                    DDLDPais.DataTextField  = "Nombre";
                    DDLDPais.DataBind();

                    MVTelefono.TipoDeTelefonos();
                    DDLDTipoDETelefono.DataSource     = MVTelefono.ListaDeTipoDeTelefono;
                    DDLDTipoDETelefono.DataValueField = "UidTipo";
                    DDLDTipoDETelefono.DataTextField  = "StrNombreTipoDeTelefono";
                    DDLDTipoDETelefono.DataBind();

                    EstatusPanelDatosGenerales(false);
                    EstatusControlesTelefono(false);
                    Cargausuario(Session["IdUsuario"].ToString());

                    EstatusDeCamposDeDireccion(false);
                    DgvDirecciones.Enabled = true;
                    PanelMensaje.Visible   = false;
                }
                else
                {
                    MVDireccion         = (VMDireccion)Session["MVDireccion"];
                    MVUsuario           = (VMUsuarios)Session["MVUsuario"];
                    MVTelefono          = (VMTelefono)Session["MVTelefono"];
                    MVUbicacion         = (VMUbicacion)Session["MVUbicacion"];
                    MVCorreoElectronico = (VMCorreoElectronico)Session["MVCorreoElectronico"];
                    //Sesiones de la ubicacion
                    TipoMapa                = (GMapType.GTypes)Session["TipoMapa"];
                    MarketOPciones          = (GMarkerOptions)Session["MarketOPciones"];
                    Marcador                = (GMarker)Session["Marcador"];
                    PlantillaMensajeVentana = (string)Session["PlantillaMensajeVentana"];
                    Zoom = (int)Session["Zoom"];
                }
            }
            else
            {
                Response.Redirect("../Default/");
            }
        }