Web UI for ARGUS server
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

566 lines
18 KiB

5 years ago
​
​
​
6 years ago
5 years ago
​
​
​
​
6 years ago
​
​
​
5 years ago
6 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 years ago
​
​
​
5 years ago
5 years ago
​
5 years ago
5 years ago
​
5 years ago
5 years ago
​
​
​
​
​
​
​
​
​
​
5 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 years ago
5 years ago
​
​
​
​
​
​
​
​
​
​
​
6 years ago
​
​
​
6 years ago
6 years ago
​
​
​
​
​
​
​
​
6 years ago
​
​
​
​
​
​
​
​
​
5 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 years ago
​
​
​
​
​
​
6 years ago
​
​
​
​
​
6 years ago
​
6 years ago
​
​
​
5 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 years ago
5 years ago
6 years ago
​
​
5 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 years ago
​
​
​
6 years ago
5 years ago
​
​
​
​
​
6 years ago
5 years ago
​
5 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 years ago
​
​
​
​
​
​
​
​
​
6 years ago
5 years ago
6 years ago
5 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 years ago
​
​
​
​
​
​
5 years ago
​
​
6 years ago
​
​
5 years ago
6 years ago
​
​
  1. //<?php require_once('../../js_asm.php');
  2. $QS="SELECT * FROM sites WHERE id={$SiteID}";
  3. $RV = $DATABASE->Query( $QS );
  4. ?>
  5. var SiteLat=<?=$RV[0]['anchor_lat'];?>;
  6. var SiteLon=<?=$RV[0]['anchor_lon'];?>;
  7. var SiteAlt=<?=$RV[0]['anchor_alt'];?>;
  8. var map = null;
  9. var timelineObj = null;
  10. var tlGroups = new vis.DataSet();
  11. var tlItems = new vis.DataSet();
  12. var tlOptions = {
  13. groupOrder: 'content', // groupOrder can be a property name or a sorting function
  14. stack: true,
  15. showCurrentTime: true,
  16. //verticalScroll: true,
  17. //zoomKey: 'ctrlKey',
  18. minHeight: 308,
  19. maxHeight: 308
  20. };
  21. var tlLoadLocker = false;
  22. var tlLastTS = 0;
  23. var tlInterval = null;
  24. var tlMonitoring = false;
  25. var eventsListStore = new Ext.data.JsonStore({
  26. root: 'log',
  27. totalProperty: 'totalCount',
  28. idProperty: 'id',
  29. remoteSort: true,
  30. fields: [{
  31. name: 'id',
  32. type: 'int'
  33. },{
  34. name: 'date',
  35. type: 'string'
  36. },{
  37. name: 'time',
  38. type: 'string'
  39. },{
  40. name: 'device',
  41. type: 'string'
  42. },{
  43. name: 'event',
  44. type: 'string'
  45. },{
  46. name: 'data',
  47. type: 'string',
  48. },{
  49. name: 'has_target',
  50. type: 'boolean'
  51. },{
  52. name: 'has_geo',
  53. type: 'boolean'
  54. }],
  55. proxy : new Ext.data.HttpProxy({
  56. method: 'POST',
  57. prettyUrls: false,
  58. url: '/lib/controller/getEventRecords.php',
  59. headers: {
  60. UID: <?=$UserID;?>,
  61. SID: '<?=$Session;?>',
  62. NID: 1
  63. }
  64. })
  65. });
  66. var SelectedEvent = 0;
  67. function ModeRenderer(val){
  68. var p1, p2, p3;
  69. if( ( val & 1 ) == 1 ){
  70. p1 = '<img src="/style/img/cam_cap3.png" alt="Video Source">';
  71. } else {
  72. p1 = '<img src="/style/img/cam_cap0.png" alt="NO Video Source">';
  73. };
  74. if( ( val & 2 ) == 2 ){
  75. p2 = '<img src="/style/img/cam_cap2.png" alt="Audio Source">';
  76. } else {
  77. p2 = '<img src="/style/img/cam_cap0.png" alt="NO Audio Source">';
  78. };
  79. if( ( val & 4 ) == 4 ){
  80. p3 = '<img src="/style/img/cam_cap1.png" alt="PTZ Control">';
  81. } else {
  82. p3 = '<img src="/style/img/cam_cap0.png" alt="NO PTZ Control">';
  83. };
  84. return p1+p2+p3;
  85. };
  86. function LocRenderer( val ){
  87. if( val ){
  88. return '<img src="/style/icons/icons/accept.png" alt="Location">';
  89. };
  90. return '<img src="/style/icons/icons/bullet_white.png" alt="NO Location">';
  91. };
  92. var eventsListColModel_ops = {
  93. columns: [
  94. {header: "ID", width: 50, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', dataIndex: 'id' },
  95. {header: "Date",width: 80, sortable: false, fixed: true, menuDisabled: true, /*renderer: camCapRenderer,*/ dataIndex: 'date' },
  96. {header: "Time", width: 80, sortable: false, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'time' },
  97. {header: "Device", width: 150, sortable: false, fixed: true, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'device' },
  98. {header: "Event", width: 80, sortable: false, dataIndex: 'event' },
  99. {header: "Info", width: 200, sortable: false, dataindex: 'data' },
  100. {header: "", width: 20, sortable: false, dataIndex: 'has_geo', renderer: LocRenderer }
  101. ],
  102. defaults: {
  103. sortable: true,
  104. menuDisabled: true,
  105. width: 100
  106. },
  107. listeners: {
  108. hiddenchange: function(cm, colIndex, hidden) {
  109. //saveConfig(colIndex, hidden);
  110. }
  111. }
  112. };
  113. var eventsListSelModel_ops = {
  114. singleSelect: true,
  115. listeners: {
  116. rowselect: function(sm, row, rec) {
  117. loadEventProperties( rec.data.id );
  118. //SelectedEvent = rec.data.id;
  119. //alert( SelectedEvent );
  120. //var CB = Ext.getCmp('con_to_src');
  121. //CB.enable();
  122. }
  123. }
  124. };
  125. function loadTimeLineGroups( NID ){
  126. Ext.Ajax.request({
  127. url: '/lib/controller/getTimeLineGroups.php',
  128. params: {
  129. NID: NID,
  130. UID: <?=$UserID;?>,
  131. SID: '<?=$Session;?>'
  132. },
  133. success: function( response, opts ){
  134. // If the response is JSON, you have to decode it
  135. var data = Ext.decode(response.responseText);
  136. //for(var i = 0; i < data.length; i++) {
  137. //tlGroups.add(data[i]);
  138. //};
  139. tlGroups.update( data );
  140. loadTimeLineItems( SelectedSite );
  141. tlInterval = window.setInterval( loadTimeLineItems, 333, SelectedSite );
  142. },
  143. failure: function( response, opts ) {
  144. //Ext.fly('some_div').update('Fail!');
  145. }/*,
  146. callback: function(options,success,response){
  147. // use this if you need to perform your own success/failure checking
  148. }*/
  149. });
  150. };
  151. function loadMapZones( SID ){
  152. Ext.Ajax.request({
  153. url: '/lib/controller/getGeoZones.php',
  154. params: {
  155. SITE: SID,
  156. UID: <?=$UserID;?>,
  157. SID: '<?=$Session;?>'
  158. },
  159. success: function( response, opts ){
  160. // If the response is JSON, you have to decode it
  161. var data = Ext.decode(response.responseText);
  162. for(var i = 0; i < data.totalCount; i++ ) {
  163. switch( data.zones[i].type ){
  164. case 'circle':{
  165. L.circle( data.zones[i].center, {radius: data.zones[i].radius, color: data.zones[i].color, weight: 1, opacity: 0.8 } ).addTo( map );
  166. break;
  167. };
  168. case 'poly':{
  169. 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);
  170. break;
  171. };
  172. case 'image':{
  173. L.imageOverlay( data.zones[i].url, data.zones[i].bounds, { opacity: 1.0 }).addTo( map );
  174. break;
  175. };
  176. case 'image_rot':{
  177. L.imageOverlay.rotated( data.zones[i].url, data.zones[i].topleft, data.zones[i].topright, data.zones[i].bottomleft, {
  178. opacity: 0.8 //,
  179. //interactive: true,
  180. //attribution: "Historical building plan &copy; <a href='http://www.ign.es'>Instituto Geográfico Nacional de España</a>"
  181. }).addTo( map );
  182. break;
  183. };
  184. };
  185. if( data.zones[i].zang != undefined ){
  186. //L.polygon( data.zones[i].zang, {color: '#ffff00', weight: 1, opacity: 1.0, clickable: false, interactive: false, bubblingMouseEvents: false }).addTo(map);
  187. L.circle( data.zones[i].zang, {radius: 0.3, color: '#ffff00', weight: 1, opacity: 1.0, fillOpacity: 1.0 } ).addTo( map );
  188. };
  189. if( data.zones[i].center != undefined ){
  190. //L.polygon( data.zones[i].zmark, {color: '#ffff00', weight: 1, opacity: 1.0, clickable: false, interactive: false, bubblingMouseEvents: false }).addTo(map);
  191. L.circle( data.zones[i].center, {radius: 0.3, color: '#ffff00', weight: 1, opacity: 1.0, fillOpacity: 1.0 } ).addTo( map );
  192. };
  193. };
  194. //tlGroups.update( data );
  195. //loadTimeLineItems( selectedSite );
  196. LoadMapEvents( SelectedSite );
  197. tlInterval = window.setInterval( LoadMapEvents, 333, SelectedSite );
  198. },
  199. failure: function( response, opts ) {
  200. //Ext.fly('some_div').update('Fail!');
  201. }
  202. });
  203. };
  204. function loadTimeLineItems( NID ){
  205. if( tlLoadLocker ) return;
  206. tlLoadLocker = true;
  207. Ext.Ajax.request({
  208. url: '/lib/controller/getTimeLineEvents.php',
  209. params: {
  210. NID: NID,
  211. UID: <?=$UserID;?>,
  212. SID: '<?=$Session;?>',
  213. LTS: tlLastTS
  214. },
  215. success: function( response, opts ){
  216. // If the response is JSON, you have to decode it
  217. var data = Ext.decode(response.responseText);
  218. var i = 0;
  219. for(; i < data.length; i++ ){
  220. tlLastTS = data[i].start;
  221. data[i].start = moment.utc( ''+data[i].start, 'X' );
  222. tlItems.add( data[i] );
  223. };
  224. if( timelineObj == null ){
  225. var container = document.getElementById('timeline');
  226. timelineObj = new vis.Timeline( container );
  227. timelineObj.setOptions( tlOptions );
  228. timelineObj.setGroups( tlGroups );
  229. timelineObj.setItems( tlItems );
  230. timelineObj.on('select', function (properties) {
  231. //alert( properties.items[0] );
  232. loadEventProperties( properties.items[0] );
  233. //logEvent('select', properties.items[0]);
  234. });
  235. } else {
  236. timelineObj.redraw();
  237. };
  238. if( tlMonitoring ) timelineObj.moveTo( moment.utc() );
  239. eventsListStore.reload();
  240. tlLoadLocker = false;
  241. },
  242. failure: function( response, opts ) {
  243. //Ext.fly('some_div').update('Fail!');
  244. tlLoadLocker = false;
  245. }
  246. });
  247. };
  248. var cevt = Array();
  249. var coz = Array();
  250. function LoadMapEvents( SID ){
  251. if( tlLoadLocker ) return;
  252. tlLoadLocker = true;
  253. Ext.Ajax.request({
  254. url: '/lib/controller/getGeoAlerts.php',
  255. params: {
  256. SITE: SID,
  257. UID: <?=$UserID;?>,
  258. SID: '<?=$Session;?>'
  259. },
  260. success: function( response, opts ){
  261. if( cevt.length ){
  262. for( i=0; i< cevt.length; i++ ){
  263. if( cevt[i]!= null ){
  264. cevt[i].remove();
  265. delete( cevt[i] );
  266. cevt[i] = null;
  267. };
  268. };
  269. };
  270. if( coz.length ){
  271. for( i=0; i< coz.length; i++ ){
  272. if( coz[i]!= null ){
  273. coz[i].remove();
  274. delete( coz[i] );
  275. coz[i]=null;
  276. };
  277. };
  278. };
  279. var data = Ext.decode( response.responseText );
  280. var zz = ( 1.0 / ( data.evt.length + 0 ) );
  281. for( i=0; i < data.evt.length; i++ ){
  282. 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 ){
  283. loadEventProperties( this.options.id );
  284. } );
  285. cevt[i].addTo(map);
  286. };
  287. for( i=0; i < data.other.length; i++ ){
  288. switch( data.other[i].type ){
  289. case 'circle':{
  290. 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 } );
  291. coz[i].addTo(map);
  292. break;
  293. };
  294. };
  295. };
  296. eventsListStore.reload();
  297. tlLoadLocker = false;
  298. },
  299. failure: function( response, opts ) {
  300. //Ext.fly('some_div').update('Fail!');
  301. tlLoadLocker = false;
  302. }
  303. });
  304. };
  305. function loadEventProperties( EventID ){
  306. //alert( 'Node: ' + NodeID );
  307. Ext.Ajax.request({
  308. url: '/lib/controller/getEventProps.php',
  309. params: {
  310. NID: <?=$SiteID;?>,
  311. UID: <?=$UserID;?>,
  312. SID: '<?=$Session;?>',
  313. EVENT: EventID
  314. },
  315. success: function( response, opts ){
  316. // If the response is JSON, you have to decode it
  317. var data = Ext.decode(response.responseText);
  318. var tPanel = Ext.getCmp('prop_content');
  319. tPanel.remove(0);
  320. tPanel.add( data );
  321. tPanel.doLayout();
  322. },
  323. failure: function( response, opts ) {
  324. //Ext.fly('some_div').update('Fail!');
  325. }
  326. });
  327. };
  328. function loadTimeLine(){
  329. if( tlInterval!= null ){
  330. window.clearInterval( tlInterval );
  331. tlInterval = null;
  332. timelineObj = null;
  333. };
  334. var tPanel = Ext.getCmp('main_portal');
  335. tPanel.removeAll( true );
  336. Ext.getCmp('main_content').setTitle( 'Full Events Log' );
  337. tPanel.add({
  338. columnWidth: 0.83,
  339. frame: false,
  340. border: false,
  341. items: [{
  342. title: '<?=$Labels->getLabel('_MAP_MONITORING_');?>',
  343. frame: false,
  344. border: false,
  345. layout: 'vbox',
  346. layoutConfig: {
  347. align : 'stretch',
  348. pack : 'start',
  349. },
  350. height: PanelH-300,
  351. items:[{
  352. height: PanelH-325,
  353. flex: 1,
  354. frame: false,
  355. border: false,
  356. layout: 'fit',
  357. items:{
  358. //style: 'background: ivory;',
  359. id: 'event_map',
  360. html: '&nbsp;'
  361. },
  362. tbar:[{
  363. id: 'fev',
  364. text: 'Fit Events',
  365. disabled: tlMonitoring,
  366. handler: function(){
  367. timelineObj.fit();
  368. }
  369. },{
  370. id: 'gtn',
  371. text: 'Go to Now',
  372. disabled: tlMonitoring,
  373. handler: function(){
  374. timelineObj.moveTo( moment.utc() );
  375. }
  376. },{
  377. text: 'Live Monitoring',
  378. enableToggle: true,
  379. pressed: tlMonitoring,
  380. toggleHandler: function(){
  381. tlMonitoring = !tlMonitoring;
  382. if( tlMonitoring ){
  383. Ext.getCmp('gtn').disable();
  384. Ext.getCmp('fev').disable();
  385. } else {
  386. Ext.getCmp('gtn').enable();
  387. Ext.getCmp('fev').enable();
  388. };
  389. }
  390. }]
  391. }]
  392. },{
  393. title: 'Event Log',
  394. frame: false,
  395. height: 303,
  396. xtype: 'grid',
  397. ds: eventsListStore,
  398. cm: new Ext.grid.ColumnModel( eventsListColModel_ops ),
  399. sm: new Ext.grid.RowSelectionModel( eventsListSelModel_ops ),
  400. //viewConfig: {
  401. //forceFit: true
  402. //},
  403. bbar: [{
  404. text: 'Clear',
  405. handler: function(){
  406. Ext.Ajax.request({
  407. url: '/lib/controller/clearEventCloud.php',
  408. params: {
  409. UID: <?=$UserID;?>,
  410. SID: '<?=$Session;?>'
  411. },
  412. success: function( response, opts ){
  413. },
  414. failure: function( response, opts ) {
  415. }
  416. });
  417. }
  418. }/*,'->',{
  419. id: 'con_to_src',
  420. text: 'Connect To Selected',
  421. disabled: ( SelectedCam == 0 ),
  422. handler: connectToSeleced
  423. }*/]
  424. }]
  425. });
  426. tPanel.add({
  427. columnWidth: 0.17,
  428. frame: false,
  429. id: 'prop_content',
  430. border: false,
  431. items: [{
  432. title: 'Event Information',
  433. border: true,
  434. frame: true,
  435. html: '<p align="center">Select an Event from TimeLine to See Information</p>'
  436. }]
  437. });
  438. tPanel.doLayout();
  439. map = L.map('event_map',{
  440. attributionControl: true,
  441. //preferCanvas: true,
  442. zoomControl: true,
  443. center: [SiteLat, SiteLon],
  444. /*zoomControl: false,
  445. zoom: 17,
  446. minZoom: 17,
  447. maxZoom: 17,*/
  448. keyboard: false
  449. }).setView([SiteLat, SiteLon], 17);
  450. //L.marker([SiteLat, SiteLon], { draggable: false, icon: SITEZ_Icon } ).addTo(map).on('click', LoadNodesList ).bindPopup("<b><?=$Labels->GetLabel('_SYS_ANCHORT_LBL_');?></b>");
  451. var mapLayers = [];
  452. /*mapLayers["Bing"] = new BingLayer('https://t{s}.ssl.ak.dynamic.tiles.virtualearth.net/comp/ch/{q}?it=A,G,L&shading=hill', {
  453. subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'],
  454. attribution: '&copy; <a href="https://bing.com/maps" target="_blank">Bing Maps</a>',
  455. detectRetina: true
  456. });*/
  457. mapLayers["MyMap"] = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
  458. attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
  459. maxNativeZoom: 18,
  460. maxZoom: 24,
  461. })
  462. // https://leaflet-extras.github.io/leaflet-providers/preview/
  463. mapLayers["EsriStreet"] = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}', {
  464. attribution: 'Tiles &copy; <a href="https://www.esri.com" target="_blank">Esri</a> &mdash; Source: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012',
  465. maxZoom: 19
  466. });
  467. mapLayers["EsriSat"] = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', {
  468. attribution: 'Tiles &copy; <a href="https://www.esri.com" target="_blank">Esri</a> &mdash; Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community',
  469. maxZoom: 19
  470. });
  471. mapLayers["EsriTopo"] = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}', {
  472. attribution: 'Tiles &copy; <a href="https://www.esri.com" target="_blank">Esri</a> &mdash; 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',
  473. maxZoom: 24
  474. });
  475. mapLayers["OpenStreetMap"] = L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", { //de/tiles/osmde
  476. attribution: 'Map data &copy; <a href="https://openstreetmap.org" target="_blank">OpenStreetMap</a> contributors',
  477. maxZoom: 19
  478. });
  479. mapLayers["OpenTopoMap"] = L.tileLayer("https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png", {
  480. attribution: 'Kartendaten: &copy; <a href="https://openstreetmap.org/copyright" target="_blank">OpenStreetMap</a>-Mitwirkende, SRTM | Kartendarstellung: &copy; <a href="http://opentopomap.org/" target="_blank">OpenTopoMap</a> (<a href="https://creativecommons.org/licenses/by-sa/3.0/" target="_blank">CC-BY-SA</a>) ',
  481. maxZoom: 19
  482. });
  483. /*
  484. mapLayers["Cycle"] = L.tileLayer('https://tile.thunderforest.com/cycle/{z}/{x}/{y}.png?apikey=' + _PHP['API_KEY_THUNDERFOREST_1'], {
  485. attribution: 'Maps &copy; <a href="https://www.thunderforest.com" target="_blank">Thunderforest</a>, Data © <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap contributors</a>',
  486. maxZoom: 22
  487. });
  488. mapLayers["Landscape"] = L.tileLayer('https://tile.thunderforest.com/landscape/{z}/{x}/{y}.png?apikey=' + _PHP['API_KEY_THUNDERFOREST_1'], {
  489. attribution: 'Maps &copy; <a href="https://www.thunderforest.com" target="_blank">Thunderforest</a>, Data © <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap contributors</a>',
  490. maxZoom: 22
  491. });
  492. mapLayers["Outdoor"] = L.tileLayer('https://tile.thunderforest.com/outdoors/{z}/{x}/{y}.png?apikey=' + _PHP['API_KEY_THUNDERFOREST_1'], {
  493. attribution: 'Maps &copy; <a href="https://www.thunderforest.com" target="_blank">Thunderforest</a>, Data © <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap contributors</a>',
  494. maxZoom: 22
  495. });
  496. */
  497. var baseMaps = {
  498. "MyMap": mapLayers["MyMap"],
  499. "OpenStreetMap": mapLayers["OpenStreetMap"],
  500. "OpenTopoMap": mapLayers["OpenTopoMap"],
  501. "EsriSat": mapLayers["EsriSat"],
  502. "EsriStreet": mapLayers["EsriStreet"],
  503. "EsriTopo": mapLayers["EsriTopo"],
  504. //"Bing": mapLayers["Bing"],
  505. //"OSM-Cycle": mapLayers["Cycle"],
  506. //"Landscape": mapLayers["Landscape"],
  507. //"Outdoor": mapLayers["Outdoor"],
  508. };
  509. L.control.layers( baseMaps ).addTo(map);
  510. mapLayers["MyMap"].addTo(map);
  511. /*L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
  512. attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
  513. maxNativeZoom: 18,
  514. maxZoom: 24,
  515. }).addTo(map); */
  516. //loadTimeLineGroups( selectedSite );
  517. loadMapZones( SelectedSite );
  518. eventsListStore.load({params:{start:0, limit:50}});
  519. };
  520. function loadOnlineMonitoring(devID){
  521. var tPanel = Ext.getCmp('main_content');
  522. if( tlInterval!= null ){
  523. window.clearInterval( tlInterval );
  524. tlInterval = null;
  525. timelineObj = null;
  526. };
  527. tPanel.remove(0);
  528. tPanel.add({
  529. html: 'Device Monitoring '+devID
  530. });
  531. tPanel.doLayout();
  532. };