Web Interface For Lite Argus Control modules
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.

2085 lines
67 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
3 years ago
​
3 years ago
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
3 years ago
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
3 years ago
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
3 years ago
​
​
3 years ago
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. //<?php require_once('../../js_asm.php'); ?>
  2. var ActiveZones = null;
  3. var map = null;
  4. var map_ed = null;
  5. var markers = [];
  6. var mapListStore = new Ext.data.JsonStore({
  7. root: 'maps',
  8. totalProperty: 'totalCount',
  9. idProperty: 'map_id',
  10. remoteSort: false,
  11. baseParams: {
  12. UID: '<?=$CUser->Data['id'];?>',
  13. SID: '<?=$Session;?>'//,
  14. //SITE: <?=$SiteID;?>
  15. },
  16. fields: [{
  17. name: 'map_id',
  18. type: 'int'
  19. },{
  20. name: 'map_name',
  21. type: 'string'
  22. }],
  23. proxy : new Ext.data.HttpProxy({
  24. method: 'POST',
  25. prettyUrls: false,
  26. url: '/lib/controller/listMaps.php'
  27. })
  28. });
  29. var selectedMarkerIcon = L.icon({
  30. iconUrl: '/style/assets/cursor.png',
  31. iconSize: [32, 32],
  32. iconAnchor: [16, 16]//,
  33. //popupAnchor: [-3, -76],
  34. //shadowUrl: 'my-icon-shadow.png',
  35. //shadowSize: [68, 95],
  36. //shadowAnchor: [22, 94]
  37. });
  38. selectedMarker = L.marker([SiteLat, SiteLon], { draggable: false, icon: selectedMarkerIcon } );
  39. function getZoneByNode( nid ){
  40. var rVal = -1;
  41. for( var i=0; i < ActiveZones.totalCount; i++ ){
  42. if( ActiveZones.zones[i].dev_id == nid ){
  43. rVal = i;
  44. break;
  45. };
  46. };
  47. return rVal;
  48. };
  49. function turnOffAllGzButThis( nid ){
  50. var chocho = -1;
  51. for( var i=0; i < ActiveZones.totalCount; i++ ){
  52. if( ActiveZones.zones[i].dev_id == nid ) chocho = i;
  53. map.removeLayer( ActiveZones.fig[i] );
  54. map.removeLayer( ActiveZones.zang[i] );
  55. map.removeLayer( ActiveZones.center[i] );
  56. };
  57. if( chocho > -1 ){
  58. map.addLayer( ActiveZones.fig[chocho] );
  59. map.addLayer( ActiveZones.zang[chocho] );
  60. map.addLayer( ActiveZones.center[chocho] );
  61. var cVisible = L.featureGroup( Array( ActiveZones.fig[chocho], ActiveZones.zang[chocho], ActiveZones.center[chocho] ) );
  62. map.flyToBounds( cVisible.getBounds() );
  63. };
  64. };
  65. function turnAllGzOn(){
  66. var tall = Array();
  67. for( var i=0; i < ActiveZones.totalCount; i++ ){
  68. tall[i*3] = ActiveZones.fig[i];
  69. tall[i*3+1] = ActiveZones.zang[i];
  70. tall[i*3+2] = ActiveZones.center[i];
  71. if(!map.hasLayer(ActiveZones.fig[i])) map.addLayer( ActiveZones.fig[i] );
  72. if(!map.hasLayer(ActiveZones.zang[i])) map.addLayer( ActiveZones.zang[i] );
  73. if(!map.hasLayer(ActiveZones.center[i])) map.addLayer( ActiveZones.center[i] );
  74. };
  75. var cVisible = L.featureGroup( tall );
  76. //window.setTimeout(() => {
  77. // map.flyToBounds( cVisible.getBounds() );
  78. //}, 500);
  79. map.flyToBounds( cVisible.getBounds() );
  80. };
  81. function loadMapZones( SiteID ){
  82. Ext.Ajax.request({
  83. url: '/lib/controller/getGeoZones.php',
  84. params: {
  85. SITE: SiteID,
  86. UID: <?=$UserID;?>,
  87. SID: '<?=$Session;?>'
  88. },
  89. success: function( response, opts ){
  90. // If the response is JSON, you have to decode it
  91. var data = Ext.decode(response.responseText);
  92. var pp = Ext.getCmp('sources_panel');
  93. if( typeof pp !== 'undefined' ) pp.removeAll();
  94. ActiveZones = data;
  95. ActiveZones.fig = new Array();
  96. ActiveZones.zang = new Array();
  97. ActiveZones.center = new Array();
  98. for(var i = 0; i < data.totalCount; i++ ) {
  99. switch( data.zones[i].type ){
  100. case 'circle':{
  101. //L.circle( data.zones[i].center, {radius: data.zones[i].radius, color: data.zones[i].color, weight: 1, opacity: 0.8 } ).addTo( map );
  102. 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 } );
  103. //map.addLayer( ActiveZones.fig[i] );
  104. break;
  105. };
  106. case 'poly':{
  107. 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);
  108. //map.addLayer( ActiveZones.fig[i] );
  109. break;
  110. };
  111. case 'image':{
  112. ActiveZones.fig[i] = L.imageOverlay( data.zones[i].url, data.zones[i].bounds, { opacity: 1.0 });//.addTo( map );
  113. //map.addLayer( ActiveZones.fig[i] );
  114. break;
  115. };
  116. case 'image_rot':{
  117. ActiveZones.fig[i] = L.imageOverlay.rotated( data.zones[i].url, data.zones[i].topleft, data.zones[i].topright, data.zones[i].bottomleft, {
  118. opacity: 0.8 //,
  119. //interactive: true,
  120. //attribution: "Historical building plan &copy; <a href='http://www.ign.es'>Instituto Geogr?fico Nacional de Espa?a</a>"
  121. });//.addTo( map );
  122. //map.addLayer( ActiveZones.fig[i] );
  123. break;
  124. };
  125. };
  126. /*
  127. if( data.zones[i].dev_is_source ){
  128. if( typeof pp !== 'undefined' ) {
  129. var sty = '';
  130. if( selecredActiveSourceFilter == data.zones[i].dev_id ){
  131. sty = 'cardDeviceSourceSelected';
  132. } else {
  133. sty = 'cardDeviceSource';
  134. };
  135. pp.add( {
  136. id: data.zones[i].dev_id+'_container',
  137. frame: false,
  138. border: false,
  139. width: 130,
  140. height: 130,
  141. html: '<div id="'+data.zones[i].dev_id+'_div" class="'+sty+'" onclick="clickDeviceSelector('+data.zones[i].dev_id+');"><img id="'+data.zones[i].dev_id+'_ind" width="16px" src="/style/assets/led_green_blink_300ms.gif"><center><img src="/style/assets/'+data.zones[i].dev_type+'_node.png"><br/><p class="dev_name">'+data.zones[i].dev_name+'</p></center></div>'
  142. });
  143. };
  144. };*/
  145. if( data.zones[i].zang != undefined ){
  146. //L.polygon( data.zones[i].zang, {color: '#ffff00', weight: 1, opacity: 1.0, clickable: false, interactive: false, bubblingMouseEvents: false }).addTo(map);
  147. ActiveZones.zang[i] = L.circle( data.zones[i].zang, {radius: 0.3, color: '#ffff00', weight: 1, opacity: 1.0, fillOpacity: 1.0 } );//.addTo( map );
  148. };
  149. if( data.zones[i].center != undefined ){
  150. //L.polygon( data.zones[i].zmark, {color: '#ffff00', weight: 1, opacity: 1.0, clickable: false, interactive: false, bubblingMouseEvents: false }).addTo(map);
  151. ActiveZones.center[i] = L.circle( data.zones[i].center, {radius: 0.3, color: '#ffff00', weight: 1, opacity: 1.0, fillOpacity: 1.0 } );//.addTo( map );
  152. };
  153. };
  154. //if( selecredActiveSourceFilter == 0 ){
  155. turnAllGzOn();
  156. //} else {
  157. // turnOffAllGzButThis( selecredActiveSourceFilter );
  158. //};
  159. //if( typeof pp !== 'undefined' ) pp.doLayout();
  160. },
  161. failure: function( response, opts ) {
  162. //Ext.fly('some_div').update('Fail!');
  163. }
  164. });
  165. };
  166. var cevt = Array();
  167. var coz = Array();
  168. function showEventsOnMap( data, removeCursor ){
  169. if( removeCursor == undefined ) removeCursor = true;
  170. if( removeCursor ) map.removeLayer( selectedMarker );
  171. if( cevt.length ){
  172. for( i=0; i< cevt.length; i++ ){
  173. if( cevt[i]!= null ){
  174. cevt[i].remove();
  175. delete( cevt[i] );
  176. cevt[i] = null;
  177. };
  178. };
  179. };
  180. if( coz.length ){
  181. for( i=0; i< coz.length; i++ ){
  182. if( coz[i]!= null ){
  183. coz[i].remove();
  184. delete( coz[i] );
  185. coz[i]=null;
  186. };
  187. };
  188. };
  189. var idx = 0;
  190. for( i=0; i < data.length; i++ ){
  191. if( data[i].targets != undefined ){
  192. var zz = ( 1.0 / ( data[i].targets.length + 0 ) );
  193. var cp_color='#FF0000';
  194. for( j = 0; j < data[i].targets.length; j++ ){
  195. //switch( data.log[i].event ){
  196. // case 36: cp_color='#0000FF'; break;
  197. //};
  198. cLon = data[i].targets[j].lon;
  199. cLat = data[i].targets[j].lat;
  200. cevt[idx] = L.circleMarker( [cLat, cLon], {id:data[i].id, color: cp_color, radius: 5, stroke: false, fillOpacity: ( 1.0 - i * zz ) } );//.on('click', function( e, a ){
  201. // loadEventPropertiesByID( this.options.id );
  202. //} );
  203. cevt[idx].addTo(map);
  204. idx++;
  205. };
  206. };
  207. };
  208. };
  209. function LoadMapEventsZ( Mode ){
  210. if( tlLoadLocker ) return;
  211. tlLoadLocker = true;
  212. Ext.Ajax.request({
  213. url: '/lib/controller/getGeoAlerts.php',
  214. params: {
  215. SITE: <?=$SiteID;?>,
  216. UID: <?=$UserID;?>,
  217. SID: '<?=$Session;?>',
  218. MODE: Mode
  219. },
  220. success: function( response, opts ){
  221. if( cevt.length ){
  222. for( i=0; i< cevt.length; i++ ){
  223. if( cevt[i]!= null ){
  224. cevt[i].remove();
  225. delete( cevt[i] );
  226. cevt[i] = null;
  227. };
  228. };
  229. };
  230. if( coz.length ){
  231. for( i=0; i< coz.length; i++ ){
  232. if( coz[i]!= null ){
  233. coz[i].remove();
  234. delete( coz[i] );
  235. coz[i]=null;
  236. };
  237. };
  238. };
  239. var data = Ext.decode( response.responseText );
  240. var zz = ( 1.0 / ( data.evt.length + 0 ) );
  241. for( i=0; i < data.evt.length; i++ ){
  242. 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 ){
  243. loadEventProperties( this.options.id );
  244. } );
  245. cevt[i].addTo(map);
  246. };
  247. for( i=0; i < data.other.length; i++ ){
  248. switch( data.other[i].type ){
  249. case 'circle':{
  250. 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 } );
  251. coz[i].addTo(map);
  252. break;
  253. };
  254. };
  255. };
  256. //eventsListStore.reload();
  257. tlLoadLocker = false;
  258. },
  259. failure: function( response, opts ) {
  260. //Ext.fly('some_div').update('Fail!');
  261. tlLoadLocker = false;
  262. }
  263. });
  264. };
  265. function initMapMonitoring__00(){
  266. map = L.map('event_map',{
  267. attributionControl: true,
  268. //preferCanvas: true,
  269. zoomControl: true,
  270. center: [SiteLat, SiteLon],
  271. /*zoomControl: false,
  272. zoom: 17,
  273. minZoom: 17,
  274. maxZoom: 17,*/
  275. keyboard: false
  276. }).setView([SiteLat, SiteLon], 17);
  277. //L.marker([SiteLat, SiteLon], { draggable: false, icon: SITEZ_Icon } ).addTo(map).on('click', LoadNodesList ).bindPopup("<b><?=$Labels->GetLabel('_SYS_ANCHORT_LBL_');?></b>");
  278. var mapLayers = [];
  279. /*mapLayers["Bing"] = new BingLayer('https://t{s}.ssl.ak.dynamic.tiles.virtualearth.net/comp/ch/{q}?it=A,G,L&shading=hill', {
  280. subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'],
  281. attribution: '&copy; <a href="https://bing.com/maps" target="_blank">Bing Maps</a>',
  282. detectRetina: true
  283. });*/
  284. mapLayers["MyMap"] = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
  285. attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
  286. maxNativeZoom: 18,
  287. maxZoom: 24,
  288. })
  289. // https://leaflet-extras.github.io/leaflet-providers/preview/
  290. mapLayers["EsriStreet"] = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}', {
  291. 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',
  292. maxZoom: 19
  293. });
  294. mapLayers["EsriSat"] = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', {
  295. 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',
  296. maxZoom: 19
  297. });
  298. mapLayers["EsriTopo"] = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}', {
  299. 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',
  300. maxZoom: 24
  301. });
  302. mapLayers["OpenStreetMap"] = L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", { //de/tiles/osmde
  303. attribution: 'Map data &copy; <a href="https://openstreetmap.org" target="_blank">OpenStreetMap</a> contributors',
  304. maxZoom: 19
  305. });
  306. mapLayers["OpenTopoMap"] = L.tileLayer("https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png", {
  307. 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>) ',
  308. maxZoom: 19
  309. });
  310. /*
  311. mapLayers["Cycle"] = L.tileLayer('https://tile.thunderforest.com/cycle/{z}/{x}/{y}.png?apikey=' + _PHP['API_KEY_THUNDERFOREST_1'], {
  312. 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>',
  313. maxZoom: 22
  314. });
  315. mapLayers["Landscape"] = L.tileLayer('https://tile.thunderforest.com/landscape/{z}/{x}/{y}.png?apikey=' + _PHP['API_KEY_THUNDERFOREST_1'], {
  316. 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>',
  317. maxZoom: 22
  318. });
  319. mapLayers["Outdoor"] = L.tileLayer('https://tile.thunderforest.com/outdoors/{z}/{x}/{y}.png?apikey=' + _PHP['API_KEY_THUNDERFOREST_1'], {
  320. 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>',
  321. maxZoom: 22
  322. });
  323. */
  324. var baseMaps = {
  325. "MyMap": mapLayers["MyMap"],
  326. "OpenStreetMap": mapLayers["OpenStreetMap"],
  327. "OpenTopoMap": mapLayers["OpenTopoMap"],
  328. "EsriSat": mapLayers["EsriSat"],
  329. "EsriStreet": mapLayers["EsriStreet"],
  330. "EsriTopo": mapLayers["EsriTopo"],
  331. //"Bing": mapLayers["Bing"],
  332. //"OSM-Cycle": mapLayers["Cycle"],
  333. //"Landscape": mapLayers["Landscape"],
  334. //"Outdoor": mapLayers["Outdoor"],
  335. };
  336. //L.control.layers( baseMaps ).addTo(map);
  337. mapLayers["MyMap"].addTo(map);
  338. /*L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
  339. attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
  340. maxNativeZoom: 18,
  341. maxZoom: 24,
  342. }).addTo(map); */
  343. //loadTimeLineGroups( selectedSite );
  344. loadMapZones( 0 );
  345. //getData( 'arch' );
  346. };
  347. function initMapMonitoring(){
  348. var aK = true;
  349. if( MAP_SET.attribution == '' ) aK = false;
  350. var mapLayers = [];
  351. if( map != null ){
  352. //ToDo: must be moved to Upper Menu changer
  353. map.off();
  354. map.remove();
  355. map = null;
  356. };
  357. switch( MAP_SET.type ){
  358. case 1: {
  359. map = L.map( 'event_map',{
  360. //attributionControl: aK,
  361. attributionControl: false,
  362. preferCanvas: true,
  363. zoomControl: true,
  364. center: [SiteLat, SiteLon],
  365. /*zoomControl: false,
  366. zoom: 17,
  367. minZoom: 17,
  368. maxZoom: 17,*/
  369. keyboard: false
  370. });
  371. map.setView([SiteLat, SiteLon], 17 );
  372. //mapLayers[ MAP_SET.name ] = L.tileLayer( MAP_SET.layer_url, {
  373. // attribution: MAP_SET.attribution,
  374. // maxNativeZoom: MAP_SET.maxNativeZoom,
  375. // maxZoom: MAP_SET.maxZoom
  376. //});
  377. L.tileLayer( MAP_SET.layer_url, {
  378. attribution: MAP_SET.attribution,
  379. attributionControl: false,
  380. maxNativeZoom: MAP_SET.maxNativeZoom,
  381. //minZoom: 0,
  382. maxZoom: MAP_SET.maxZoom
  383. }).addTo( map );
  384. break;
  385. };
  386. case 2:{
  387. map = L.map( 'event_map',{
  388. crs: L.CRS.Simple,
  389. attributionControl: false,
  390. preferCanvas: true,
  391. zoomControl: true,
  392. center: [SiteLat, SiteLon],
  393. /*zoomControl: false,*/
  394. zoom: 2,
  395. minZoom: -1,
  396. maxZoom: 4,
  397. keyboard: false
  398. });
  399. var bounds = [[MAP_SET.bounds_lx,MAP_SET.bounds_ly], [MAP_SET.bounds_rx,MAP_SET.bounds_ry]];
  400. var image = L.imageOverlay( '/lib/controller/data/assets/images/'+MAP_SET.layer_url, bounds ).addTo( map );
  401. //map.setView([SiteLat, SiteLon], -1 );
  402. break;
  403. };
  404. case 3:{
  405. map = L.map( 'event_map',{
  406. attributionControl: false,
  407. preferCanvas: true,
  408. zoomControl: true,
  409. center: [SiteLat,SiteLon],
  410. zoom: MAP_SET.maxZoom - 2,
  411. minZoom: MAP_SET.maxZoom - 4,
  412. maxZoom: MAP_SET.maxZoom,
  413. keyboard: false
  414. });
  415. var bounds = [[MAP_SET.bounds_ly,MAP_SET.bounds_lx], [MAP_SET.bounds_ry,MAP_SET.bounds_rx]];
  416. var image = L.imageOverlay( '/lib/controller/data/assets/images/'+MAP_SET.layer_url, bounds ).addTo( map );
  417. break;
  418. };
  419. };
  420. //ToDo: Fix Initial Zoom level -> May be saving into a user profile
  421. loadMapZones( 0 );
  422. };
  423. function initMapReporting(){
  424. var aK = true;
  425. if( MAP_SET.attribution == '' ) aK = false;
  426. var mapLayers = [];
  427. if( map != null ){
  428. //ToDo: must be moved to Upper Menu changer
  429. map.off();
  430. map.remove();
  431. map = null;
  432. };
  433. switch( MAP_SET.type ){
  434. case 1:{
  435. map = L.map( 'report_map',{
  436. //attributionControl: aK,
  437. attributionControl: false,
  438. preferCanvas: true,
  439. zoomControl: true,
  440. center: [SiteLat, SiteLon],
  441. /*zoomControl: false,
  442. zoom: 17,
  443. minZoom: 17,
  444. maxZoom: 17,*/
  445. keyboard: false
  446. });
  447. map.setView([SiteLat, SiteLon], 17 );
  448. //mapLayers[ MAP_SET.name ] = L.tileLayer( MAP_SET.layer_url, {
  449. // attribution: MAP_SET.attribution,
  450. // maxNativeZoom: MAP_SET.maxNativeZoom,
  451. // maxZoom: MAP_SET.maxZoom
  452. //});
  453. L.tileLayer( MAP_SET.layer_url, {
  454. attribution: MAP_SET.attribution,
  455. attributionControl: false,
  456. maxNativeZoom: MAP_SET.maxNativeZoom,
  457. minZoom: 0,
  458. maxZoom: MAP_SET.maxZoom
  459. }).addTo( map );
  460. break;
  461. };
  462. case 2:{
  463. map = L.map( 'report_map',{
  464. crs: L.CRS.Simple,
  465. attributionControl: false,
  466. preferCanvas: true,
  467. zoomControl: true,
  468. center: [SiteLat, SiteLon],
  469. /*zoomControl: false,*/
  470. zoom: 0,
  471. minZoom: -1,
  472. maxZoom: 4,
  473. keyboard: false
  474. });
  475. var bounds = [[MAP_SET.bounds_lx,MAP_SET.bounds_ly], [MAP_SET.bounds_rx,MAP_SET.bounds_ry]];
  476. var image = L.imageOverlay( '/lib/controller/data/assets/images/'+MAP_SET.layer_url, bounds ).addTo( map );
  477. //map.setView([SiteLat, SiteLon], -1 );
  478. break;
  479. };
  480. case 3:{
  481. map = L.map( 'report_map',{
  482. attributionControl: false,
  483. preferCanvas: true,
  484. zoomControl: true,
  485. center: [SiteLat,SiteLon],
  486. zoom: MAP_SET.maxZoom - 2,
  487. minZoom: MAP_SET.maxZoom - 4,
  488. maxZoom: MAP_SET.maxZoom,
  489. keyboard: false
  490. });
  491. var bounds = [[MAP_SET.bounds_ly,MAP_SET.bounds_lx], [MAP_SET.bounds_ry,MAP_SET.bounds_rx]];
  492. var image = L.imageOverlay( '/lib/controller/data/assets/images/'+MAP_SET.layer_url, bounds ).addTo( map );
  493. break;
  494. };
  495. };
  496. //ToDo: Fix Initial Zoom level -> May be saving into a user profile
  497. loadMapZones( 0 );
  498. };
  499. var iconSaver = null;
  500. var markerSaver = null;
  501. function updateLocation( e ){
  502. locationSelectedNode = e.target.options.mycustomid;
  503. Ext.Ajax.request({
  504. url: '/lib/controller/updateLocation.php',
  505. params: {
  506. NODE: locationSelectedNode,
  507. SITE: <?=$SiteID;?>,
  508. UID: <?=$UserID;?>,
  509. TYPE: 0,
  510. SID: '<?=$Session;?>',
  511. LAT: e.target._latlng.lat,
  512. LON: e.target._latlng.lng
  513. },
  514. success: function( response, opts ){
  515. loadNodeLocationProps( locationSelectedNode );
  516. },
  517. failure: failureAJAXFunction
  518. });
  519. };
  520. function markerDblClick( e ){
  521. if( iconSaver == null ){
  522. iconSaver = e.target.options.icon;
  523. markerSaver = e.target;
  524. e.target.setIcon( SNAPE_Icon );
  525. for( i=0; i< markers.length; i++){
  526. if( markers[i].options.mycustomid != e.target.options.mycustomid ){
  527. markers[i].setOpacity( 0.1 );
  528. } else {
  529. markers[i].setOpacity( 1.0 );
  530. }
  531. };
  532. } else {
  533. if( e.target.options.mycustomid == markerSaver.options.mycustomid ){
  534. e.target.setIcon( iconSaver );
  535. iconSaver = null;
  536. markerSaver = null;
  537. for( i=0; i< markers.length; i++){
  538. markers[i].setOpacity( 1.0 );
  539. };
  540. } else {
  541. markerSaver.setIcon( iconSaver );
  542. iconSaver = e.target.options.icon;
  543. markerSaver = e.target;
  544. e.target.setIcon( SNAPE_Icon );
  545. for( i=0; i< markers.length; i++){
  546. if( markers[i].options.mycustomid != e.target.options.mycustomid ){
  547. markers[i].setOpacity( 0.1 );
  548. } else {
  549. markers[i].setOpacity( 1.0 );
  550. }
  551. };
  552. };
  553. };
  554. };
  555. function setNodeLocationToAnchor(){
  556. Ext.Ajax.request({
  557. url: '/lib/controller/updateLocation.php',
  558. params: {
  559. NODE: locationSelectedNode,
  560. SITE: <?=$SiteID;?>,
  561. UID: <?=$UserID;?>,
  562. TYPE: 0,
  563. SID: '<?=$Session;?>',
  564. LAT: SiteLat,
  565. LON: SiteLon,
  566. ALT: SiteAlt
  567. },
  568. success: function( response, opts ){
  569. loadLocationEditor('sys_location_map');
  570. },
  571. failure: failureAJAXFunction
  572. });
  573. };
  574. function setNodeLocationByDelta(){
  575. var dx = Ext.getCmp('dx').getValue();
  576. var dy = Ext.getCmp('dy').getValue();
  577. var dz = Ext.getCmp('dz').getValue();
  578. Ext.Ajax.request({
  579. url: '/lib/controller/updateLocation.php',
  580. params: {
  581. NODE: locationSelectedNode,
  582. SITE: <?=$SiteID;?>,
  583. UID: <?=$UserID;?>,
  584. TYPE: 3,
  585. SID: '<?=$Session;?>',
  586. LAT: dx,
  587. LON: dy,
  588. ALT: dz
  589. },
  590. success: function( response, opts ){
  591. loadLocationEditor('sys_location_map');
  592. },
  593. failure: failureAJAXFunction
  594. });
  595. };
  596. var LRF3D_Icon = L.icon({
  597. iconUrl: '/style/assets/5_node.png',
  598. //shadowUrl: 'leaf-shadow.png',
  599. iconSize: [64, 64], // size of the icon
  600. //shadowSize: [50, 64], // size of the shadow
  601. iconAnchor: [32, 32], // point of the icon which will correspond to marker's location
  602. //shadowAnchor: [4, 62], // the same for the shadow
  603. popupAnchor: [0, -30] // point from which the popup should open relative to the iconAnchor
  604. });
  605. var LFS_Icon = L.icon({
  606. iconUrl: '/style/assets/2_node.png',
  607. //shadowUrl: 'leaf-shadow.png',
  608. iconSize: [64, 64], // size of the icon
  609. //shadowSize: [50, 64], // size of the shadow
  610. iconAnchor: [32, 32], // point of the icon which will correspond to marker's location
  611. //shadowAnchor: [4, 62], // the same for the shadow
  612. popupAnchor: [0, -30] // point from which the popup should open relative to the iconAnchor
  613. });
  614. var PLS200_Icon = L.icon({
  615. iconUrl: '/style/assets/3_node.png',
  616. //shadowUrl: 'leaf-shadow.png',
  617. iconSize: [64, 64], // size of the icon
  618. //shadowSize: [50, 64], // size of the shadow
  619. iconAnchor: [32, 32], // point of the icon which will correspond to marker's location
  620. //shadowAnchor: [4, 62], // the same for the shadow
  621. popupAnchor: [0, -30] // point from which the popup should open relative to the iconAnchor
  622. });
  623. var PLSNET200_Icon = L.icon({
  624. iconUrl: '/style/assets/6_node.png',
  625. //shadowUrl: 'leaf-shadow.png',
  626. iconSize: [64, 64], // size of the icon
  627. //shadowSize: [50, 64], // size of the shadow
  628. iconAnchor: [32, 32], // point of the icon which will correspond to marker's location
  629. //shadowAnchor: [4, 62], // the same for the shadow
  630. popupAnchor: [0, -30] // point from which the popup should open relative to the iconAnchor
  631. });
  632. var PLS360_Icon = L.icon({
  633. iconUrl: '/style/assets/4_node.png',
  634. //shadowUrl: 'leaf-shadow.png',
  635. iconSize: [64, 64], // size of the icon
  636. //shadowSize: [50, 64], // size of the shadow
  637. iconAnchor: [32, 32], // point of the icon which will correspond to marker's location
  638. //shadowAnchor: [4, 62], // the same for the shadow
  639. popupAnchor: [0, -30] // point from which the popup should open relative to the iconAnchor
  640. });
  641. var ALS_Icon = L.icon({
  642. iconUrl: '/style/assets/1_node.png',
  643. //shadowUrl: 'leaf-shadow.png',
  644. iconSize: [64, 64], // size of the icon
  645. //shadowSize: [50, 64], // size of the shadow
  646. iconAnchor: [32, 32], // point of the icon which will correspond to marker's location
  647. //shadowAnchor: [4, 62], // the same for the shadow
  648. popupAnchor: [0, -30] // point from which the popup should open relative to the iconAnchor
  649. });
  650. var PTZCAM_Icon = L.icon({
  651. iconUrl: '/style/assets/12_node.png',
  652. //shadowUrl: 'leaf-shadow.png',
  653. iconSize: [64, 64], // size of the icon
  654. //shadowSize: [50, 64], // size of the shadow
  655. iconAnchor: [32, 32], // point of the icon which will correspond to marker's location
  656. //shadowAnchor: [4, 62], // the same for the shadow
  657. popupAnchor: [0, -30] // point from which the popup should open relative to the iconAnchor
  658. });
  659. var FIXCAM_Icon = L.icon({
  660. iconUrl: '/style/assets/11_node.png',
  661. //shadowUrl: 'leaf-shadow.png',
  662. iconSize: [64, 64], // size of the icon
  663. //shadowSize: [50, 64], // size of the shadow
  664. iconAnchor: [32, 32], // point of the icon which will correspond to marker's location
  665. //shadowAnchor: [4, 62], // the same for the shadow
  666. popupAnchor: [0, -30] // point from which the popup should open relative to the iconAnchor
  667. });
  668. var SITEZ_Icon = L.icon({
  669. iconUrl: '/style/assets/centre_1.png',
  670. //shadowUrl: 'leaf-shadow.png',
  671. iconSize: [32, 32], // size of the icon
  672. //shadowSize: [50, 64], // size of the shadow
  673. iconAnchor: [16, 16], // point of the icon which will correspond to marker's location
  674. //shadowAnchor: [4, 62], // the same for the shadow
  675. popupAnchor: [0, -15] // point from which the popup should open relative to the iconAnchor
  676. });
  677. var SNAPE_Icon = L.icon({
  678. iconUrl: '/style/assets/cursor.png',
  679. //shadowUrl: 'leaf-shadow.png',
  680. iconSize: [32, 32], // size of the icon
  681. //shadowSize: [50, 64], // size of the shadow
  682. iconAnchor: [16, 16], // point of the icon which will correspond to marker's location
  683. //shadowAnchor: [4, 62], // the same for the shadow
  684. popupAnchor: [0, -15] // point from which the popup should open relative to the iconAnchor
  685. });
  686. function loadLocationNodes(){
  687. Ext.Ajax.request({
  688. url: '/lib/controller/getLocationItems.php',
  689. params: {
  690. SITE: <?=$SiteID;?>,
  691. UID: <?=$UserID;?>,
  692. SID: '<?=$Session;?>'
  693. },
  694. success: function( response, opts ){
  695. var data = Ext.decode(response.responseText);
  696. if( data!= null ){
  697. var i = 0;
  698. var tall = Array();
  699. for( ; i < data.length; i++){
  700. switch( data[i].type ){
  701. case 1:{
  702. markers[i] = L.marker([data[i].lat, data[i].lon], {draggable: true,icon: ALS_Icon, mycustomid:data[i].id } ).addTo( map_ed ).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
  703. break;
  704. };
  705. case 2:{
  706. markers[i] = L.marker([data[i].lat, data[i].lon], {draggable: true,icon: LFS_Icon, mycustomid:data[i].id } ).addTo( map_ed ).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
  707. break;
  708. };
  709. case 3:{
  710. markers[i] = L.marker([data[i].lat, data[i].lon], {draggable: true,icon: PLS200_Icon, mycustomid:data[i].id } ).addTo( map_ed ).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
  711. break;
  712. };
  713. case 4:{
  714. markers[i] = L.marker([data[i].lat, data[i].lon], {draggable: true,icon: PLS360_Icon, mycustomid:data[i].id } ).addTo( map_ed ).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
  715. break;
  716. };
  717. case 5:{
  718. markers[i] = L.marker([data[i].lat, data[i].lon], {draggable: true,icon: LRF3D_Icon, mycustomid:data[i].id } ).addTo( map_ed ).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
  719. break;
  720. };
  721. case 6:{
  722. markers[i] = L.marker([data[i].lat, data[i].lon], {draggable: true,icon: PLSNET200_Icon, mycustomid:data[i].id } ).addTo( map_ed ).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
  723. break;
  724. };
  725. case 10:
  726. case 12:{
  727. markers[i] = L.marker([data[i].lat, data[i].lon], {draggable: true,icon: FIXCAM_Icon, mycustomid:data[i].id } ).addTo( map_ed ).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
  728. break;
  729. };
  730. case 11:
  731. case 13:{
  732. markers[i] = L.marker([data[i].lat, data[i].lon], {draggable: true,icon: PTZCAM_Icon, mycustomid:data[i].id } ).addTo( map_ed ).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
  733. break;
  734. };
  735. };
  736. tall[i] = markers[i];
  737. };
  738. tall[i++] = ed_anchor;
  739. var cVisible = L.featureGroup( tall );
  740. map_ed.flyToBounds( cVisible.getBounds() );
  741. } else {
  742. map_ed.setView([SiteLat, SiteLon], 4 );
  743. };
  744. },
  745. failure: function( response, opts ) {
  746. //var tPanel = Ext.getCmp('main_portal');
  747. //tPanel.remove(0);
  748. //tPanel.add( { html: 'Failed to load dashboard!' } );
  749. //tPanel.doLayout();
  750. }
  751. });
  752. };
  753. function orientationEditor(){
  754. if( orientationEditorWindow == null ){
  755. orientationEditorWindow = new Ext.Window({
  756. modal: true,
  757. title: '<?=$Labels->GetLabel('_ORIENTATION_');?>',
  758. closeAction: 'hide',
  759. width: 640,
  760. height: 500,
  761. items:[{
  762. layout: 'table',
  763. defaults: {
  764. bodyStyle:'padding:5px'
  765. },
  766. layoutConfig: {
  767. columns: 3
  768. },
  769. items:[{
  770. html: 'Roll:'
  771. },{
  772. xtype: 'textfield',
  773. id: 'roll',
  774. name: 'roll',
  775. value: 30.0029,
  776. listeners:{
  777. change: function( sl, nv, tt ){
  778. setCubeOrientation( nv / 1.0, curY, curZ );
  779. }
  780. }
  781. },{
  782. xtype: 'slider',
  783. id: 'roll_sld',
  784. width: 200,
  785. value: 30.0029,
  786. minValue: -180.0,
  787. maxValue: 180.0,
  788. listeners:{
  789. change: function( sl, nv, tt ){
  790. setCubeOrientation( nv, curY, curZ );
  791. }
  792. }
  793. },{
  794. html: 'Pitch:'
  795. },{
  796. xtype: 'textfield',
  797. id: 'pitch',
  798. name: 'pitch',
  799. value: 30.0029,
  800. listeners:{
  801. change: function( sl, nv, tt ){
  802. setCubeOrientation( curX, nv / 1.0, curZ );
  803. }
  804. }
  805. },{
  806. xtype: 'slider',
  807. id: 'pitch_sld',
  808. width: 200,
  809. value: 30.0029,
  810. minValue: -180.0,
  811. maxValue: 180.0,
  812. listeners:{
  813. change: function( sl, nv, tt ){
  814. setCubeOrientation( curX, nv, curZ );
  815. }
  816. }
  817. },{
  818. html: 'Yaw:'
  819. },{
  820. xtype: 'textfield',
  821. id: 'yaw',
  822. name: 'yaw',
  823. value: 30.0029,
  824. listeners:{
  825. change: function( sl, nv, tt ){
  826. //alert( nv );
  827. setCubeOrientation( curX, curY, nv / 1.0 );
  828. }
  829. }
  830. },{
  831. xtype: 'slider',
  832. id: 'yaw_sld',
  833. width: 200,
  834. value: 30.0029,
  835. minValue: -180.0,
  836. maxValue: 180.0,
  837. listeners:{
  838. change: function( sl, nv, tt ){
  839. setCubeOrientation( curX, curY, nv );
  840. }
  841. }
  842. }]
  843. },{
  844. html: '<div id="wrapper"><div class="viewport"><div class="cube"><div class="side"><div class="cube-image top">FRONT</div></div><div class="side"><div class="cube-image">TOP</div></div><div class="side"><div class="cube-image">RIGHT</div></div><div class="side"><div class="cube-image">BOTTOM</div></div><div class="side"><div class="cube-image">LEFT</div></div><div class="side"><div class="cube-image active">BACK</div></div></div></div></div>'
  845. }],
  846. buttons:[{
  847. text: 'Cancel',
  848. width: 200,
  849. handler: function(){
  850. orientationEditorWindow.hide();
  851. }
  852. },{
  853. text: 'Apply',
  854. width: 200,
  855. handler: function(){
  856. Ext.getCmp('sroll').setValue( Ext.getCmp('roll').getValue() );
  857. Ext.getCmp('spitch').setValue( Ext.getCmp('pitch').getValue() );
  858. Ext.getCmp('syaw').setValue( Ext.getCmp('yaw').getValue() );
  859. orientationEditorWindow.hide();
  860. }
  861. }]
  862. });
  863. orientationEditorWindow.show();
  864. cubeViewport = new Viewport({
  865. element: document.getElementsByClassName('cube')[0],
  866. fps: 20,
  867. sensivity: .1,
  868. sensivityFade: .93,
  869. speed: 2,
  870. touchSensivity: 1.5
  871. });
  872. cube = new Cube({
  873. viewport: cubeViewport,
  874. element: document.getElementsByClassName('cube')[0]
  875. });
  876. } else {
  877. orientationEditorWindow.show();
  878. };
  879. setCubeOrientation( Ext.getCmp('sroll').getValue(), Ext.getCmp('spitch').getValue(), Ext.getCmp('syaw').getValue() );
  880. };
  881. var locationSelectedNode = 0;
  882. function loadLoactionProps( e ){
  883. if( typeof e == 'number' ){
  884. locationSelectedNode = e;
  885. } else {
  886. locationSelectedNode = e.sourceTarget.options.mycustomid;
  887. }
  888. loadNodeLocationProps( locationSelectedNode );
  889. };
  890. function loadNodeLocationProps( NodeID ){
  891. //alert( 'Node: ' + NodeID );
  892. Ext.Ajax.request({
  893. url: '/lib/controller/getLocationNodeProps.php',
  894. params: {
  895. NID: <?=$SiteID;?>,
  896. UID: <?=$UserID;?>,
  897. SID: '<?=$Session;?>',
  898. NODE: NodeID
  899. },
  900. success: function( response, opts ){
  901. // If the response is JSON, you have to decode it
  902. var data = Ext.decode(response.responseText);
  903. var tPanel = Ext.getCmp('prop_content');
  904. tPanel.remove(0);
  905. tPanel.add( data );
  906. tPanel.doLayout();
  907. },
  908. failure: failureAJAXFunction
  909. });
  910. };
  911. function LoadNodesList(){
  912. Ext.Ajax.request({
  913. url: '/lib/controller/getLocationNodes.php',
  914. params: {
  915. SITE: <?=$SiteID;?>,
  916. UID: <?=$UserID;?>,
  917. SID: '<?=$Session;?>'
  918. },
  919. success: function( response, opts ){
  920. var data = Ext.decode(response.responseText);
  921. var tPanel = Ext.getCmp('prop_content');
  922. tPanel.remove(0);
  923. tPanel.add( data );
  924. tPanel.doLayout();
  925. },
  926. failure: failureAJAXFunction
  927. });
  928. };
  929. function reloadSiteMapData(){
  930. Ext.Ajax.request({
  931. url: '/lib/controller/getMapData.php',
  932. params: {
  933. SITE: <?=$SiteID;?>,
  934. UID: <?=$UserID;?>,
  935. SID: '<?=$Session;?>'
  936. },
  937. success: function( response, opts ){
  938. var data = Ext.decode(response.responseText);
  939. MAP_ID = parseInt( data.selected_map );
  940. MAP_IS_LOCAL = (MAP_ID)?data.local_binding:false;
  941. MAP_SET = data.maps;
  942. Ext.getCmp('lab_123').update( '<?=$Labels->GetLabel('_SYS_ANCHORT_LBL_');?> '+((MAP_IS_LOCAL)?'Pos X':'<?=$Labels->GetLabel('_LON_SHORT_LBL_');?>')+':' );
  943. Ext.getCmp('lab_124').update( ((MAP_IS_LOCAL)?'Pos Y':'<?=$Labels->GetLabel('_LAT_SHORT_LBL_');?>')+':' );
  944. document.getElementById('lab_125').src = ((MAP_IS_LOCAL)?'/style/assets/map_mode_decart.png':'/style/assets/map_mode_wgs84.png');
  945. loadLocationEditor('sys_location_map');
  946. },
  947. failure: failureAJAXFunction
  948. });
  949. };
  950. var ed_anchor = null;
  951. function loadLocationEditor( el_id , node_type, node_id, lat, lon ){
  952. if( tlInterval!= null ){
  953. window.clearInterval( tlInterval );
  954. tlInterval = null;
  955. timelineObj = null;
  956. };
  957. if( node_type == undefined ) node_type = 0;
  958. if( lat == undefined ){
  959. lat = SiteLat;
  960. lon = SiteLon;
  961. };
  962. //var cMSET = mapListStore.getAt( MAP_ID );
  963. //alert( MAP_SET.id );
  964. var aK = true;
  965. if( MAP_SET.attribution == '' ) aK = false;
  966. var mapLayers = [];
  967. if( map_ed != undefined ){
  968. map_ed.off();
  969. map_ed.remove();
  970. };
  971. switch( MAP_SET.type ){
  972. case 1:{
  973. map_ed = L.map( el_id,{
  974. attributionControl: aK,
  975. //preferCanvas: true,
  976. zoomControl: true,
  977. center: [SiteLat,SiteLon],
  978. /*zoomControl: false,
  979. zoom: 17,
  980. minZoom: 17,
  981. maxZoom: 17,*/
  982. keyboard: false
  983. });
  984. //mapLayers[ MAP_SET.name ] = L.tileLayer( MAP_SET.layer_url, {
  985. // attribution: MAP_SET.attribution,
  986. // maxNativeZoom: MAP_SET.maxNativeZoom,
  987. // maxZoom: MAP_SET.maxZoom
  988. //});
  989. L.tileLayer( MAP_SET.layer_url, {
  990. attribution: MAP_SET.attribution,
  991. maxNativeZoom: MAP_SET.maxNativeZoom,
  992. minZoom: 0,
  993. maxZoom: MAP_SET.maxZoom
  994. }).addTo( map_ed );
  995. break;
  996. };
  997. case 2:{
  998. map_ed = L.map( el_id,{
  999. crs: L.CRS.Simple,
  1000. attributionControl: false,
  1001. preferCanvas: true,
  1002. zoomControl: true,
  1003. center: [SiteLat,SiteLon],
  1004. /*zoomControl: false,*/
  1005. zoom: 0,
  1006. minZoom: 0,
  1007. maxZoom: 4,
  1008. keyboard: false
  1009. });
  1010. var bounds = [[MAP_SET.bounds_lx,MAP_SET.bounds_ly], [MAP_SET.bounds_rx,MAP_SET.bounds_ry]];
  1011. var image = L.imageOverlay( '/lib/controller/data/assets/images/'+MAP_SET.layer_url, bounds ).addTo( map_ed );
  1012. break;
  1013. };
  1014. case 3:{
  1015. map_ed = L.map( el_id,{
  1016. attributionControl: false,
  1017. preferCanvas: true,
  1018. zoomControl: true,
  1019. center: [SiteLat,SiteLon],
  1020. zoom: MAP_SET.maxZoom - 2,
  1021. minZoom: MAP_SET.maxZoom - 4,
  1022. maxZoom: MAP_SET.maxZoom,
  1023. keyboard: false
  1024. });
  1025. var bounds = [[MAP_SET.bounds_ly,MAP_SET.bounds_lx], [MAP_SET.bounds_ry,MAP_SET.bounds_rx]];
  1026. var image = L.imageOverlay( '/lib/controller/data/assets/images/'+MAP_SET.layer_url, bounds ).addTo( map_ed );
  1027. break;
  1028. };
  1029. };
  1030. map_ed.setView([SiteLat,SiteLon], MAP_SET.maxZoom );
  1031. if( node_type ){
  1032. ed_anchor = L.marker([SiteLat, SiteLon], { draggable: false, icon: SITEZ_Icon, zIndexOffset: 1000 } ).addTo(map_ed).bindPopup("<b><?=$Labels->GetLabel('_SYS_ANCHORT_LBL_');?></b>");//.openPopup();
  1033. } else {
  1034. ed_anchor = L.marker([SiteLat, SiteLon], { draggable: false, icon: SITEZ_Icon, zIndexOffset: 1000 } ).addTo(map_ed).on('click', LoadNodesList ).bindPopup("<b><?=$Labels->GetLabel('_SYS_ANCHORT_LBL_');?></b>");//.openPopup();
  1035. };
  1036. /*
  1037. mapLayers["MyMap"] = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
  1038. attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
  1039. maxNativeZoom: 18,
  1040. maxZoom: 24,
  1041. })
  1042. // https://leaflet-extras.github.io/leaflet-providers/preview/
  1043. mapLayers["EsriStreet"] = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}', {
  1044. 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',
  1045. maxZoom: 19
  1046. });
  1047. mapLayers["EsriSat"] = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', {
  1048. 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',
  1049. maxZoom: 19
  1050. });
  1051. mapLayers["EsriTopo"] = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}', {
  1052. 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',
  1053. maxZoom: 24
  1054. });
  1055. mapLayers["OpenStreetMap"] = L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", { //de/tiles/osmde
  1056. attribution: 'Map data &copy; <a href="https://openstreetmap.org" target="_blank">OpenStreetMap</a> contributors',
  1057. maxZoom: 19
  1058. });
  1059. mapLayers["OpenTopoMap"] = L.tileLayer("https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png", {
  1060. 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>) ',
  1061. maxZoom: 19
  1062. });
  1063. var baseMaps = {
  1064. "MyMap": mapLayers["MyMap"],
  1065. "OpenStreetMap": mapLayers["OpenStreetMap"],
  1066. "OpenTopoMap": mapLayers["OpenTopoMap"],
  1067. "EsriSat": mapLayers["EsriSat"],
  1068. "EsriStreet": mapLayers["EsriStreet"],
  1069. "EsriTopo": mapLayers["EsriTopo"],
  1070. //"Bing": mapLayers["Bing"],
  1071. //"OSM-Cycle": mapLayers["Cycle"],
  1072. //"Landscape": mapLayers["Landscape"],
  1073. //"Outdoor": mapLayers["Outdoor"],
  1074. };
  1075. L.control.layers( baseMaps ).addTo( map_ed );
  1076. mapLayers["MyMap"].addTo( map_ed );
  1077. L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
  1078. attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
  1079. }).addTo( map_ed );
  1080. */
  1081. if( node_type ){
  1082. switch( node_type ){
  1083. case 1:{
  1084. markers[0] = L.marker([lat,lon], {draggable: true,icon: ALS_Icon, mycustomid: node_id } ).addTo( map_ed ).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
  1085. break;
  1086. };
  1087. case 2:{
  1088. markers[0] = L.marker([lat,lon], {draggable: true,icon: LFS_Icon, mycustomid: node_id } ).addTo( map_ed ).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
  1089. break;
  1090. };
  1091. case 3:{
  1092. markers[0] = L.marker([lat,lon], {draggable: true,icon: PLS200_Icon, mycustomid: node_id } ).addTo( map_ed ).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
  1093. break;
  1094. };
  1095. case 4:{
  1096. markers[0] = L.marker([lat,lon], {draggable: true,icon: PLS360_Icon, mycustomid: node_id } ).addTo( map_ed ).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
  1097. break;
  1098. };
  1099. case 5:{
  1100. markers[0] = L.marker([lat,lon], {draggable: true,icon: LRF3D_Icon, mycustomid: node_id } ).addTo( map_ed ).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
  1101. break;
  1102. };
  1103. case 6:{
  1104. markers[0] = L.marker([lat,lon], {draggable: true,icon: PLSNET200_Icon, mycustomid: node_id } ).addTo( map_ed ).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
  1105. break;
  1106. };
  1107. case 10:
  1108. case 12:{
  1109. markers[0] = L.marker([lat,lon], {draggable: true,icon: FIXCAM_Icon, mycustomid: node_id} ).addTo( map_ed ).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
  1110. break;
  1111. };
  1112. case 11:
  1113. case 13:{
  1114. markers[0] = L.marker([lat,lon], {draggable: true,icon: PTZCAM_Icon, mycustomid: node_id } ).addTo( map_ed ).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
  1115. break;
  1116. };
  1117. };
  1118. } else loadLocationNodes();
  1119. };
  1120. function updateSiteAnchor(){
  1121. SiteLat = Ext.getCmp('siteLat').getValue();
  1122. SiteLon = Ext.getCmp('siteLon').getValue();
  1123. SiteAlt = Ext.getCmp('siteAlt').getValue();
  1124. Ext.Ajax.request({
  1125. url: '/lib/controller/updateLocation.php',
  1126. params: {
  1127. SITE: <?=$SiteID;?>,
  1128. UID: <?=$UserID;?>,
  1129. TYPE: 1,
  1130. SID: '<?=$Session;?>',
  1131. LAT: SiteLat,
  1132. LON: SiteLon,
  1133. ALT: SiteAlt
  1134. },
  1135. success: function(){
  1136. loadLocationEditor('sys_location_map');
  1137. },
  1138. failure: failureAJAXFunction
  1139. });
  1140. };
  1141. function updateSiteMap(){
  1142. MAP_ID = Ext.getCmp('siteMap').getValue();
  1143. Ext.Ajax.request({
  1144. url: '/lib/controller/updateLocation.php',
  1145. params: {
  1146. SITE: <?=$SiteID;?>,
  1147. UID: <?=$UserID;?>,
  1148. TYPE: 4,
  1149. SID: '<?=$Session;?>',
  1150. MID: MAP_ID
  1151. },
  1152. success: function( response, opts ){
  1153. reloadSiteMapData();
  1154. },
  1155. failure: failureAJAXFunction
  1156. });
  1157. };
  1158. var mapDataLoadded = false;
  1159. // Call this to prepare all data once in Session
  1160. function prepareMapData(){
  1161. //if( ap_type == 1 ) return;//Metro No Map ...
  1162. if( !mapDataLoadded ){
  1163. mapListStore.load();
  1164. };
  1165. };
  1166. function updateLocationOrientation(){
  1167. var tLat = Ext.getCmp('slat').getValue();
  1168. var tLon = Ext.getCmp('slon').getValue();
  1169. var tAlt = Ext.getCmp('salt').getValue();
  1170. var tRoll = Ext.getCmp('sroll').getValue();
  1171. var tPitch = Ext.getCmp('spitch').getValue();
  1172. var tYaw = Ext.getCmp('syaw').getValue();
  1173. Ext.Ajax.request({
  1174. url: '/lib/controller/updateLocation.php',
  1175. params: {
  1176. NODE: locationSelectedNode,
  1177. UID: <?=$UserID;?>,
  1178. TYPE: 2,
  1179. SID: '<?=$Session;?>',
  1180. LAT: tLat,
  1181. LON: tLon,
  1182. ALT: tAlt,
  1183. YAW: tYaw,
  1184. ROLL: tRoll,
  1185. PITCH: tPitch
  1186. },
  1187. failure: failureAJAXFunction
  1188. });
  1189. };
  1190. var iconSaver = null;
  1191. var markerSaver = null;
  1192. function updateLocation( e ){
  1193. locationSelectedNode = e.target.options.mycustomid;
  1194. Ext.Ajax.request({
  1195. url: '/lib/controller/updateLocation.php',
  1196. params: {
  1197. NODE: locationSelectedNode,
  1198. SITE: <?=$SiteID;?>,
  1199. UID: <?=$UserID;?>,
  1200. TYPE: 0,
  1201. SID: '<?=$Session;?>',
  1202. LAT: e.target._latlng.lat,
  1203. LON: e.target._latlng.lng
  1204. },
  1205. success: function( response, opts ){
  1206. loadNodeLocationProps( locationSelectedNode );
  1207. },
  1208. failure: failureAJAXFunction
  1209. });
  1210. };
  1211. function markerDblClick( e ){
  1212. if( iconSaver == null ){
  1213. iconSaver = e.target.options.icon;
  1214. markerSaver = e.target;
  1215. e.target.setIcon( SNAPE_Icon );
  1216. for( i=0; i< markers.length; i++){
  1217. if( markers[i].options.mycustomid != e.target.options.mycustomid ){
  1218. markers[i].setOpacity( 0.1 );
  1219. } else {
  1220. markers[i].setOpacity( 1.0 );
  1221. }
  1222. };
  1223. } else {
  1224. if( e.target.options.mycustomid == markerSaver.options.mycustomid ){
  1225. e.target.setIcon( iconSaver );
  1226. iconSaver = null;
  1227. markerSaver = null;
  1228. for( i=0; i< markers.length; i++){
  1229. markers[i].setOpacity( 1.0 );
  1230. };
  1231. } else {
  1232. markerSaver.setIcon( iconSaver );
  1233. iconSaver = e.target.options.icon;
  1234. markerSaver = e.target;
  1235. e.target.setIcon( SNAPE_Icon );
  1236. for( i=0; i< markers.length; i++){
  1237. if( markers[i].options.mycustomid != e.target.options.mycustomid ){
  1238. markers[i].setOpacity( 0.1 );
  1239. } else {
  1240. markers[i].setOpacity( 1.0 );
  1241. }
  1242. };
  1243. };
  1244. };
  1245. };
  1246. /*
  1247. function setNodeLocationToAnchor(){
  1248. Ext.Ajax.request({
  1249. url: '/lib/controller/updateLocation.php',
  1250. params: {
  1251. NODE: locationSelectedNode,
  1252. SITE: <?=$SiteID;?>,
  1253. UID: <?=$UserID;?>,
  1254. TYPE: 0,
  1255. SID: '<?=$Session;?>',
  1256. LAT: SiteLat,
  1257. LON: SiteLon,
  1258. ALT: SiteAlt
  1259. },
  1260. success: function( response, opts ){
  1261. loadLocationEditor('sys_location_map');
  1262. },
  1263. failure: failureAJAXFunction
  1264. });
  1265. };
  1266. function setNodeLocationByDelta(){
  1267. var dx = Ext.getCmp('dx').getValue();
  1268. var dy = Ext.getCmp('dy').getValue();
  1269. var dz = Ext.getCmp('dz').getValue();
  1270. Ext.Ajax.request({
  1271. url: '/lib/controller/updateLocation.php',
  1272. params: {
  1273. NODE: locationSelectedNode,
  1274. SITE: <?=$SiteID;?>,
  1275. UID: <?=$UserID;?>,
  1276. TYPE: 3,
  1277. SID: '<?=$Session;?>',
  1278. LAT: dx,
  1279. LON: dy,
  1280. ALT: dz
  1281. },
  1282. success: function( response, opts ){
  1283. loadLocationEditor();
  1284. },
  1285. failure: failureAJAXFunction
  1286. });
  1287. };
  1288. */
  1289. var mapCreatorWindow = null;
  1290. function createNewMap(){
  1291. if( mapCreatorWindow == null ){
  1292. mapCreatorWindow = new Ext.Window({
  1293. width: 800,
  1294. height: 580,
  1295. title: '<?=$Labels->GetLabel('_CREATE_CUSTOM_MAP_');?>',
  1296. modal: true,
  1297. frame: true,
  1298. border: false,
  1299. resizable: false,
  1300. items: [{
  1301. xtype: 'tabpanel',
  1302. id: 'mcr_tbp',
  1303. activeTab: 0,
  1304. items:[{
  1305. xtype: 'form',
  1306. title: '<?=$Labels->GetLabel('_INTER_MAP_');?>',
  1307. id: 'map_map_frm',
  1308. fileUpload: true,
  1309. labelWidth: 250,
  1310. labelAlign: 'right',
  1311. height: 490,
  1312. items:[{
  1313. xtype: 'textfield',
  1314. fieldLabel: '<?=$Labels->GetLabel('_NAME_MAP_');?>',
  1315. name: 'map_name',
  1316. width: 540,
  1317. },{
  1318. xtype: 'hidden',
  1319. name: 'ctype',
  1320. value: 1
  1321. },{
  1322. xtype: 'textfield',
  1323. fieldLabel: '<?=$Labels->GetLabel('_TILE_URL_MAP_');?>',
  1324. name: 'map_url',
  1325. width: 540,
  1326. },{
  1327. xtype: 'textfield',
  1328. fieldLabel: '<?=$Labels->GetLabel('_LAYER_ATTRIB_');?>',
  1329. name: 'map_attr',
  1330. width: 540,
  1331. },{
  1332. xtype: 'textarea',
  1333. fieldLabel: '<?=$Labels->GetLabel('_DESCRIPTION_');?>',
  1334. name: 'map_desc',
  1335. width: 540,
  1336. },{
  1337. xtype: 'combo',
  1338. fieldLabel: '<?=$Labels->GetLabel('_MAX_ZOOM_');?>',
  1339. name: 'map_maxz',
  1340. editable: false,
  1341. typeAhead: true,
  1342. triggerAction: 'all',
  1343. width: 100,
  1344. lazyRender:true,
  1345. mode: 'local',
  1346. store: new Ext.data.ArrayStore({
  1347. fields: ['zoom_l'],
  1348. data: [['16'], ['17'],['18'],['19'],['20'],['21'],['22'],['23'],['24'],['25'],['26'],['27'],['28']]
  1349. }),
  1350. value: '18',
  1351. valueField: 'zoom_l',
  1352. displayField: 'zoom_l'
  1353. },{
  1354. xtype: 'combo',
  1355. fieldLabel: '<?=$Labels->GetLabel('_MAX_NATURAL_ZOOM_');?>',
  1356. name: 'map_maxnz',
  1357. editable: false,
  1358. typeAhead: true,
  1359. triggerAction: 'all',
  1360. width: 100,
  1361. lazyRender:true,
  1362. mode: 'local',
  1363. store: new Ext.data.ArrayStore({
  1364. fields: ['zoom_l'],
  1365. data: [['16'], ['17'],['18'],['19'],['20'],['21'],['22'],['23'],['24'],['25'],['26'],['27'],['28']]
  1366. }),
  1367. value: '16',
  1368. valueField: 'zoom_l',
  1369. displayField: 'zoom_l'
  1370. }]
  1371. },{
  1372. xtype: 'form',
  1373. title: '<?=$Labels->GetLabel('_LOCAL_PIC_MAP_');?>',
  1374. id: 'map_pic_frm',
  1375. fileUpload: true,
  1376. height: 490,
  1377. //autoHeight: true,
  1378. //bodyStyle: 'padding: 10px 10px 0 10px;',
  1379. labelWidth: 250,
  1380. labelAlign: 'right',
  1381. defaults: {
  1382. //anchor: '95%',
  1383. //allowBlank: false,
  1384. msgTarget: 'side'
  1385. },
  1386. items: [{
  1387. xtype: 'textfield',
  1388. fieldLabel: '<?=$Labels->GetLabel('_MAP_NAME_');?>',
  1389. id: 'map_name_2',
  1390. name: 'map_name',
  1391. width: 540
  1392. },{
  1393. xtype: 'hidden',
  1394. name: 'ctype',
  1395. value: 2
  1396. },{
  1397. xtype: 'fileuploadfield',
  1398. id: 'form-file',
  1399. emptyText: '<?=$Labels->GetLabel('_SELE_ANIMAGE_');?>',
  1400. fieldLabel: '<?=$Labels->GetLabel('_MAP_PICTURE_');?>',
  1401. width: 500,
  1402. name: 'map_image',
  1403. buttonText: '<?=$Labels->GetLabel('_BROWSE_');?>'
  1404. },{
  1405. xtype: 'textfield',
  1406. fieldLabel: '<?=$Labels->GetLabel('_LAYER_ATTRIB_');?>',
  1407. name: 'map_attr',
  1408. width: 540,
  1409. },{
  1410. xtype: 'textarea',
  1411. fieldLabel: '<?=$Labels->GetLabel('_DESCRIPTION_');?>',
  1412. name: 'map_desc',
  1413. width: 540,
  1414. },{
  1415. xtype: 'combo',
  1416. fieldLabel: '<?=$Labels->GetLabel('_MAX_ZOOM_');?>',
  1417. editable: false,
  1418. typeAhead: true,
  1419. id: 'map_maxz',
  1420. name: 'map_maxz',
  1421. triggerAction: 'all',
  1422. width: 100,
  1423. lazyRender:true,
  1424. mode: 'local',
  1425. store: new Ext.data.ArrayStore({
  1426. fields: ['zoom_l'],
  1427. data: [['16'], ['17'],['18'],['19'],['20'],['21'],['22'],['23'],['24'],['25'],['26'],['27'],['28']]
  1428. }),
  1429. value: '4',
  1430. valueField: 'zoom_l',
  1431. displayField: 'zoom_l'
  1432. },{
  1433. xtype: 'combo',
  1434. fieldLabel: '<?=$Labels->GetLabel('_MAX_NATURAL_ZOOM_');?>',
  1435. editable: false,
  1436. typeAhead: true,
  1437. id: 'map_maxnz',
  1438. name: 'map_maxnz',
  1439. triggerAction: 'all',
  1440. width: 100,
  1441. lazyRender:true,
  1442. mode: 'local',
  1443. store: new Ext.data.ArrayStore({
  1444. fields: ['zoom_l'],
  1445. data: [['16'], ['17'],['18'],['19'],['20'],['21'],['22'],['23'],['24'],['25'],['26'],['27'],['28']]
  1446. }),
  1447. value: '4',
  1448. valueField: 'zoom_l',
  1449. displayField: 'zoom_l'
  1450. },{
  1451. xtype: 'numberfield',
  1452. fieldLabel: '<?=$Labels->GetLabel('_TOP_PIC_BOUND_');?>',
  1453. name: 'map_tpb',
  1454. value: 0,
  1455. width: 540,
  1456. },{
  1457. xtype: 'numberfield',
  1458. fieldLabel: '<?=$Labels->GetLabel('_LEFT_PIC_BOUND_');?>',
  1459. name: 'map_lpb',
  1460. value: 0,
  1461. width: 540,
  1462. },{
  1463. xtype: 'numberfield',
  1464. fieldLabel: '<?=$Labels->GetLabel('_RIGHT_PIC_BOUND_');?>',
  1465. name: 'map_rpb',
  1466. value: 0,
  1467. width: 540,
  1468. },{
  1469. xtype: 'numberfield',
  1470. fieldLabel: '<?=$Labels->GetLabel('_BOT_PIC_BOUND_');?>',
  1471. name: 'map_bpb',
  1472. value: 0,
  1473. width: 540,
  1474. },{
  1475. xtype: 'combo',
  1476. fieldLabel: '<?=$Labels->GetLabel('_MAP_COORD_SYSTEM_');?>',
  1477. editable: false,
  1478. typeAhead: true,
  1479. hiddenName: 'map_corsys',
  1480. triggerAction: 'all',
  1481. width: 540,
  1482. lazyRender:true,
  1483. mode: 'local',
  1484. store: new Ext.data.ArrayStore({
  1485. fields: ['C_SYS_V','C_SYS'],
  1486. data: [[0,'Meters from map Centre'], [1,'WGS84(GPS)']]
  1487. }),
  1488. listeners:{
  1489. select: function( a, b, c ){
  1490. if( c ){
  1491. Ext.getCmp('map_height').hide();
  1492. Ext.getCmp('map_maxz').hide();
  1493. Ext.getCmp('map_maxnz').hide();
  1494. Ext.getCmp('map_width').hide();
  1495. Ext.getCmp('map_cpp').hide();
  1496. Ext.getCmp('map_cpb').show();
  1497. } else {
  1498. Ext.getCmp('map_height').show();
  1499. Ext.getCmp('map_maxz').show();
  1500. Ext.getCmp('map_maxnz').show();
  1501. Ext.getCmp('map_width').show();
  1502. Ext.getCmp('map_cpp').show();
  1503. Ext.getCmp('map_cpb').hide();
  1504. };
  1505. }
  1506. },
  1507. value: '0',
  1508. valueField: 'C_SYS_V',
  1509. displayField: 'C_SYS'
  1510. },{
  1511. xtype: 'numberfield',
  1512. fieldLabel: '<?=$Labels->GetLabel('_MAP_WIDTH_');?>',
  1513. id: 'map_height',
  1514. name: 'map_height',
  1515. decimalPrecision: 2,
  1516. value: 1000.00,
  1517. width: 540,
  1518. },{
  1519. xtype: 'numberfield',
  1520. fieldLabel: '<?=$Labels->GetLabel('_MAP_HEIGHT_');?>',
  1521. id: 'map_width',
  1522. name: 'map_width',
  1523. decimalPrecision: 2,
  1524. value: 1000.00,
  1525. width: 540,
  1526. },{
  1527. xtype: 'panel',
  1528. id: 'map_cpp',
  1529. frame: false,
  1530. border: false,
  1531. layout: 'table',
  1532. layoutConfig: {
  1533. columns: 5
  1534. },
  1535. items:[{
  1536. xtype: 'spacer',
  1537. width: 250,
  1538. html: '<p style="text-align:right; margin-right: 5px;"><?=$Labels->GetLabel('_MAP_CENTER_MODE_');?>:</p>'
  1539. },{
  1540. xtype: 'radio',
  1541. name: 'bounds_mode',
  1542. inputValue: 0,
  1543. checked: 1
  1544. },{
  1545. width: 80,
  1546. html: '<img src="/style/assets/cust_map_cord_sys-0.png">'
  1547. },{
  1548. xtype: 'radio',
  1549. name: 'bounds_mode',
  1550. checked: 0,
  1551. inputValue: 1
  1552. },{
  1553. html: '<img src="/style/assets/cust_map_cord_sys-1.png">'
  1554. }]
  1555. },{
  1556. xtype: 'panel',
  1557. id: 'map_cpb',
  1558. frame: false,
  1559. border: false,
  1560. hidden: true,
  1561. layout: 'table',
  1562. layoutConfig: {
  1563. columns: 5
  1564. },
  1565. items:[{
  1566. xtype: 'spacer',
  1567. width: 250,
  1568. html: '<p style="text-align:right; margin-right: 5px;"><?=$Labels->GetLabel('_MAP_LEFT_CORCORD_');?>:</p>'
  1569. },{
  1570. xtype: 'spacer',
  1571. width: 100,
  1572. html: '<p style="text-align:right; margin-right: 5px;"><?=$Labels->GetLabel('_LAT_');?></p>'
  1573. },{
  1574. xtype: 'numberfield',
  1575. id: 'map_lcclat',
  1576. name: 'map_lcclat',
  1577. decimalPrecision: 8,
  1578. value: 32.0001,
  1579. width: 150,
  1580. },{
  1581. xtype: 'spacer',
  1582. width: 100,
  1583. html: '<p style="text-align:right; margin-right: 5px;"><?=$Labels->GetLabel('_LON_');?></p>'
  1584. },{
  1585. xtype: 'numberfield',
  1586. id: 'map_lcclon',
  1587. name: 'map_lcclon',
  1588. decimalPrecision: 8,
  1589. value: 32.0001,
  1590. width: 150,
  1591. },{
  1592. xtype: 'spacer',
  1593. width: 250,
  1594. html: '<p style="text-align:right; margin-right: 5px;"><?=$Labels->GetLabel('_MAP_RIGHT_CORCORD_');?>:</p>'
  1595. },{
  1596. xtype: 'spacer',
  1597. width: 100,
  1598. html: '<p style="text-align:right; margin-right: 5px;"><?=$Labels->GetLabel('_LAT_');?></p>'
  1599. },{
  1600. xtype: 'numberfield',
  1601. id: 'map_rcclat',
  1602. name: 'map_rcclat',
  1603. decimalPrecision: 8,
  1604. value: 32.0001,
  1605. width: 150,
  1606. },{
  1607. xtype: 'spacer',
  1608. width: 100,
  1609. html: '<p style="text-align:right; margin-right: 5px;"><?=$Labels->GetLabel('_LON_');?></p>'
  1610. },{
  1611. xtype: 'numberfield',
  1612. id: 'map_rcclon',
  1613. name: 'map_rcclon',
  1614. decimalPrecision: 8,
  1615. value: 32.0001,
  1616. width: 150,
  1617. }]
  1618. }]
  1619. }]
  1620. }],
  1621. bbar:[ '->',{
  1622. text: '<?=$Labels->GetLabel('_CANCEL_');?>',
  1623. handler: function(){
  1624. //Ext.getCmp('map_map_frm').getForm().reset();
  1625. //Ext.getCmp('map_pic_frm').getForm().reset();
  1626. mapCreatorWindow.destroy();
  1627. }
  1628. },{
  1629. text: '<?=$Labels->GetLabel('_CREATE_NEW_LBL_');?>',
  1630. handler: function(){
  1631. var tt = Ext.getCmp('mcr_tbp').getActiveTab();
  1632. if( tt.id == 'map_map_frm' ){
  1633. if( Ext.getCmp('map_map_frm').getForm().isValid()){
  1634. Ext.getCmp('map_map_frm').getForm().submit({
  1635. url: '/lib/controller/addMap.php',
  1636. waitMsg: 'Uploading Data...',
  1637. encoding: 'multipart/form-data',
  1638. success: function(fp, o){
  1639. //msg('Success', 'Processed file "'+o.result.file+'" on the server');
  1640. //alert('Processed file on the server');
  1641. mapCreatorWindow.destroy();
  1642. }
  1643. });
  1644. };
  1645. } else {
  1646. if( Ext.getCmp('map_pic_frm').getForm().isValid()){
  1647. Ext.getCmp('map_pic_frm').getForm().submit({
  1648. url: '/lib/controller/addMap.php',
  1649. waitMsg: 'Uploading Image...',
  1650. encoding: 'multipart/form-data',
  1651. success: function(fp, o){
  1652. //msg('Success', 'Processed file "'+o.result.file+'" on the server');
  1653. //alert('Processed file on the server');
  1654. mapCreatorWindow.destroy();
  1655. }
  1656. });
  1657. };
  1658. };
  1659. }
  1660. }],
  1661. listeners:{
  1662. beforedestroy: function(){
  1663. mapCreatorWindow = null;
  1664. }
  1665. }
  1666. });
  1667. };
  1668. mapCreatorWindow.show();
  1669. };
  1670. var mapEditorWindow = null;
  1671. function deleteCurrentMap(){
  1672. Ext.Ajax.request({
  1673. url: '/lib/controller/delMapData.php',
  1674. params: {
  1675. SITE: <?=$SiteID;?>,
  1676. UID: <?=$UserID;?>,
  1677. SID: '<?=$Session;?>',
  1678. MID: MAP_ID
  1679. },
  1680. success: function( response, opts ){
  1681. location.reload();
  1682. }
  1683. });
  1684. };
  1685. function editCurrentMap(){
  1686. Ext.Ajax.request({
  1687. url: '/lib/controller/getMapData.php',
  1688. params: {
  1689. SITE: <?=$SiteID;?>,
  1690. UID: <?=$UserID;?>,
  1691. SID: '<?=$Session;?>',
  1692. MID: MAP_ID
  1693. },
  1694. success: function( response, opts ){
  1695. var newMapData = Ext.decode( response.responseText );
  1696. if( mapEditorWindow == null ){
  1697. switch( newMapData.type ){
  1698. case 1:{
  1699. mapEditorWindow = new Ext.Window({
  1700. width: 800,
  1701. height: 440,
  1702. title: 'Edit Current Map',
  1703. modal: true,
  1704. //closeAction: 'hide',
  1705. frame: true,
  1706. border: false,
  1707. resizable: false,
  1708. items: [{
  1709. xtype: 'form',
  1710. id: 'map_map_frm',
  1711. labelWidth: 250,
  1712. labelAlign: 'right',
  1713. height: 350,
  1714. items:[{
  1715. xtype: 'textfield',
  1716. fieldLabel: 'Map Name',
  1717. id: 'map_name_1',
  1718. name: 'map_name',
  1719. width: 540,
  1720. },{
  1721. xtype: 'hidden',
  1722. name: 'ctype',
  1723. value: 1
  1724. },{
  1725. xtype: 'textfield',
  1726. fieldLabel: 'Tiles URL Pattern',
  1727. name: 'map_url',
  1728. width: 540,
  1729. },{
  1730. xtype: 'textfield',
  1731. fieldLabel: 'Layer Attribution',
  1732. name: 'map_attr',
  1733. width: 540,
  1734. },{
  1735. xtype: 'textarea',
  1736. fieldLabel: 'Description',
  1737. name: 'map_desc',
  1738. width: 540,
  1739. },{
  1740. xtype: 'combo',
  1741. fieldLabel: 'Max Zoom',
  1742. name: 'map_maxz',
  1743. editable: false,
  1744. typeAhead: true,
  1745. triggerAction: 'all',
  1746. width: 100,
  1747. lazyRender:true,
  1748. mode: 'local',
  1749. store: new Ext.data.ArrayStore({
  1750. fields: ['zoom_l'],
  1751. data: [['16'], ['17'],['18'],['19'],['20'],['21'],['22'],['23'],['24'],['25'],['26'],['27'],['28']]
  1752. }),
  1753. value: '18',
  1754. valueField: 'zoom_l',
  1755. displayField: 'zoom_l'
  1756. },{
  1757. xtype: 'combo',
  1758. fieldLabel: 'Max Native Zoom',
  1759. name: 'map_maxnz',
  1760. editable: false,
  1761. typeAhead: true,
  1762. triggerAction: 'all',
  1763. width: 100,
  1764. lazyRender:true,
  1765. mode: 'local',
  1766. store: new Ext.data.ArrayStore({
  1767. fields: ['zoom_l'],
  1768. data: [['16'], ['17'],['18'],['19'],['20'],['21'],['22'],['23'],['24'],['25'],['26'],['27'],['28']]
  1769. }),
  1770. value: '16',
  1771. valueField: 'zoom_l',
  1772. displayField: 'zoom_l'
  1773. }]
  1774. }],
  1775. bbar:[ '->',{
  1776. text: '<?=$Labels->GetLabel('_CANCEL_');?>',
  1777. handler: function(){
  1778. mapEditorWindow.destroy();
  1779. }
  1780. },{
  1781. text: '<?=$Labels->GetLabel('_APPLY_CHANGES_');?>',
  1782. handler: function(){
  1783. var tt = Ext.getCmp('mcr_tbp').getActiveTab();
  1784. if( tt.id == 'map_map_frm' ){
  1785. if( Ext.getCmp('map_map_frm').getForm().isValid()){
  1786. Ext.getCmp('map_map_frm').getForm().submit({
  1787. url: '/lib/controller/updateMap.php',
  1788. waitMsg: '<?=$Labels->GetLabel('_UPDATING_DATA_');?>...',
  1789. clientValidation: false,
  1790. encoding: 'multipart/form-data',
  1791. success: function(f,a){
  1792. alert('Processed file on the server1');
  1793. //mapEditorWindow.hide();
  1794. //mapEditorWindow.destroy();
  1795. }
  1796. });
  1797. };
  1798. } else {
  1799. if( Ext.getCmp('map_pic_frm').getForm().isValid()){
  1800. Ext.getCmp('map_pic_frm').getForm().submit({
  1801. url: '/lib/controller/updateMap.php',
  1802. clientValidation: false,
  1803. waitMsg: '<?=$Labels->GetLabel('_UPDATING_DATA_');?>...',
  1804. encoding: 'multipart/form-data',
  1805. success: function( f, a ){
  1806. alert('Processed file on the server2');
  1807. //mapEditorWindow.hide();
  1808. //mapEditorWindow.destroy();
  1809. }
  1810. });
  1811. };
  1812. };
  1813. }
  1814. }],
  1815. listeners: {
  1816. beforedestroy: function(){
  1817. mapEditorWindow = null;
  1818. }
  1819. }
  1820. });
  1821. break;
  1822. };
  1823. default:{
  1824. mapEditorWindow = new Ext.Window({
  1825. width: 800,
  1826. height: 540,
  1827. title: '<?=$Labels->GetLabel('_EDIT_CUR_MAP_');?>',
  1828. modal: true,
  1829. frame: true,
  1830. border: false,
  1831. resizable: false,
  1832. items: [{
  1833. xtype: 'form',
  1834. id: 'map_edt_frm',
  1835. height: 480,
  1836. //autoHeight: true,
  1837. //bodyStyle: 'padding: 10px 10px 0 10px;',
  1838. labelWidth: 250,
  1839. labelAlign: 'right',
  1840. defaults: {
  1841. //anchor: '95%',
  1842. //allowBlank: false,
  1843. msgTarget: 'side'
  1844. },
  1845. items:[{
  1846. xtype: 'spacer',
  1847. height: 6
  1848. },{
  1849. xtype: 'textfield',
  1850. fieldLabel: '<?=$Labels->GetLabel('_MAP_NAME_');?>',
  1851. name: 'map_name',
  1852. value: newMapData.name,
  1853. width: 540
  1854. },{
  1855. xtype: 'hidden',
  1856. name: 'MID',
  1857. value: newMapData.id
  1858. },{
  1859. xtype: 'panel',
  1860. frame: false,
  1861. border: false,
  1862. html: '<center><img height="50px" SRC="/lib/controller/data/assets/images/'+MAP_SET.layer_url+'"></center>'
  1863. },{
  1864. xtype: 'textfield',
  1865. fieldLabel: '<?=$Labels->GetLabel('_LAYER_ATTRIB_');?>',
  1866. name: 'map_attr',
  1867. value: newMapData.attribution,
  1868. width: 540,
  1869. },{
  1870. xtype: 'textarea',
  1871. fieldLabel: '<?=$Labels->GetLabel('_DESCRIPTION_');?>',
  1872. name: 'map_desc',
  1873. value: newMapData.desc,
  1874. width: 540,
  1875. },{
  1876. xtype: 'combo',
  1877. fieldLabel: '<?=$Labels->GetLabel('_MAX_ZOOM_');?>',
  1878. editable: false,
  1879. typeAhead: true,
  1880. name: 'map_maxz',
  1881. value: newMapData.maxZoom,
  1882. triggerAction: 'all',
  1883. width: 100,
  1884. lazyRender:true,
  1885. mode: 'local',
  1886. store: new Ext.data.ArrayStore({
  1887. fields: ['zoom_l'],
  1888. data: [['16'], ['17'],['18'],['19'],['20'],['21'],['22'],['23'],['24'],['25'],['26'],['27'],['28']]
  1889. }),
  1890. value: '16',
  1891. valueField: 'zoom_l',
  1892. displayField: 'zoom_l'
  1893. },{
  1894. xtype: 'combo',
  1895. fieldLabel: '<?=$Labels->GetLabel('_MAX_NATURAL_ZOOM_');?>',
  1896. editable: false,
  1897. typeAhead: true,
  1898. name: 'map_maxnz',
  1899. value: newMapData.maxNativeZoom,
  1900. triggerAction: 'all',
  1901. width: 100,
  1902. lazyRender:true,
  1903. mode: 'local',
  1904. store: new Ext.data.ArrayStore({
  1905. fields: ['zoom_l'],
  1906. data: [['16'], ['17'],['18'],['19'],['20'],['21'],['22'],['23'],['24'],['25'],['26'],['27'],['28']]
  1907. }),
  1908. value: '16',
  1909. valueField: 'zoom_l',
  1910. displayField: 'zoom_l'
  1911. },{
  1912. xtype: 'numberfield',
  1913. fieldLabel: '<?=$Labels->GetLabel('_TOP_PIC_BOUND_');?>',
  1914. name: 'map_tpb',
  1915. value: newMapData.img_tb,
  1916. width: 540,
  1917. },{
  1918. xtype: 'numberfield',
  1919. fieldLabel: '<?=$Labels->GetLabel('_LEFT_PIC_BOUND_');?>',
  1920. name: 'map_lpb',
  1921. value: newMapData.img_lb,
  1922. width: 540,
  1923. },{
  1924. xtype: 'numberfield',
  1925. fieldLabel: '<?=$Labels->GetLabel('_RIGHT_PIC_BOUND_');?>',
  1926. name: 'map_rpb',
  1927. value: newMapData.img_rb,
  1928. width: 540,
  1929. },{
  1930. xtype: 'numberfield',
  1931. fieldLabel: '<?=$Labels->GetLabel('_BOT_PIC_BOUND_');?>',
  1932. name: 'map_bpb',
  1933. value: newMapData.img_bb,
  1934. width: 540,
  1935. },{
  1936. xtype: 'numberfield',
  1937. fieldLabel: '<?=$Labels->GetLabel('_MAP_WIDTH_');?>',
  1938. name: 'map_width',
  1939. decimalPrecision: 2,
  1940. value: newMapData.img_map_w,
  1941. width: 540,
  1942. },{
  1943. xtype: 'numberfield',
  1944. fieldLabel: '<?=$Labels->GetLabel('_MAP_HEIGHT_');?>',
  1945. name: 'map_height',
  1946. decimalPrecision: 2,
  1947. value: newMapData.img_map_h,
  1948. width: 540,
  1949. },{
  1950. xtype: 'panel',
  1951. frame: false,
  1952. border: false,
  1953. layout: 'table',
  1954. layoutConfig: {
  1955. columns: 5
  1956. },
  1957. items:[{
  1958. xtype: 'spacer',
  1959. width: 250,
  1960. html: '<p style="text-align:right; margin-right: 5px;"><?=$Labels->GetLabel('_MAP_CENTER_MODE_');?>:</p>'
  1961. },{
  1962. xtype: 'radio',
  1963. name: 'bounds_mode',
  1964. inputValue: 0,
  1965. checked: (newMapData.bounds_mode == 0)
  1966. },{
  1967. width: 80,
  1968. border: false,
  1969. html: '<img src="/style/assets/cust_map_cord_sys-0.png">'
  1970. },{
  1971. xtype: 'radio',
  1972. name: 'bounds_mode',
  1973. inputValue: 1,
  1974. checked: (newMapData.bounds_mode != 0)
  1975. },{
  1976. html: '<img src="/style/assets/cust_map_cord_sys-1.png">'
  1977. }]
  1978. }]
  1979. }],
  1980. bbar:[ '->',{
  1981. text: '<?=$Labels->GetLabel('_CANCEL_');?>',
  1982. handler: function(){
  1983. mapEditorWindow.destroy();
  1984. }
  1985. },{
  1986. text: '<?=$Labels->GetLabel('_APPLY_CHANGES_');?>',
  1987. handler: function(){
  1988. if( Ext.getCmp('map_edt_frm').getForm().isValid()){
  1989. Ext.getCmp('map_edt_frm').getForm().submit({
  1990. url: '/lib/controller/updateMap.php',
  1991. waitMsg: '<?=$Labels->GetLabel('_UPDATING_DATA_');?>...',
  1992. encoding: 'multipart/form-data',
  1993. success: function(fp, o){
  1994. mapEditorWindow.destroy();
  1995. }
  1996. });
  1997. };
  1998. }
  1999. }],
  2000. listeners: {
  2001. beforedestroy: function(){
  2002. mapEditorWindow = null;
  2003. }
  2004. }
  2005. });
  2006. break;
  2007. };
  2008. };
  2009. };
  2010. mapEditorWindow.show();
  2011. },
  2012. failure: failureAJAXFunction
  2013. });
  2014. };