//Query( $QS ); ?> var SiteLat=; var SiteLon=; var SiteAlt=; var map = null; var selectedMarker = null; var timelineObj = null; var tlGroups = new vis.DataSet(); var tlItems = new vis.DataSet(); var selecredActiveSourceFilter = 0; var ActiveZones = null; var tlOptions = { groupOrder: 'content', // groupOrder can be a property name or a sorting function stack: true, showCurrentTime: true, //verticalScroll: true, //zoomKey: 'ctrlKey', minHeight: 308, maxHeight: 308 }; var tlLoadLocker = false; var tlLastTS = 0; var tlInterval = null; var tlMonitoring = false; // Global Variables var Dates = new Array(); var HTTPO_Calendar = null; var SelectedDay=''; var CurrentDate=(new Date())/1000; // Calendar Functions function Calendar_QURL(RQT){ RetVal="feed.php?STY=5&UID="+UserID+"&SID="+SessionID+"&DID="+CDevID+"&CDATE="+CurrentDate; return RetVal; }; function StartCalendarSession( httpRequestType ){ var QURL=''; if (HTTPO_Calendar == null ){ HTTPO_Calendar = getHTTPObject(); }; if (HTTPO_Calendar != null) { QURL=Calendar_QURL( httpRequestType ); HTTPO_Calendar.open("GET", QURL , true); HTTPO_Calendar.send(''); HTTPO_Calendar.onreadystatechange = HGDT_Calendar; Ext.MessageBox.wait("GetLabel('_Loading_Histo_');?>","GetLabel('_Please_Wait_');?>",{ width: '100%', hidden: true, progress: true, closable: false }); } else { Ext.Msg.alert('Status', 'Error Creating AJAX Connection.
Code: CCXL00231'); }; }; function HGDT_Calendar(){ switch( HTTPO_Calendar.readyState ){ case 0: window.status = 'C:Communication is Uninitialized'; break; case 1: window.status = 'C:Loading Data'; break; case 2: window.status = 'C:Data is Loaded'; break; case 3: window.status = 'C:Communication is Interactive'; break; case 4: window.status = 'C:Data Load Complete'; break; }; if( HTTPO_Calendar.readyState == 4 ){ var T_Arr; //alert(HTTPO_Calendar.responseText); T_Arr = JSON_parse( HTTPO_Calendar.responseText,'' ); httpRequestType=T_Arr.type/1; //alert(httpRequestType); Dates=new Array(); for (index=0;index'; InDTA+='SuMoTuWeThFrSa'; InDTA+=''; for(index=0;index'+(index-Msh+1).toString()+''; InDTA+='
'+(index-Msh+1).toString()+'
'; } else { if( ( SD - 1 ) == index ){ InDTA+='
'+(index-Msh+1).toString()+''; } else { InDTA+='
'+(index-Msh+1).toString()+''; }; }; if ((index+1)%7==0){ InDTA+=''; }; }; for(;(index)%7!=0;index++){ InDTA+='
 
'; }; InDTA+=''; tab=document.getElementById('calendar_TD'); tab.innerHTML=InDTA; }; function loadCalendarDates(){ Ext.MessageBox.wait("GetLabel('_Loading_Calo_');?>","GetLabel('_Please_Wait_');?>",{ width: '100%', hidden: true, progress: true, closable: false }); Ext.Ajax.request({ url: '/lib/controller/getEventDates.php', params: { NID: selecredActiveSourceFilter, UID: , SID: '', SYE: SY, SMO: SMO }, success: function( response, opts ){ Ext.MessageBox.hide(); var data = Ext.decode( response.responseText ); if( data.status == 'ok' ){ Dates = data.days; BuildCalendar(); //for( var i = 0; i < data.days.length; i++ ){ // //}; }; }, failure: function( response, opts ) { Ext.MessageBox.hide(); } }); }; var eventsListStore = new Ext.data.JsonStore({ root: 'log', totalProperty: 'totalCount', idProperty: 'id', remoteSort: true, fields: [{ name: 'id', type: 'int' },{ name: 'date', type: 'string' },{ name: 'time', type: 'string' },{ name: 'device', type: 'string' },{ name: 'event', type: 'string' },{ name: 'data', type: 'string', },{ name: 'has_target', type: 'boolean' },{ name: 'has_geo', type: 'boolean' },{ name: 'has_images', type: 'boolean' },{ name: 'images', type: 'Array' },{ name: 'dev_type', type: 'int' },{ name: 'geo', type: 'object' }] /*, proxy : new Ext.data.HttpProxy({ method: 'POST', prettyUrls: false, url: '/lib/controller/getEventRecords.php', headers: { UID: , SID: '', NID: 1 } })*/ }); var SelectedEvent = 0; var EventPanelWindow = null; function showEventPanel(){ if( EventPanelWindow == null ){ EventPanelWindow = new Ext.Window({ modal: true, title: 'GetLabel("_EVENT_VIEWER_");?>', width: winW*0.66, height: winH*0.66, layout: 'fit', closeAction: 'hide', items:[{ title: 'Cameras', html:'koko', autoScroll: true, height: 320 },{ html: 'koko22', height: 320 }] }); }; EventPanelWindow .show(); }; function ModeRenderer(val){ var p1, p2, p3; if( ( val & 1 ) == 1 ){ p1 = 'Video Source'; } else { p1 = 'NO Video Source'; }; if( ( val & 2 ) == 2 ){ p2 = 'Audio Source'; } else { p2 = 'NO Audio Source'; }; if( ( val & 4 ) == 4 ){ p3 = 'PTZ Control'; } else { p3 = 'NO PTZ Control'; }; return p1+p2+p3; }; function LocRenderer( val ){ if( val ){ return 'Location'; }; return 'NO Location'; }; function PicRenderer( val ){ if( val ){ return ''; }; return ''; }; var eventsListColModel_ops = { columns: [ {header: "ID", width: 50, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', dataIndex: 'id' }, {header: "Date",width: 80, sortable: false, fixed: true, menuDisabled: true, /*renderer: camCapRenderer,*/ dataIndex: 'date' }, {header: "Time", width: 80, sortable: false, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'time' }, {header: "Device", width: 150, sortable: false, fixed: true, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'device' }, {header: "Event", width: 80, sortable: false, dataIndex: 'event' }, {header: "Info", width: 200, sortable: false, dataindex: 'data' }, {header: "", width: 25, sortable: false, dataIndex: 'has_geo', renderer: LocRenderer }, {header: "", width: 25, sortable: false, dataIndex: 'has_images', renderer: PicRenderer } ], defaults: { sortable: true, menuDisabled: true, width: 100 }, listeners: { hiddenchange: function(cm, colIndex, hidden) { //saveConfig(colIndex, hidden); } } }; var eventsListSelModel_ops = { singleSelect: true, listeners: { rowselect: function(sm, row, rec ) { loadEventProperties( rec.data ); //SelectedEvent = rec.data.id; //alert( SelectedEvent ); //var CB = Ext.getCmp('con_to_src'); //CB.enable(); } } }; function loadTimeLineGroups( NID ){ Ext.Ajax.request({ url: '/lib/controller/getTimeLineGroups.php', params: { NID: NID, UID: , SID: '' }, success: function( response, opts ){ // If the response is JSON, you have to decode it var data = Ext.decode(response.responseText); //for(var i = 0; i < data.length; i++) { //tlGroups.add(data[i]); //}; tlGroups.update( data ); loadTimeLineItems( SelectedSite ); tlInterval = window.setInterval( loadTimeLineItems, 333, SelectedSite ); }, failure: function( response, opts ) { //Ext.fly('some_div').update('Fail!'); }/*, callback: function(options,success,response){ // use this if you need to perform your own success/failure checking }*/ }); }; function clickDeviceSelector( id ){ var rr = document.getElementById(id+'_div'); if( selecredActiveSourceFilter != id ){ if( selecredActiveSourceFilter > 0 ){ var oo = document.getElementById( selecredActiveSourceFilter + '_div'); oo.classList.remove( "cardDeviceSourceSelected" ); oo.classList.add( "cardDeviceSource" ); }; rr.classList.remove( "cardDeviceSource" ); rr.classList.add( "cardDeviceSourceSelected" ); selecredActiveSourceFilter = id; turnOffAllGzButThis( selecredActiveSourceFilter ); } else { selecredActiveSourceFilter = 0; rr.classList.remove( "cardDeviceSourceSelected" ); rr.classList.add( "cardDeviceSource" ); turnAllGzOn(); var tPanel = Ext.getCmp('prop_content'); tPanel.remove(0); tPanel.add( { title: 'Event Information', border: false, frame: false, collapsible: false, draggable: false, html: '

Select an Event from TimeLine to See Information

' } ); tPanel.doLayout(); }; }; function getZoneByNode( nid ){ var rVal = -1; for( var i=0; i < ActiveZones.totalCount; i++ ){ if( ActiveZones.zones[i].dev_id == nid ){ rVal = i; break; }; }; return rVal; }; function turnOffAllGzButThis( nid ){ var chocho = -1; for( var i=0; i < ActiveZones.totalCount; i++ ){ if( ActiveZones.zones[i].dev_id == nid ) chocho = i; map.removeLayer( ActiveZones.fig[i] ); map.removeLayer( ActiveZones.zang[i] ); map.removeLayer( ActiveZones.center[i] ); }; if( chocho > -1 ){ map.addLayer( ActiveZones.fig[chocho] ); map.addLayer( ActiveZones.zang[chocho] ); map.addLayer( ActiveZones.center[chocho] ); var cVisible = L.featureGroup( Array( ActiveZones.fig[chocho], ActiveZones.zang[chocho], ActiveZones.center[chocho] ) ); map.flyToBounds( cVisible.getBounds() ); }; }; function turnAllGzOn(){ var tall = Array(); for( var i=0; i < ActiveZones.totalCount; i++ ){ tall[i*3] = ActiveZones.fig[i]; tall[i*3+1] = ActiveZones.zang[i]; tall[i*3+2] = ActiveZones.center[i]; if(!map.hasLayer(ActiveZones.fig[i])) map.addLayer( ActiveZones.fig[i] ); if(!map.hasLayer(ActiveZones.zang[i])) map.addLayer( ActiveZones.zang[i] ); if(!map.hasLayer(ActiveZones.center[i])) map.addLayer( ActiveZones.center[i] ); }; var cVisible = L.featureGroup( tall ); map.flyToBounds( cVisible.getBounds() ); }; function loadMapZones( SID ){ Ext.Ajax.request({ url: '/lib/controller/getGeoZones.php', params: { SITE: SID, UID: , SID: '' }, success: function( response, opts ){ // If the response is JSON, you have to decode it var data = Ext.decode(response.responseText); var pp = Ext.getCmp('sources_panel'); if( typeof pp !== 'undefined' ) pp.removeAll(); ActiveZones = data; ActiveZones.fig = new Array(); ActiveZones.zang = new Array(); ActiveZones.center = new Array(); for(var i = 0; i < data.totalCount; i++ ) { switch( data.zones[i].type ){ case 'circle':{ //L.circle( data.zones[i].center, {radius: data.zones[i].radius, color: data.zones[i].color, weight: 1, opacity: 0.8 } ).addTo( map ); ActiveZones.fig[i] = new L.circle( data.zones[i].center, {radius: data.zones[i].radius, color: data.zones[i].color, weight: 1, opacity: 0.8 } ); //map.addLayer( ActiveZones.fig[i] ); break; }; case 'poly':{ ActiveZones.fig[i] = new L.polygon( data.zones[i].points, {color: data.zones[i].color, dashArray: "4 1 2 3", weight: 1, opacity: 0.8, clickable: false, interactive: false, bubblingMouseEvents: false });//.addTo(map); //map.addLayer( ActiveZones.fig[i] ); break; }; case 'image':{ ActiveZones.fig[i] = L.imageOverlay( data.zones[i].url, data.zones[i].bounds, { opacity: 1.0 });//.addTo( map ); //map.addLayer( ActiveZones.fig[i] ); break; }; case 'image_rot':{ ActiveZones.fig[i] = L.imageOverlay.rotated( data.zones[i].url, data.zones[i].topleft, data.zones[i].topright, data.zones[i].bottomleft, { opacity: 0.8 //, //interactive: true, //attribution: "Historical building plan © Instituto Geográfico Nacional de España" });//.addTo( map ); //map.addLayer( ActiveZones.fig[i] ); break; }; }; if( data.zones[i].dev_is_source ){ if( typeof pp !== 'undefined' ) { var sty = ''; if( selecredActiveSourceFilter == data.zones[i].dev_id ){ sty = 'cardDeviceSourceSelected'; } else { sty = 'cardDeviceSource'; }; pp.add( { id: data.zones[i].dev_id+'_container', frame: false, border: false, width: 130, height: 130, html: '

'+data.zones[i].dev_name+'

' }); }; }; if( data.zones[i].zang != undefined ){ //L.polygon( data.zones[i].zang, {color: '#ffff00', weight: 1, opacity: 1.0, clickable: false, interactive: false, bubblingMouseEvents: false }).addTo(map); ActiveZones.zang[i] = L.circle( data.zones[i].zang, {radius: 0.3, color: '#ffff00', weight: 1, opacity: 1.0, fillOpacity: 1.0 } );//.addTo( map ); }; if( data.zones[i].center != undefined ){ //L.polygon( data.zones[i].zmark, {color: '#ffff00', weight: 1, opacity: 1.0, clickable: false, interactive: false, bubblingMouseEvents: false }).addTo(map); ActiveZones.center[i] = L.circle( data.zones[i].center, {radius: 0.3, color: '#ffff00', weight: 1, opacity: 1.0, fillOpacity: 1.0 } ).addTo( map ); }; }; if( selecredActiveSourceFilter == 0 ){ turnAllGzOn(); } else { turnOffAllGzButThis( selecredActiveSourceFilter ); }; if( typeof pp !== 'undefined' ) pp.doLayout(); //LoadMapEvents( SelectedSite ); //tlInterval = window.setInterval( LoadMapEvents, 333, SelectedSite ); }, failure: function( response, opts ) { //Ext.fly('some_div').update('Fail!'); } }); }; var cevt = Array(); var coz = Array(); function LoadMapEventsZ( Mode ){ if( tlLoadLocker ) return; tlLoadLocker = true; Ext.Ajax.request({ url: '/lib/controller/getGeoAlerts.php', params: { SITE: , UID: , SID: '', MODE: Mode }, success: function( response, opts ){ if( cevt.length ){ for( i=0; i< cevt.length; i++ ){ if( cevt[i]!= null ){ cevt[i].remove(); delete( cevt[i] ); cevt[i] = null; }; }; }; if( coz.length ){ for( i=0; i< coz.length; i++ ){ if( coz[i]!= null ){ coz[i].remove(); delete( coz[i] ); coz[i]=null; }; }; }; var data = Ext.decode( response.responseText ); var zz = ( 1.0 / ( data.evt.length + 0 ) ); for( i=0; i < data.evt.length; i++ ){ cevt[i] = L.circleMarker( [data.evt[i].lat,data.evt[i].lon], {id:data.evt[i].id, color: '#FF0000', radius: 5, stroke: false, fillOpacity: ( 1.0 - i * zz ) } ).on('click', function( e, a ){ loadEventProperties( this.options.id ); } ); cevt[i].addTo(map); }; for( i=0; i < data.other.length; i++ ){ switch( data.other[i].type ){ case 'circle':{ coz[i] = L.circleMarker( data.other[i].loc, {id:data.other[i].id, color: data.other[i].color, radius: 5, stroke: false, fillOpacity: 1.0 } ); coz[i].addTo(map); break; }; }; }; //eventsListStore.reload(); tlLoadLocker = false; }, failure: function( response, opts ) { //Ext.fly('some_div').update('Fail!'); tlLoadLocker = false; } }); }; function loadEventProperties( EventRec ){ //alert( 'Node: ' + NodeID ); var tPanel = Ext.getCmp('prop_content'); tPanel.removeAll();// remove( 0 ); var tt = '' map.removeLayer( selectedMarker ); if( EventRec.has_geo ){ tt = ''+EventRec.geo.lat+' '+EventRec.geo.lon; selectedMarker.setLatLng([EventRec.geo.lat, EventRec.geo.lon]); selectedMarker.addTo( map ); }; tPanel.add( { title: 'Event Details', html: '

' + EventRec.device+'

'+tt+'
' } ); if( EventRec.has_images ){ for( var i=0; i < EventRec.images.length; i++ ){ tPanel.add( { frame: false, html: '' }); }; }; tPanel.doLayout(); /* Ext.Ajax.request({ url: '/lib/controller/getEventProps.php', params: { NID: , UID: , SID: '', EVENT: EventRec.id }, success: function( response, opts ){ // If the response is JSON, you have to decode it var data = Ext.decode(response.responseText); var tPanel = Ext.getCmp('prop_content'); tPanel.remove(0); tPanel.add( data ); tPanel.doLayout(); }, failure: function( response, opts ) { //Ext.fly('some_div').update('Fail!'); } }); */ }; function getData( Mode ){ if( tlLoadLocker ) return; tlLoadLocker = true; Ext.Ajax.request({ url: '/lib/controller/getEventRecords.php', params: { SITE: , UID: , SID: '', MODE: Mode, FIL: selecredActiveSourceFilter, SDA: SD, SMO: SMO, SYE: SY, STM: 0, ETM: 0, }, success: function( response, opts ){ tlLoadLocker = false; var data = Ext.decode(response.responseText); eventsListStore.loadData( data, false ); LoadMapEventsZ( Mode ); }, failure: failureAJAXFunction }); }; function loadArchive(){ if( tlInterval!= null ){ window.clearInterval( tlInterval ); tlInterval = null; timelineObj = null; }; setUserContent( 2 ); var tPanel = Ext.getCmp('main_portal'); tPanel.removeAll( true ); Ext.getCmp('main_content').setTitle( 'Events Archive' ); tPanel.add({ columnWidth: 0.83, frame: false, border: false, items: [{ title: 'Site Map', frame: false, border: false, layout: 'vbox', layoutConfig: { align : 'stretch', pack : 'start', }, height: PanelH-300, items:[{ height: PanelH-325, flex: 1, frame: false, border: false, layout: 'fit', items:{ id: 'event_map', html: ' ' } }] },{ frame: false, border: false, collapsible: false, draggable: false, layout: 'hbox', items:[{ layout: 'form', title: 'Date/Time', width: 200, frame: true, border: false, labelAlign: 'right', labelWidth: 50, defaults: { width: 80}, items: [{ xtype: 'timefield', id: 'STimeFROM', width: 120, fieldLabel: 'From', minValue: '00:00', maxValue: '24:00', increment: 30 },{ xtype: 'timefield', id: 'STimeTO', width: 120, fieldLabel: 'Till', minValue: '00:00', maxValue: '24:00', increment: 30 }], html: '
', buttons: [{ xtype: 'button', text: 'Display History' }] },{ title: 'Event Log', frame: false, height: 303, xtype: 'grid', ds: eventsListStore, cm: new Ext.grid.ColumnModel( eventsListColModel_ops ), sm: new Ext.grid.RowSelectionModel( eventsListSelModel_ops ) }] }] }); tPanel.add({ columnWidth: 0.17, frame: false, id: 'prop_content', border: false, items: [{ title: 'Event Information', border: true, frame: true, html: '

Select an Event from TimeLine to See Information

' }] }); tPanel.doLayout(); //BuildCalendar(); loadCalendarDates(); map = L.map('event_map',{ attributionControl: true, //preferCanvas: true, zoomControl: true, center: [SiteLat, SiteLon], /*zoomControl: false, zoom: 17, minZoom: 17, maxZoom: 17,*/ keyboard: false }).setView([SiteLat, SiteLon], 17); //L.marker([SiteLat, SiteLon], { draggable: false, icon: SITEZ_Icon } ).addTo(map).on('click', LoadNodesList ).bindPopup("GetLabel('_SYS_ANCHORT_LBL_');?>"); var selectedMarkerIcon = L.icon({ iconUrl: '/style/assets/cursor.png', iconSize: [32, 32], iconAnchor: [16, 16]//, //popupAnchor: [-3, -76], //shadowUrl: 'my-icon-shadow.png', //shadowSize: [68, 95], //shadowAnchor: [22, 94] }); selectedMarker = L.marker([SiteLat, SiteLon], { draggable: false, icon: selectedMarkerIcon } ); var mapLayers = []; /*mapLayers["Bing"] = new BingLayer('https://t{s}.ssl.ak.dynamic.tiles.virtualearth.net/comp/ch/{q}?it=A,G,L&shading=hill', { subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'], attribution: '© Bing Maps', detectRetina: true });*/ mapLayers["MyMap"] = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { attribution: '© OpenStreetMap contributors', maxNativeZoom: 18, maxZoom: 24, }) // https://leaflet-extras.github.io/leaflet-providers/preview/ mapLayers["EsriStreet"] = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}', { attribution: 'Tiles © Esri — Source: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012', maxZoom: 19 }); mapLayers["EsriSat"] = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', { attribution: 'Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community', maxZoom: 19 }); mapLayers["EsriTopo"] = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}', { attribution: 'Tiles © Esri — Esri, DeLorme, NAVTEQ, TomTom, Intermap, iPC, USGS, FAO, NPS, NRCAN, GeoBase, Kadaster NL, Ordnance Survey, Esri Japan, METI, Esri China (Hong Kong), and the GIS User Community', maxZoom: 24 }); mapLayers["OpenStreetMap"] = L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", { //de/tiles/osmde attribution: 'Map data © OpenStreetMap contributors', maxZoom: 19 }); mapLayers["OpenTopoMap"] = L.tileLayer("https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png", { attribution: 'Kartendaten: © OpenStreetMap-Mitwirkende, SRTM | Kartendarstellung: © OpenTopoMap (CC-BY-SA) ', maxZoom: 19 }); /* mapLayers["Cycle"] = L.tileLayer('https://tile.thunderforest.com/cycle/{z}/{x}/{y}.png?apikey=' + _PHP['API_KEY_THUNDERFOREST_1'], { attribution: 'Maps © Thunderforest, Data © OpenStreetMap contributors', maxZoom: 22 }); mapLayers["Landscape"] = L.tileLayer('https://tile.thunderforest.com/landscape/{z}/{x}/{y}.png?apikey=' + _PHP['API_KEY_THUNDERFOREST_1'], { attribution: 'Maps © Thunderforest, Data © OpenStreetMap contributors', maxZoom: 22 }); mapLayers["Outdoor"] = L.tileLayer('https://tile.thunderforest.com/outdoors/{z}/{x}/{y}.png?apikey=' + _PHP['API_KEY_THUNDERFOREST_1'], { attribution: 'Maps © Thunderforest, Data © OpenStreetMap contributors', maxZoom: 22 }); */ var baseMaps = { "MyMap": mapLayers["MyMap"], "OpenStreetMap": mapLayers["OpenStreetMap"], "OpenTopoMap": mapLayers["OpenTopoMap"], "EsriSat": mapLayers["EsriSat"], "EsriStreet": mapLayers["EsriStreet"], "EsriTopo": mapLayers["EsriTopo"], //"Bing": mapLayers["Bing"], //"OSM-Cycle": mapLayers["Cycle"], //"Landscape": mapLayers["Landscape"], //"Outdoor": mapLayers["Outdoor"], }; L.control.layers( baseMaps ).addTo(map); mapLayers["MyMap"].addTo(map); /*L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { attribution: '© OpenStreetMap contributors', maxNativeZoom: 18, maxZoom: 24, }).addTo(map); */ //loadTimeLineGroups( selectedSite ); loadMapZones( SelectedSite ); getData( 'arch' ); //eventsListStore.load({params:{start:0, limit:50, src: 'arch', fil: selecredActiveSourceFilter }}); }; function loadMonitoring(){ if( tlInterval!= null ){ window.clearInterval( tlInterval ); tlInterval = null; timelineObj = null; }; setUserContent( 1 ); var tPanel = Ext.getCmp('main_portal'); tPanel.removeAll( true ); Ext.getCmp('main_content').setTitle( 'Events Monitoring' ); tPanel.add({ columnWidth: 0.83, frame: false, border: false, items: [{ title: 'getLabel('_MAP_MONITORING_');?>', frame: false, border: false, collapsible: false, draggable: false, layout: 'vbox', layoutConfig: { align : 'stretch', pack : 'start', }, height: PanelH-300, items:[{ height: PanelH-325, flex: 1, frame: false, border: false, layout: 'fit', items:{ id: 'event_map', html: ' ' } }] },{ frame: false, border: true, collapsible: false, draggable: false, layout: 'hbox', items:[{ title: 'Alarm Sources', xtype: 'panel', border: false, frame: false, collapsible: false, draggable: false, id: 'sources_panel', width: 160, autoScroll: 'auto', height: 303 },{ title: 'Event Log', height: 303, xtype: 'grid', border: false, frame: false, collapsible: false, draggable: false, ds: eventsListStore, cm: new Ext.grid.ColumnModel( eventsListColModel_ops ), sm: new Ext.grid.RowSelectionModel( eventsListSelModel_ops ), bbar: [{ text: 'Clear', handler: function(){ Ext.Ajax.request({ url: '/lib/controller/clearEventCloud.php', params: { UID: , SID: '' }, success: function( response, opts ){ }, failure: function( response, opts ) { } }); } }] }] }] }); tPanel.add({ columnWidth: 0.17, frame: false, id: 'prop_content', border: false, items: [{ title: 'Event Information', border: true, frame: true, html: '

Select an Event from TimeLine to See Information

' }] }); tPanel.doLayout(); map = L.map('event_map',{ attributionControl: true, //preferCanvas: true, zoomControl: true, center: [SiteLat, SiteLon], /*zoomControl: false, zoom: 17, minZoom: 17, maxZoom: 17,*/ keyboard: false }).setView([SiteLat, SiteLon], 17); //L.marker([SiteLat, SiteLon], { draggable: false, icon: SITEZ_Icon } ).addTo(map).on('click', LoadNodesList ).bindPopup("GetLabel('_SYS_ANCHORT_LBL_');?>"); var mapLayers = []; /*mapLayers["Bing"] = new BingLayer('https://t{s}.ssl.ak.dynamic.tiles.virtualearth.net/comp/ch/{q}?it=A,G,L&shading=hill', { subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'], attribution: '© Bing Maps', detectRetina: true });*/ mapLayers["MyMap"] = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { attribution: '© OpenStreetMap contributors', maxNativeZoom: 18, maxZoom: 24, }) // https://leaflet-extras.github.io/leaflet-providers/preview/ mapLayers["EsriStreet"] = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}', { attribution: 'Tiles © Esri — Source: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012', maxZoom: 19 }); mapLayers["EsriSat"] = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', { attribution: 'Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community', maxZoom: 19 }); mapLayers["EsriTopo"] = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}', { attribution: 'Tiles © Esri — Esri, DeLorme, NAVTEQ, TomTom, Intermap, iPC, USGS, FAO, NPS, NRCAN, GeoBase, Kadaster NL, Ordnance Survey, Esri Japan, METI, Esri China (Hong Kong), and the GIS User Community', maxZoom: 24 }); mapLayers["OpenStreetMap"] = L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", { //de/tiles/osmde attribution: 'Map data © OpenStreetMap contributors', maxZoom: 19 }); mapLayers["OpenTopoMap"] = L.tileLayer("https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png", { attribution: 'Kartendaten: © OpenStreetMap-Mitwirkende, SRTM | Kartendarstellung: © OpenTopoMap (CC-BY-SA) ', maxZoom: 19 }); /* mapLayers["Cycle"] = L.tileLayer('https://tile.thunderforest.com/cycle/{z}/{x}/{y}.png?apikey=' + _PHP['API_KEY_THUNDERFOREST_1'], { attribution: 'Maps © Thunderforest, Data © OpenStreetMap contributors', maxZoom: 22 }); mapLayers["Landscape"] = L.tileLayer('https://tile.thunderforest.com/landscape/{z}/{x}/{y}.png?apikey=' + _PHP['API_KEY_THUNDERFOREST_1'], { attribution: 'Maps © Thunderforest, Data © OpenStreetMap contributors', maxZoom: 22 }); mapLayers["Outdoor"] = L.tileLayer('https://tile.thunderforest.com/outdoors/{z}/{x}/{y}.png?apikey=' + _PHP['API_KEY_THUNDERFOREST_1'], { attribution: 'Maps © Thunderforest, Data © OpenStreetMap contributors', maxZoom: 22 }); */ var baseMaps = { "MyMap": mapLayers["MyMap"], "OpenStreetMap": mapLayers["OpenStreetMap"], "OpenTopoMap": mapLayers["OpenTopoMap"], "EsriSat": mapLayers["EsriSat"], "EsriStreet": mapLayers["EsriStreet"], "EsriTopo": mapLayers["EsriTopo"], //"Bing": mapLayers["Bing"], //"OSM-Cycle": mapLayers["Cycle"], //"Landscape": mapLayers["Landscape"], //"Outdoor": mapLayers["Outdoor"], }; L.control.layers( baseMaps ).addTo(map); mapLayers["MyMap"].addTo(map); /*L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { attribution: '© OpenStreetMap contributors', maxNativeZoom: 18, maxZoom: 24, }).addTo(map); */ loadMapZones( SelectedSite ); tlInterval = window.setInterval( getData, 333, 'live' ); }; function loadOnlineMonitoring(devID){ var tPanel = Ext.getCmp('main_content'); if( tlInterval!= null ){ window.clearInterval( tlInterval ); tlInterval = null; timelineObj = null; }; tPanel.remove(0); tPanel.add({ html: 'Device Monitoring '+devID }); tPanel.doLayout(); };