private void InitializeMap() { Monitor.EnableTimer = false; Monitor.MultiplePopUps = true; var googleMapsEnabled = true; var usuario = DAOFactory.UsuarioDAO.FindById(WebSecurity.AuthenticatedUser.Id); if (usuario != null && usuario.PorEmpresa && usuario.Empresas.Count == 1) { var empresa = usuario.Empresas.First() as Empresa; if (empresa != null) { googleMapsEnabled = empresa.GoogleMapsEnabled; } } Monitor.Initialize(googleMapsEnabled); Monitor.AddLayers(LayerFactory.GetVector(Layers.Recorrido, true), LayerFactory.GetVector(Layers.MensajesDuracion, true), LayerFactory.GetVector(Layers.Geocercas, true), LayerFactory.GetMarkers(Layers.PuntosDeInteres, true), LayerFactory.GetMarkers(Layers.Mensajes, true), LayerFactory.GetMarkers(Layers.Eventos, true)); Monitor.AddControls(ControlFactory.GetToolbar(false, false, false, false, false, true, true)); Monitor.ZoomTo(8); Monitor.Hide(); //this.RegisterStartupJScript("map", string.Format("var map = $M('{0}');", (object) Monitor.MapDivId)); this.RegisterStartupJScript("map", string.Format("var map = null;", (object)Monitor.MapDivId)); }
protected void InitializeMonitor() { Monitor.DrawLine += MonitorDrawLine; Monitor.FeatureModified += MonitorFeatureModified; Monitor.EnableTimer = false; if (IsPostBack) { return; } Monitor.DrawLineMethod = EventMethods.PostBack; Monitor.ModFeatureMethod = EventMethods.PostBack; Monitor.ImgPath = Config.Monitor.GetMonitorImagesFolder(Page); Monitor.GoogleMapsScript = Config.Map.GoogleMapsKey; Monitor.AddLayers(LayerFactory.GetGoogleStreet(CultureManager.GetLabel("LAYER_GSTREET"), MinZoomLevel), //LayerFactory.GetCompumap(CultureManager.GetLabel("LAYER_COMPUMAP"), Config.Map.CompumapTiles, MIN_ZOOM_LEVEL), LayerFactory.GetOpenStreetMap(CultureManager.GetLabel("LAYER_OSM")), LayerFactory.GetGoogleSatellite(CultureManager.GetLabel("LAYER_GSAT"), MinZoomLevel), LayerFactory.GetGoogleHybrid(CultureManager.GetLabel("LAYER_GHIBRIDO"), MinZoomLevel), LayerFactory.GetGooglePhysical(CultureManager.GetLabel("LAYER_GFISICO"), MinZoomLevel), LayerFactory.GetVector(LayerRecorrido, true, StyleFactory.GetHandlePoint()), LayerFactory.GetMarkers(LayerMarkers, true)); Monitor.AddControls(ControlFactory.GetLayerSwitcher(), ControlFactory.GetNavigation(), ControlFactory.GetPanZoomBar(), ControlFactory.GetToolbar(false, false, false, true, false, true, false, false, LayerRecorrido)); if (MapLoad != null) { MapLoad(Monitor, EventArgs.Empty); } }
private void InitializeMap() { var googleMapsEnabled = true; var usuario = DAOFactory.UsuarioDAO.FindById(WebSecurity.AuthenticatedUser.Id); if (usuario != null && usuario.PorEmpresa && usuario.Empresas.Count == 1) { var empresa = usuario.Empresas.First() as Empresa; if (empresa != null) { googleMapsEnabled = empresa.GoogleMapsEnabled; } } Monitor.Initialize(googleMapsEnabled); Monitor.ImgPath = Config.Monitor.GetMonitorImagesFolder(this); Monitor.EnableTimer = false; Monitor.MultiplePopUps = true; Monitor.PostbackOnMoveZoom = 99; var showQtree = WebSecurity.IsSecuredAllowed(Securables.ViewQtree); if (showQtree) { Monitor.AddLayers(LayerFactory.GetVector("Qtree", true)); } Monitor.AddLayers( LayerFactory.GetVector(CultureManager.GetLabel("RECORRIDO"), true), LayerFactory.GetVector(CultureManager.GetLabel("REC_DESCARTADO"), false), LayerFactory.GetVector(CultureManager.GetLabel("EXCESOS_VELOCIDAD"), true), LayerFactory.GetVector(CultureManager.GetLabel("EXCESOS_VELOCIDAD_DESCARTADOS"), false), LayerFactory.GetVector(CultureManager.GetLabel("LAYER_GEOCERCAS"), true), LayerFactory.GetMarkers(CultureManager.GetLabel("LAYER_POI"), true), LayerFactory.GetMarkers(CultureManager.GetLabel("POSICIONES_REPORTADAS"), true), LayerFactory.GetMarkers(CultureManager.GetLabel("POS_DESCARTADAS"), false), LayerFactory.GetMarkers(CultureManager.GetLabel("EVENTOS"), true), LayerFactory.GetMarkers(CultureManager.GetLabel("EVENTOS_DESCARTADOS"), false) ); Monitor.AddControls(ControlFactory.GetToolbar(false, false, false, false, false, true, true)); if (showQtree) { var ctx = ControlFactory.GetContextMenu(); ctx.AddItem(new ContextMenuItem(ContextMenuItemBehaviourTypes.None, "Opciones", "", "olContextMenuTitle", true)); ctx.AddItem(ContextMenuItem.Separator); ctx.AddItem(new ContextMenuItem(ContextMenuItemBehaviourTypes.Postback, "Mostrar Qtree", "Qtree", "olContextMenuItem", true)); Monitor.AddControls(ctx); } Monitor.ZoomTo(8); GenerateScriptBase(); }
private void InitializeMap() { Monitor.Click += Monitor_Click; Monitor.ContextMenuPostback += Monitor_ContextMenuPostback; Monitor.MapMove += Monitor_MapMove; Monitor.DrawPolygon += Monitor_DrawPolygon; Monitor.DrawSquare += Monitor_DrawSquare; Monitor.DrawPolygonMethod = EventMethods.PostBack; Monitor.ClickMethod = EventMethods.PostBack; if (!IsPostBack) { Monitor.PostbackOnMoveZoom = 0; RegisterExtJsStyleSheet(); Monitor.ImgPath = Config.Monitor.GetMonitorImagesFolder(this); Monitor.GoogleMapsScript = Config.Map.GoogleMapsKey; Monitor.DefaultMarkerIcon = "salida.gif"; Monitor.AddLayers(LayerFactory.GetGoogleStreet(CultureManager.GetLabel("LAYER_GSTREET"), MinZoomLevel), //LayerFactory.GetCompumap(CultureManager.GetLabel("LAYER_COMPUMAP"), Config.Map.CompumapTiles, MinZoomLevel), LayerFactory.GetOpenStreetMap(CultureManager.GetLabel("LAYER_OSM")), LayerFactory.GetGoogleSatellite(CultureManager.GetLabel("LAYER_GSAT"), MinZoomLevel), LayerFactory.GetGoogleHybrid(CultureManager.GetLabel("LAYER_GHIBRIDO"), MinZoomLevel), LayerFactory.GetGooglePhysical(CultureManager.GetLabel("LAYER_GFISICO"), MinZoomLevel), LayerFactory.GetVector(LayerGeocercas, true), LayerFactory.GetVector("Vertices", true), LayerFactory.GetMarkers("Vertices 2", true)); var ctx = ControlFactory.GetContextMenu(); ctx.AddItem(new ContextMenuItem(ContextMenuItemBehaviourTypes.None, "Opciones", "", "olContextMenuTitle", true)); ctx.AddItem(ContextMenuItem.Separator); ctx.AddItem(new ContextMenuItem(ContextMenuItemBehaviourTypes.Postback, "Ver información", "Info", "olContextMenuItem", true)); ctx.AddItem(new ContextMenuItem(ContextMenuItemBehaviourTypes.Postback, "Seleccionar color", "ColorPick", "olContextMenuItem", true)); ctx.AddItem(new ContextMenuItem(ContextMenuItemBehaviourTypes.Postback, "Bloquear/Desbloquear", "Lock", "olContextMenuItem", true)); ctx.AddItem(new ContextMenuItem(ContextMenuItemBehaviourTypes.Postback, "Repintar", "Paint", "olContextMenuItem", true)); Monitor.AddControls(ControlFactory.GetLayerSwitcher(), ControlFactory.GetNavigation(), ControlFactory.GetPanZoomBar(), ControlFactory.GetToolbar(true, false, true, false, false, false, false), ctx); Monitor.SetDefaultCenter(-34.6134981326759, -58.4255323559046); Monitor.SetCenter(-34.6134981326759, -58.4255323559046, InitialZoomLevel); } }
/// <summary> /// Initial map set up. /// </summary> private void InitializeMap() { Monitor.ImgPath = ImgUrl; Monitor.EnableTimer = false; Monitor.MultiplePopUps = true; Monitor.GoogleMapsScript = GoogleMapsKey; var googleMapsEnabled = true; var usuario = DAOFactory.UsuarioDAO.FindById(WebSecurity.AuthenticatedUser.Id); if (usuario != null && usuario.PorEmpresa && usuario.Empresas.Count == 1) { var empresa = usuario.Empresas.First() as Empresa; if (empresa != null) { googleMapsEnabled = empresa.GoogleMapsEnabled; } } if (googleMapsEnabled) { Monitor.AddLayers(LayerFactory.GetGoogleHybrid(_hybrid, MinZoomLevel), LayerFactory.GetGoogleSatellite(_satellite, MinZoomLevel), LayerFactory.GetGoogleStreet(_street, MinZoomLevel), LayerFactory.GetGooglePhysical(_physical, MinZoomLevel), /* LayerFactory.GetCompumap(_compumap, ClarinMapsUrl, MinZoomLevel), LayerFactory.GetMarkers(_posicion, true), */ LayerFactory.GetOpenStreetMap(CultureManager.GetLabel("LAYER_OSM"))); } else { Monitor.AddLayers(LayerFactory.GetOpenStreetMap(CultureManager.GetLabel("LAYER_OSM"))); } Monitor.AddControls(ControlFactory.GetLayerSwitcher(), ControlFactory.GetNavigation(), ControlFactory.GetPanZoomBar()); Monitor.ZoomTo(InitialZoomLevel); }
protected override void OnInit(EventArgs e) { base.OnInit(e); if (!IsPostBack) { SelectedEntidades = null; SelectedMessages = null; SelectedLineas = new List <int> { -1 }; RegisterExtJsStyleSheet(); Monitor.ImgPath = Config.Monitor.GetMonitorImagesFolder(this); Monitor.GoogleMapsScript = GoogleMapsKey; Monitor.TimerInterval = 1; Monitor.GeocoderMarkersLayer = LayerDir; Monitor.DefaultMarkerIcon = "salida.gif"; var googleMapsEnabled = true; var usuario = DAOFactory.UsuarioDAO.FindById(WebSecurity.AuthenticatedUser.Id); if (usuario != null && usuario.PorEmpresa && usuario.Empresas.Count == 1) { var empresa = usuario.Empresas.First() as Empresa; if (empresa != null) { googleMapsEnabled = empresa.GoogleMapsEnabled; } } if (googleMapsEnabled) { Monitor.AddLayers( LayerFactory.GetGoogleStreet(CultureManager.GetLabel("LAYER_GSTREET"), MinZoomLevel), //LayerFactory.GetCompumap(CultureManager.GetLabel("LAYER_COMPUMAP"), Config.Map.CompumapTiles, MinZoomLevel), LayerFactory.GetOpenStreetMap(CultureManager.GetLabel("LAYER_OSM")), LayerFactory.GetGoogleSatellite(CultureManager.GetLabel("LAYER_GSAT"), MinZoomLevel), LayerFactory.GetGoogleHybrid(CultureManager.GetLabel("LAYER_GHIBRIDO"), MinZoomLevel), LayerFactory.GetGooglePhysical(CultureManager.GetLabel("LAYER_GFISICO"), MinZoomLevel), LayerFactory.GetVector(LayerAreasPoi, true), LayerFactory.GetVector(LayerClientArea, true), LayerFactory.GetMarkers(LayerEntidades, true), LayerFactory.GetMarkers(LayerPoi, true), LayerFactory.GetMarkers(LayerClientPoi, true), LayerFactory.GetMarkers(LayerDir, true)); } else { Monitor.AddLayers(LayerFactory.GetOpenStreetMap(CultureManager.GetLabel("LAYER_OSM")), LayerFactory.GetVector(LayerAreasPoi, true), LayerFactory.GetVector(LayerClientArea, true), LayerFactory.GetMarkers(LayerEntidades, true), LayerFactory.GetMarkers(LayerPoi, true), LayerFactory.GetMarkers(LayerClientPoi, true), LayerFactory.GetMarkers(LayerDir, true)); } var ctx = ControlFactory.GetContextMenu(); ctx.AddItem(new ContextMenuItem(ContextMenuItemBehaviourTypes.None, CultureManager.GetLabel("MAP_OPTIONS"), "", "olContextMenuTitle", true)); ctx.AddItem(ContextMenuItem.Separator); ctx.AddItem(new ContextMenuItem(ContextMenuItemBehaviourTypes.Postback, CultureManager.GetLabel("MAP_MARK_DIR"), "Consulta", "olContextMenuItem", true)); ctx.AddItem(ContextMenuItem.Separator); ctx.AddItem(new ContextMenuItem(ContextMenuItemBehaviourTypes.Center, CultureManager.GetLabel("MAP_CENTER"), "", "olContextMenuItem", true)); ctx.AddItem(new ContextMenuItem(ContextMenuItemBehaviourTypes.ZoomIn, CultureManager.GetLabel("MAP_ZOOM_IN"), "", "olContextMenuItem", true)); ctx.AddItem(new ContextMenuItem(ContextMenuItemBehaviourTypes.ZoomOut, CultureManager.GetLabel("MAP_ZOOM_OUT"), "", "olContextMenuItem", true)); Monitor.AddControls(ControlFactory.GetLayerSwitcher(), ControlFactory.GetNavigation(), ControlFactory.GetPanZoomBar(), ctx, ControlFactory.GetToolbar(false, false, false, false, false, false, true, true, LayerAreasPoi)); if (SelectedLineas.Count == 1) { var linea = DAOFactory.LineaDAO.FindById(SelectedLineas.First()); SetCenterLinea(linea); } else { Monitor.SetDefaultCenter(-34.6134981326759, -58.4255323559046); Monitor.SetCenter(-34.6134981326759, -58.4255323559046, 10); } } Monitor.Tick += MonitorTick; Monitor.ContextMenuPostback += MonitorContextMenuPostback; }