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.

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