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.

1255 lines
37 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. //<?php require_once('../../js_asm.php'); ?>
  2. var map = null;
  3. var markers = [];
  4. function Events() {
  5. this.events = { };
  6. }
  7. Events.prototype.on = function(name, fn) {
  8. var events = this.events[name];
  9. if (events == undefined) {
  10. this.events[name] = [ fn ];
  11. this.emit('event:on', fn);
  12. } else {
  13. if (events.indexOf(fn) == -1) {
  14. events.push(fn);
  15. this.emit('event:on', fn);
  16. }
  17. }
  18. return this;
  19. }
  20. Events.prototype.once = function(name, fn) {
  21. var events = this.events[name];
  22. fn.once = true;
  23. if (!events) {
  24. this.events[name] = [ fn ];
  25. this.emit('event:once', fn);
  26. } else {
  27. if (events.indexOf(fn) == -1) {
  28. events.push(fn);
  29. this.emit('event:once', fn);
  30. }
  31. }
  32. return this;
  33. }
  34. Events.prototype.emit = function(name, args) {
  35. var events = this.events[name];
  36. if (events) {
  37. var i = events.length;
  38. while(i--) {
  39. if (events[i]) {
  40. events[i].call(this, args);
  41. if (events[i].once) {
  42. delete events[i];
  43. }
  44. }
  45. }
  46. }
  47. return this;
  48. }
  49. Events.prototype.unbind = function(name, fn) {
  50. if (name) {
  51. var events = this.events[name];
  52. if (events) {
  53. if (fn) {
  54. var i = events.indexOf(fn);
  55. if (i != -1) {
  56. delete events[i];
  57. }
  58. } else {
  59. delete this.events[name];
  60. }
  61. }
  62. } else {
  63. delete this.events;
  64. this.events = { };
  65. }
  66. return this;
  67. }
  68. var userPrefix;
  69. var prefix = (function () {
  70. var styles = window.getComputedStyle(document.documentElement, ''),
  71. pre = (Array.prototype.slice
  72. .call(styles)
  73. .join('')
  74. .match(/-(moz|webkit|ms)-/) || (styles.OLink === '' && ['', 'o'])
  75. )[1],
  76. dom = ('WebKit|Moz|MS|O').match(new RegExp('(' + pre + ')', 'i'))[1];
  77. userPrefix = {
  78. dom: dom,
  79. lowercase: pre,
  80. css: '-' + pre + '-',
  81. js: pre[0].toUpperCase() + pre.substr(1)
  82. };
  83. })();
  84. function bindEvent(element, type, handler) {
  85. if(element.addEventListener) {
  86. element.addEventListener(type, handler, false);
  87. } else {
  88. element.attachEvent('on' + type, handler);
  89. }
  90. }
  91. function Viewport(data) {
  92. events.add( this );
  93. var self = this;
  94. this.element = data.element;
  95. this.fps = data.fps;
  96. this.sensivity = data.sensivity;
  97. this.sensivityFade = data.sensivityFade;
  98. this.touchSensivity = data.touchSensivity;
  99. this.speed = data.speed;
  100. this.lastX = 0;
  101. this.lastY = 0;
  102. this.mouseX = 0;
  103. this.mouseY = 0;
  104. this.distanceX = 0;
  105. this.distanceY = 0;
  106. this.positionX = 0;
  107. this.positionY = 0;
  108. this.positionZ = 0;
  109. this.torqueX = 0;
  110. this.torqueY = 0;
  111. this.down = false;
  112. this.upsideDown = false;
  113. this.previousPositionX = 0;
  114. this.previousPositionY = 0;
  115. this.previousPositionZ = 0;
  116. this.currentSide = 0;
  117. this.calculatedSide = 0;
  118. bindEvent(data.element /*document*/, 'mousedown', function() { self.down = true; });
  119. bindEvent(data.element, 'mouseup', function() { self.down = false; });
  120. bindEvent(data.element, 'keyup', function() { self.down = false; });
  121. bindEvent(data.element, 'mousemove', function(e) { self.mouseX = e.pageX; self.mouseY = e.pageY; });
  122. bindEvent(data.element, 'touchstart', function(e) {
  123. self.down = true;
  124. e.touches ? e = e.touches[0] : null;
  125. self.mouseX = e.pageX / self.touchSensivity;
  126. self.mouseY = e.pageY / self.touchSensivity;
  127. self.lastX = self.mouseX;
  128. self.lastY = self.mouseY;
  129. });
  130. bindEvent(data.element, 'touchmove', function(e) {
  131. if(e.preventDefault) {
  132. e.preventDefault();
  133. }
  134. if(e.touches.length == 1) {
  135. e.touches ? e = e.touches[0] : null;
  136. self.mouseX = e.pageX / self.touchSensivity;
  137. self.mouseY = e.pageY / self.touchSensivity;
  138. }
  139. });
  140. bindEvent(data.element, 'touchend', function(e) {
  141. self.down = false;
  142. });
  143. setInterval(this.animate.bind(this), this.fps);
  144. }
  145. var events = new Events();
  146. events.add = function(obj) {
  147. obj.events = { };
  148. }
  149. events.implement = function(fn) {
  150. fn.prototype = Object.create(Events.prototype);
  151. }
  152. events.implement(Viewport);
  153. Viewport.prototype.animate = function() {
  154. this.distanceX = (this.mouseX - this.lastX);
  155. this.distanceY = (this.mouseY - this.lastY);
  156. this.lastX = this.mouseX;
  157. this.lastY = this.mouseY;
  158. if(this.down) {
  159. this.torqueX = this.torqueX * this.sensivityFade + (this.distanceX * this.speed - this.torqueX) * this.sensivity;
  160. this.torqueY = this.torqueY * this.sensivityFade + (this.distanceY * this.speed - this.torqueY) * this.sensivity;
  161. }
  162. if(Math.abs(this.torqueX) > 1.0 || Math.abs(this.torqueY) > 1.0) {
  163. if(!this.down) {
  164. this.torqueX *= this.sensivityFade;
  165. this.torqueY *= this.sensivityFade;
  166. }
  167. this.positionY -= this.torqueY;
  168. if(this.positionY > 360) {
  169. this.positionY -= 360;
  170. } else if(this.positionY < 0) {
  171. this.positionY += 360;
  172. }
  173. if(this.positionY > 90 && this.positionY < 270) {
  174. this.positionX -= this.torqueX;
  175. if(!this.upsideDown) {
  176. this.upsideDown = true;
  177. this.emit('upsideDown', { upsideDown: this.upsideDown });
  178. }
  179. } else {
  180. this.positionX += this.torqueX;
  181. if(this.upsideDown) {
  182. this.upsideDown = false;
  183. this.emit('upsideDown', { upsideDown: this.upsideDown });
  184. }
  185. }
  186. if(this.positionX > 360) {
  187. this.positionX -= 360;
  188. } else if(this.positionX < 0) {
  189. this.positionX += 360;
  190. }
  191. if(!(this.positionY >= 46 && this.positionY <= 130) && !(this.positionY >= 220 && this.positionY <= 308)) {
  192. if(this.upsideDown) {
  193. if(this.positionX >= 42 && this.positionX <= 130) {
  194. this.calculatedSide = 3;
  195. } else if(this.positionX >= 131 && this.positionX <= 223) {
  196. this.calculatedSide = 2;
  197. } else if(this.positionX >= 224 && this.positionX <= 314) {
  198. this.calculatedSide = 5;
  199. } else {
  200. this.calculatedSide = 4;
  201. }
  202. } else {
  203. if(this.positionX >= 42 && this.positionX <= 130) {
  204. this.calculatedSide = 5;
  205. } else if(this.positionX >= 131 && this.positionX <= 223) {
  206. this.calculatedSide = 4;
  207. } else if(this.positionX >= 224 && this.positionX <= 314) {
  208. this.calculatedSide = 3;
  209. } else {
  210. this.calculatedSide = 2;
  211. }
  212. }
  213. } else {
  214. if(this.positionY >= 46 && this.positionY <= 130) {
  215. this.calculatedSide = 6;
  216. }
  217. if(this.positionY >= 220 && this.positionY <= 308) {
  218. this.calculatedSide = 1;
  219. }
  220. }
  221. if(this.calculatedSide !== this.currentSide) {
  222. this.currentSide = this.calculatedSide;
  223. this.emit('sideChange');
  224. }
  225. }
  226. this.element.style[userPrefix.js + 'Transform'] = 'rotateX(' + this.positionY + 'deg) rotateY(' + this.positionX + 'deg) rotateZ('+this.positionZ + 'deg)';
  227. if(this.positionY != this.previousPositionY || this.positionX != this.previousPositionX || this.positionZ != this.previousPositionZ ) {
  228. this.previousPositionY = this.positionY;
  229. this.previousPositionX = this.positionX;
  230. this.previousPositionZ = this.positionZ;
  231. this.emit('rotate');
  232. }
  233. }
  234. Viewport.prototype.setDirect = function( A, B, C ) {
  235. if( 1 ) {
  236. this.positionX = A;
  237. this.positionY = B;
  238. this.positionZ = C;
  239. if(this.positionY > 360) {
  240. this.positionY -= 360;
  241. } else if(this.positionY < 0) {
  242. this.positionY += 360;
  243. }
  244. if(this.positionY > 90 && this.positionY < 270) {
  245. if(!this.upsideDown) {
  246. this.upsideDown = true;
  247. this.emit('upsideDown', { upsideDown: this.upsideDown });
  248. }
  249. } else {
  250. if(this.upsideDown) {
  251. this.upsideDown = false;
  252. this.emit('upsideDown', { upsideDown: this.upsideDown });
  253. }
  254. }
  255. if(this.positionX > 360) {
  256. this.positionX -= 360;
  257. } else if(this.positionX < 0) {
  258. this.positionX += 360;
  259. }
  260. if(!(this.positionY >= 46 && this.positionY <= 130) && !(this.positionY >= 220 && this.positionY <= 308)) {
  261. if(this.upsideDown) {
  262. if(this.positionX >= 42 && this.positionX <= 130) {
  263. this.calculatedSide = 3;
  264. } else if(this.positionX >= 131 && this.positionX <= 223) {
  265. this.calculatedSide = 2;
  266. } else if(this.positionX >= 224 && this.positionX <= 314) {
  267. this.calculatedSide = 5;
  268. } else {
  269. this.calculatedSide = 4;
  270. }
  271. } else {
  272. if(this.positionX >= 42 && this.positionX <= 130) {
  273. this.calculatedSide = 5;
  274. } else if(this.positionX >= 131 && this.positionX <= 223) {
  275. this.calculatedSide = 4;
  276. } else if(this.positionX >= 224 && this.positionX <= 314) {
  277. this.calculatedSide = 3;
  278. } else {
  279. this.calculatedSide = 2;
  280. }
  281. }
  282. } else {
  283. if(this.positionY >= 46 && this.positionY <= 130) {
  284. this.calculatedSide = 6;
  285. }
  286. if(this.positionY >= 220 && this.positionY <= 308) {
  287. this.calculatedSide = 1;
  288. }
  289. }
  290. if(this.calculatedSide !== this.currentSide) {
  291. this.currentSide = this.calculatedSide;
  292. this.emit('sideChange');
  293. }
  294. }
  295. this.element.style[userPrefix.js + 'Transform'] = 'rotateX(' + this.positionY + 'deg) rotateY(' + this.positionX + 'deg) rotateZ('+this.positionZ + 'deg)';
  296. if(this.positionY != this.previousPositionY || this.positionX != this.previousPositionX || this.positionZ != this.previousPositionZ ) {
  297. this.previousPositionY = this.positionY;
  298. this.previousPositionX = this.positionX;
  299. this.previousPositionZ = this.positionZ;
  300. this.emit('rotate');
  301. }
  302. }
  303. function Cube(data) {
  304. var self = this;
  305. this.element = data.element;
  306. this.sides = this.element.getElementsByClassName('side');
  307. this.viewport = data.viewport;
  308. this.viewport.on('rotate', function() {
  309. self.rotateSides();
  310. });
  311. this.viewport.on('upsideDown', function(obj) {
  312. self.upsideDown(obj);
  313. });
  314. this.viewport.on('sideChange', function() {
  315. self.sideChange();
  316. });
  317. }
  318. Cube.prototype.rotateSides = function() {
  319. var viewport = this.viewport;
  320. if(viewport.positionY > 90 && viewport.positionY < 270) {
  321. this.sides[0].getElementsByClassName('cube-image')[0].style[userPrefix.js + 'Transform'] = 'rotate(' + (viewport.positionX + viewport.torqueX) + 'deg)';
  322. this.sides[5].getElementsByClassName('cube-image')[0].style[userPrefix.js + 'Transform'] = 'rotate(' + -(viewport.positionX + 180 + viewport.torqueX) + 'deg)';
  323. } else {
  324. this.sides[0].getElementsByClassName('cube-image')[0].style[userPrefix.js + 'Transform'] = 'rotate(' + (viewport.positionX - viewport.torqueX) + 'deg)';
  325. this.sides[5].getElementsByClassName('cube-image')[0].style[userPrefix.js + 'Transform'] = 'rotate(' + -(viewport.positionX + 180 - viewport.torqueX) + 'deg)';
  326. }
  327. }
  328. Cube.prototype.upsideDown = function(obj) {
  329. var deg = (obj.upsideDown == true) ? '180deg' : '0deg';
  330. var i = 5;
  331. while(i > 0 && --i) {
  332. this.sides[i].getElementsByClassName('cube-image')[0].style[userPrefix.js + 'Transform'] = 'rotate(' + deg + ')';
  333. }
  334. }
  335. Cube.prototype.sideChange = function() {
  336. for(var i = 0; i < this.sides.length; ++i) {
  337. this.sides[i].getElementsByClassName('cube-image')[0].className = 'cube-image';
  338. }
  339. this.sides[this.viewport.currentSide - 1].getElementsByClassName('cube-image')[0].className = 'cube-image active';
  340. }
  341. Cube.prototype.set = function( A, B, C ) {
  342. //C = C + 90.0;
  343. this.viewport.setDirect( A, B, C );
  344. }
  345. //var viewport = new Viewport({
  346. // element: document.getElementsByClassName('cube')[0],
  347. // fps: 20,
  348. // sensivity: .1,
  349. // sensivityFade: .93,
  350. // speed: 2,
  351. // touchSensivity: 1.5
  352. //});
  353. //new Cube({
  354. // viewport: viewport,
  355. // element: document.getElementsByClassName('cube')[0]
  356. //});
  357. var LRF3D_Icon = L.icon({
  358. iconUrl: '/style/assets/5_node.png',
  359. //shadowUrl: 'leaf-shadow.png',
  360. iconSize: [64, 64], // size of the icon
  361. //shadowSize: [50, 64], // size of the shadow
  362. iconAnchor: [32, 32], // point of the icon which will correspond to marker's location
  363. //shadowAnchor: [4, 62], // the same for the shadow
  364. popupAnchor: [0, -30] // point from which the popup should open relative to the iconAnchor
  365. });
  366. var LFS_Icon = L.icon({
  367. iconUrl: '/style/assets/2_node.png',
  368. //shadowUrl: 'leaf-shadow.png',
  369. iconSize: [64, 64], // size of the icon
  370. //shadowSize: [50, 64], // size of the shadow
  371. iconAnchor: [32, 32], // point of the icon which will correspond to marker's location
  372. //shadowAnchor: [4, 62], // the same for the shadow
  373. popupAnchor: [0, -30] // point from which the popup should open relative to the iconAnchor
  374. });
  375. var PLS200_Icon = L.icon({
  376. iconUrl: '/style/assets/3_node.png',
  377. //shadowUrl: 'leaf-shadow.png',
  378. iconSize: [64, 64], // size of the icon
  379. //shadowSize: [50, 64], // size of the shadow
  380. iconAnchor: [32, 32], // point of the icon which will correspond to marker's location
  381. //shadowAnchor: [4, 62], // the same for the shadow
  382. popupAnchor: [0, -30] // point from which the popup should open relative to the iconAnchor
  383. });
  384. var PLSNET200_Icon = L.icon({
  385. iconUrl: '/style/assets/6_node.png',
  386. //shadowUrl: 'leaf-shadow.png',
  387. iconSize: [64, 64], // size of the icon
  388. //shadowSize: [50, 64], // size of the shadow
  389. iconAnchor: [32, 32], // point of the icon which will correspond to marker's location
  390. //shadowAnchor: [4, 62], // the same for the shadow
  391. popupAnchor: [0, -30] // point from which the popup should open relative to the iconAnchor
  392. });
  393. var PLS360_Icon = L.icon({
  394. iconUrl: '/style/assets/4_node.png',
  395. //shadowUrl: 'leaf-shadow.png',
  396. iconSize: [64, 64], // size of the icon
  397. //shadowSize: [50, 64], // size of the shadow
  398. iconAnchor: [32, 32], // point of the icon which will correspond to marker's location
  399. //shadowAnchor: [4, 62], // the same for the shadow
  400. popupAnchor: [0, -30] // point from which the popup should open relative to the iconAnchor
  401. });
  402. var ALS_Icon = L.icon({
  403. iconUrl: '/style/assets/1_node.png',
  404. //shadowUrl: 'leaf-shadow.png',
  405. iconSize: [64, 64], // size of the icon
  406. //shadowSize: [50, 64], // size of the shadow
  407. iconAnchor: [32, 32], // point of the icon which will correspond to marker's location
  408. //shadowAnchor: [4, 62], // the same for the shadow
  409. popupAnchor: [0, -30] // point from which the popup should open relative to the iconAnchor
  410. });
  411. var PTZCAM_Icon = L.icon({
  412. iconUrl: '/style/assets/12_node.png',
  413. //shadowUrl: 'leaf-shadow.png',
  414. iconSize: [64, 64], // size of the icon
  415. //shadowSize: [50, 64], // size of the shadow
  416. iconAnchor: [32, 32], // point of the icon which will correspond to marker's location
  417. //shadowAnchor: [4, 62], // the same for the shadow
  418. popupAnchor: [0, -30] // point from which the popup should open relative to the iconAnchor
  419. });
  420. var FIXCAM_Icon = L.icon({
  421. iconUrl: '/style/assets/11_node.png',
  422. //shadowUrl: 'leaf-shadow.png',
  423. iconSize: [64, 64], // size of the icon
  424. //shadowSize: [50, 64], // size of the shadow
  425. iconAnchor: [32, 32], // point of the icon which will correspond to marker's location
  426. //shadowAnchor: [4, 62], // the same for the shadow
  427. popupAnchor: [0, -30] // point from which the popup should open relative to the iconAnchor
  428. });
  429. var SITEZ_Icon = L.icon({
  430. iconUrl: '/style/assets/centre_1.png',
  431. //shadowUrl: 'leaf-shadow.png',
  432. iconSize: [32, 32], // size of the icon
  433. //shadowSize: [50, 64], // size of the shadow
  434. iconAnchor: [16, 16], // point of the icon which will correspond to marker's location
  435. //shadowAnchor: [4, 62], // the same for the shadow
  436. popupAnchor: [0, -15] // point from which the popup should open relative to the iconAnchor
  437. });
  438. var SNAPE_Icon = L.icon({
  439. iconUrl: '/style/assets/cursor.png',
  440. //shadowUrl: 'leaf-shadow.png',
  441. iconSize: [32, 32], // size of the icon
  442. //shadowSize: [50, 64], // size of the shadow
  443. iconAnchor: [16, 16], // point of the icon which will correspond to marker's location
  444. //shadowAnchor: [4, 62], // the same for the shadow
  445. popupAnchor: [0, -15] // point from which the popup should open relative to the iconAnchor
  446. });
  447. var locationSelectedNode = 0;
  448. function loadLoactionProps( e ){
  449. if( typeof e == 'number' ){
  450. locationSelectedNode = e;
  451. } else {
  452. locationSelectedNode = e.sourceTarget.options.mycustomid;
  453. }
  454. loadNodeLocationProps( locationSelectedNode );
  455. };
  456. function updateSiteAnchor(){
  457. SiteLat = Ext.getCmp('siteLat').getValue();
  458. SiteLon = Ext.getCmp('siteLon').getValue();
  459. SiteAlt = Ext.getCmp('siteAlt').getValue();
  460. Ext.Ajax.request({
  461. url: '/lib/controller/updateLocation.php',
  462. params: {
  463. SITE: <?=$SiteID;?>,
  464. UID: <?=$UserID;?>,
  465. TYPE: 1,
  466. SID: '<?=$Session;?>',
  467. LAT: SiteLat,
  468. LON: SiteLon,
  469. ALT: SiteAlt
  470. },
  471. failure: failureAJAXFunction
  472. });
  473. };
  474. function updateLocationOrientation(){
  475. var tLat = Ext.getCmp('slat').getValue();
  476. var tLon = Ext.getCmp('slon').getValue();
  477. var tAlt = Ext.getCmp('salt').getValue();
  478. var tRoll = Ext.getCmp('sroll').getValue();
  479. var tPitch = Ext.getCmp('spitch').getValue();
  480. var tYaw = Ext.getCmp('syaw').getValue();
  481. Ext.Ajax.request({
  482. url: '/lib/controller/updateLocation.php',
  483. params: {
  484. NODE: locationSelectedNode,
  485. UID: <?=$UserID;?>,
  486. TYPE: 2,
  487. SID: '<?=$Session;?>',
  488. LAT: tLat,
  489. LON: tLon,
  490. ALT: tAlt,
  491. YAW: tYaw,
  492. ROLL: tRoll,
  493. PITCH: tPitch
  494. },
  495. failure: failureAJAXFunction
  496. });
  497. };
  498. var iconSaver = null;
  499. var markerSaver = null;
  500. function updateLocation( e ){
  501. locationSelectedNode = e.target.options.mycustomid;
  502. Ext.Ajax.request({
  503. url: '/lib/controller/updateLocation.php',
  504. params: {
  505. NODE: locationSelectedNode,
  506. SITE: <?=$SiteID;?>,
  507. UID: <?=$UserID;?>,
  508. TYPE: 0,
  509. SID: '<?=$Session;?>',
  510. LAT: e.target._latlng.lat,
  511. LON: e.target._latlng.lng
  512. },
  513. success: function( response, opts ){
  514. loadNodeLocationProps( locationSelectedNode );
  515. },
  516. failure: failureAJAXFunction
  517. });
  518. };
  519. function markerDblClick( e ){
  520. if( iconSaver == null ){
  521. iconSaver = e.target.options.icon;
  522. markerSaver = e.target;
  523. e.target.setIcon( SNAPE_Icon );
  524. for( i=0; i< markers.length; i++){
  525. if( markers[i].options.mycustomid != e.target.options.mycustomid ){
  526. markers[i].setOpacity( 0.1 );
  527. } else {
  528. markers[i].setOpacity( 1.0 );
  529. }
  530. };
  531. } else {
  532. if( e.target.options.mycustomid == markerSaver.options.mycustomid ){
  533. e.target.setIcon( iconSaver );
  534. iconSaver = null;
  535. markerSaver = null;
  536. for( i=0; i< markers.length; i++){
  537. markers[i].setOpacity( 1.0 );
  538. };
  539. } else {
  540. markerSaver.setIcon( iconSaver );
  541. iconSaver = e.target.options.icon;
  542. markerSaver = e.target;
  543. e.target.setIcon( SNAPE_Icon );
  544. for( i=0; i< markers.length; i++){
  545. if( markers[i].options.mycustomid != e.target.options.mycustomid ){
  546. markers[i].setOpacity( 0.1 );
  547. } else {
  548. markers[i].setOpacity( 1.0 );
  549. }
  550. };
  551. };
  552. };
  553. };
  554. function setNodeLocationToAnchor(){
  555. Ext.Ajax.request({
  556. url: '/lib/controller/updateLocation.php',
  557. params: {
  558. NODE: locationSelectedNode,
  559. SITE: <?=$SiteID;?>,
  560. UID: <?=$UserID;?>,
  561. TYPE: 0,
  562. SID: '<?=$Session;?>',
  563. LAT: SiteLat,
  564. LON: SiteLon,
  565. ALT: SiteAlt
  566. },
  567. success: function( response, opts ){
  568. loadLocationEditor();
  569. },
  570. failure: failureAJAXFunction
  571. });
  572. };
  573. function setNodeLocationByDelta(){
  574. var dx = Ext.getCmp('dx').getValue();
  575. var dy = Ext.getCmp('dy').getValue();
  576. var dz = Ext.getCmp('dz').getValue();
  577. Ext.Ajax.request({
  578. url: '/lib/controller/updateLocation.php',
  579. params: {
  580. NODE: locationSelectedNode,
  581. SITE: <?=$SiteID;?>,
  582. UID: <?=$UserID;?>,
  583. TYPE: 3,
  584. SID: '<?=$Session;?>',
  585. LAT: dx,
  586. LON: dy,
  587. ALT: dz
  588. },
  589. success: function( response, opts ){
  590. loadLocationEditor();
  591. },
  592. failure: failureAJAXFunction
  593. });
  594. };
  595. function loadLocationNodes(){
  596. Ext.Ajax.request({
  597. url: '/lib/controller/getLocationItems.php',
  598. params: {
  599. SITE: <?=$SiteID;?>,
  600. UID: <?=$UserID;?>,
  601. SID: '<?=$Session;?>'
  602. },
  603. success: function( response, opts ){
  604. var data = Ext.decode(response.responseText);
  605. for( i=0; i < data.length; i++){
  606. switch( data[i].type ){
  607. case 1:{
  608. markers[i] = L.marker([data[i].lat, data[i].lon], {draggable: true,icon: ALS_Icon, mycustomid:data[i].id } ).addTo(map).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
  609. break;
  610. };
  611. case 2:{
  612. markers[i] = L.marker([data[i].lat, data[i].lon], {draggable: true,icon: LFS_Icon, mycustomid:data[i].id } ).addTo(map).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
  613. break;
  614. };
  615. case 3:{
  616. markers[i] = L.marker([data[i].lat, data[i].lon], {draggable: true,icon: PLS200_Icon, mycustomid:data[i].id } ).addTo(map).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
  617. break;
  618. };
  619. case 4:{
  620. markers[i] = L.marker([data[i].lat, data[i].lon], {draggable: true,icon: PLS360_Icon, mycustomid:data[i].id } ).addTo(map).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
  621. break;
  622. };
  623. case 5:{
  624. markers[i] = L.marker([data[i].lat, data[i].lon], {draggable: true,icon: LRF3D_Icon, mycustomid:data[i].id } ).addTo(map).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
  625. break;
  626. };
  627. case 6:{
  628. markers[i] = L.marker([data[i].lat, data[i].lon], {draggable: true,icon: PLSNET200_Icon, mycustomid:data[i].id } ).addTo(map).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
  629. break;
  630. };
  631. case 10:
  632. case 12:{
  633. markers[i] = L.marker([data[i].lat, data[i].lon], {draggable: true,icon: FIXCAM_Icon, mycustomid:data[i].id } ).addTo(map).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
  634. break;
  635. };
  636. case 11:
  637. case 13:{
  638. markers[i] = L.marker([data[i].lat, data[i].lon], {draggable: true,icon: PTZCAM_Icon, mycustomid:data[i].id } ).addTo(map).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
  639. break;
  640. };
  641. };
  642. //bindPopup('A pretty CSS3 popup.<br> Easily customizable.');//.openPopup();
  643. };
  644. },
  645. failure: function( response, opts ) {
  646. var tPanel = Ext.getCmp('main_portal');
  647. tPanel.remove(0);
  648. tPanel.add( { html: 'Failed to load dashboard!' } );
  649. tPanel.doLayout();
  650. }
  651. });
  652. };
  653. var orientationEditorWindow = null;
  654. var cubeViewport = null;
  655. var cube = null;
  656. var curX = 0;
  657. var curY = 0;
  658. var curZ = 0;
  659. var bk_upd = false;
  660. function setCubeOrientation( A, B, C ){
  661. if( bk_upd ) return;
  662. bk_upd = true;
  663. curX = A;
  664. curY = B;
  665. curZ = C;
  666. var t = Ext.getCmp('roll_sld');
  667. t.setValue( A );
  668. t = Ext.getCmp('roll');
  669. t.setValue( A );
  670. t = Ext.getCmp('pitch_sld');
  671. t.setValue( B );
  672. t = Ext.getCmp('pitch');
  673. t.setValue( B );
  674. t = Ext.getCmp('yaw_sld');
  675. t.setValue( C );
  676. t = Ext.getCmp('yaw');
  677. t.setValue( C );
  678. if( cube != null ) cube.set( curX, curY, curZ );
  679. bk_upd = false;
  680. };
  681. function orientationEditor(){
  682. if( orientationEditorWindow == null ){
  683. orientationEditorWindow = new Ext.Window({
  684. modal: true,
  685. title: 'Orientation',
  686. closeAction: 'hide',
  687. width: 640,
  688. height: 500,
  689. items:[{
  690. layout: 'table',
  691. defaults: {
  692. bodyStyle:'padding:5px'
  693. },
  694. layoutConfig: {
  695. columns: 3
  696. },
  697. items:[{
  698. html: 'Roll:'
  699. },{
  700. xtype: 'textfield',
  701. id: 'roll',
  702. name: 'roll',
  703. value: 30.0029,
  704. listeners:{
  705. change: function( sl, nv, tt ){
  706. setCubeOrientation( nv / 1.0, curY, curZ );
  707. }
  708. }
  709. },{
  710. xtype: 'slider',
  711. id: 'roll_sld',
  712. width: 200,
  713. value: 30.0029,
  714. minValue: -180.0,
  715. maxValue: 180.0,
  716. listeners:{
  717. change: function( sl, nv, tt ){
  718. setCubeOrientation( nv, curY, curZ );
  719. }
  720. }
  721. },{
  722. html: 'Pitch:'
  723. },{
  724. xtype: 'textfield',
  725. id: 'pitch',
  726. name: 'pitch',
  727. value: 30.0029,
  728. listeners:{
  729. change: function( sl, nv, tt ){
  730. setCubeOrientation( curX, nv / 1.0, curZ );
  731. }
  732. }
  733. },{
  734. xtype: 'slider',
  735. id: 'pitch_sld',
  736. width: 200,
  737. value: 30.0029,
  738. minValue: -180.0,
  739. maxValue: 180.0,
  740. listeners:{
  741. change: function( sl, nv, tt ){
  742. setCubeOrientation( curX, nv, curZ );
  743. }
  744. }
  745. },{
  746. html: 'Yaw:'
  747. },{
  748. xtype: 'textfield',
  749. id: 'yaw',
  750. name: 'yaw',
  751. value: 30.0029,
  752. listeners:{
  753. change: function( sl, nv, tt ){
  754. //alert( nv );
  755. setCubeOrientation( curX, curY, nv / 1.0 );
  756. }
  757. }
  758. },{
  759. xtype: 'slider',
  760. id: 'yaw_sld',
  761. width: 200,
  762. value: 30.0029,
  763. minValue: -180.0,
  764. maxValue: 180.0,
  765. listeners:{
  766. change: function( sl, nv, tt ){
  767. setCubeOrientation( curX, curY, nv );
  768. }
  769. }
  770. }]
  771. },{
  772. 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>'
  773. }],
  774. buttons:[{
  775. text: 'Cancel',
  776. width: 200,
  777. handler: function(){
  778. orientationEditorWindow.hide();
  779. }
  780. },{
  781. text: 'Apply',
  782. width: 200,
  783. handler: function(){
  784. Ext.getCmp('sroll').setValue( Ext.getCmp('roll').getValue() );
  785. Ext.getCmp('spitch').setValue( Ext.getCmp('pitch').getValue() );
  786. Ext.getCmp('syaw').setValue( Ext.getCmp('yaw').getValue() );
  787. orientationEditorWindow.hide();
  788. }
  789. }]
  790. });
  791. orientationEditorWindow.show();
  792. cubeViewport = new Viewport({
  793. element: document.getElementsByClassName('cube')[0],
  794. fps: 20,
  795. sensivity: .1,
  796. sensivityFade: .93,
  797. speed: 2,
  798. touchSensivity: 1.5
  799. });
  800. cube = new Cube({
  801. viewport: cubeViewport,
  802. element: document.getElementsByClassName('cube')[0]
  803. });
  804. } else {
  805. orientationEditorWindow.show();
  806. };
  807. setCubeOrientation( Ext.getCmp('sroll').getValue(), Ext.getCmp('spitch').getValue(), Ext.getCmp('syaw').getValue() );
  808. };
  809. function loadNodeLocationProps( NodeID ){
  810. //alert( 'Node: ' + NodeID );
  811. Ext.Ajax.request({
  812. url: '/lib/controller/getLocationNodeProps.php',
  813. params: {
  814. NID: <?=$SiteID;?>,
  815. UID: <?=$UserID;?>,
  816. SID: '<?=$Session;?>',
  817. NODE: NodeID
  818. },
  819. success: function( response, opts ){
  820. // If the response is JSON, you have to decode it
  821. var data = Ext.decode(response.responseText);
  822. var tPanel = Ext.getCmp('prop_content');
  823. tPanel.remove(0);
  824. tPanel.add( data );
  825. tPanel.doLayout();
  826. },
  827. failure: failureAJAXFunction
  828. });
  829. };
  830. function LoadNodesList(){
  831. Ext.Ajax.request({
  832. url: '/lib/controller/getLocationNodes.php',
  833. params: {
  834. SITE: <?=$SiteID;?>,
  835. UID: <?=$UserID;?>,
  836. SID: '<?=$Session;?>'
  837. },
  838. success: function( response, opts ){
  839. // If the response is JSON, you have to decode it
  840. var data = Ext.decode(response.responseText);
  841. var tPanel = Ext.getCmp('prop_content');
  842. tPanel.remove(0);
  843. tPanel.add( data );
  844. tPanel.doLayout();
  845. },
  846. failure: failureAJAXFunction
  847. });
  848. };
  849. function loadLocationEditor(){
  850. if( tlInterval!= null ){
  851. window.clearInterval( tlInterval );
  852. tlInterval = null;
  853. timelineObj = null;
  854. };
  855. var tPanel = Ext.getCmp('main_portal');
  856. tPanel.removeAll( true );
  857. Ext.getCmp('main_content').setTitle( '<?=$Labels->GetLabel('_LOC_MAP_LBL_');?>' );
  858. tPanel.add({
  859. columnWidth: 0.83,
  860. frame: false,
  861. border: false,
  862. items: [{
  863. layout: 'fit',
  864. height: PanelH-150,
  865. flex: 1,
  866. //border: true,
  867. items:{
  868. id: 'location_map'
  869. }
  870. },{
  871. layout: 'table',
  872. title: '<?=$Labels->GetLabel('_SITE_PROP_LBL_');?>',
  873. flex: 1,
  874. defaults: {
  875. bodyStyle:'padding:20px'
  876. },
  877. layoutConfig: {
  878. // The total column count must be specified here
  879. columns: 7,
  880. textAlign: 'center'
  881. },
  882. items:[{
  883. html: '<?=$Labels->GetLabel('_SYS_ANCHORT_LBL_');?> <?=$Labels->GetLabel('_LAT_SHORT_LBL_');?>:'
  884. },{
  885. xtype: 'textfield',
  886. id: 'siteLat',
  887. value: SiteLat
  888. },{
  889. html: '<?=$Labels->GetLabel('_LON_SHORT_LBL_');?>:'
  890. },{
  891. xtype: 'textfield',
  892. id: 'siteLon',
  893. value: SiteLon
  894. },{
  895. html: '<?=$Labels->GetLabel('_ALT_SHORT_LBL_');?>:'
  896. },{
  897. xtype: 'textfield',
  898. id: 'siteAlt',
  899. value: SiteAlt
  900. },{
  901. xtype: 'button',
  902. text: '<?=$Labels->GetLabel('_UPDATE_LBL_');?>',
  903. handler: updateSiteAnchor
  904. },{
  905. html: '<?=$Labels->GetLabel('_MAP_TYP_LBL_');?>:'
  906. },{
  907. xtype: 'radio',
  908. name: 'map_type',
  909. boxLabel: '<?=$Labels->GetLabel('_MAP_REG_LBL_');?>',
  910. checked: true,
  911. value: 0
  912. },{
  913. xtype: 'radio',
  914. name: 'map_type',
  915. boxLabel: '<?=$Labels->GetLabel('_MAP_CUST_LBL_');?>',
  916. colspan: 2,
  917. value: 1
  918. },{
  919. xtype: 'combo',
  920. disabled: true,
  921. typeAhead: true,
  922. triggerAction: 'all',
  923. lazyRender:true,
  924. colspan: 2,
  925. mode: 'local',
  926. store: new Ext.data.ArrayStore({
  927. id: 0,
  928. fields: ['myId', 'displayText' ],
  929. data: [[1, 'item1'], [2, 'item2']]
  930. }),
  931. valueField: 'myId',
  932. displayField: 'displayText'
  933. },{
  934. xtype: 'button',
  935. id: 'add-c_map-btn',
  936. disabled: true,
  937. text: '<?=$Labels->GetLabel('_CREATE_NEW_LBL_');?>'
  938. }]
  939. }]
  940. });
  941. tPanel.add({
  942. title: 'Properties',
  943. xtype: 'panel',
  944. flex: 1,
  945. height: 700,
  946. columnWidth: 0.17,
  947. layout: 'fit',
  948. id: 'prop_content',
  949. items:[{
  950. html:'<div class="setEd_infoPanel" id="NUNU"><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>'
  951. }]
  952. });
  953. tPanel.doLayout();
  954. map = L.map('location_map',{
  955. attributionControl: true,
  956. //preferCanvas: true,
  957. zoomControl: true,
  958. center: [SiteLat, SiteLon],
  959. /*zoomControl: false,
  960. zoom: 17,
  961. minZoom: 17,
  962. maxZoom: 17,*/
  963. keyboard: false
  964. }).setView([SiteLat, SiteLon], 17);
  965. L.marker([SiteLat, SiteLon], { draggable: false, icon: SITEZ_Icon, zIndexOffset: 1000 } ).addTo(map).on('click', LoadNodesList ).bindPopup("<b><?=$Labels->GetLabel('_SYS_ANCHORT_LBL_');?></b>");//.openPopup();
  966. var mapLayers = [];
  967. mapLayers["MyMap"] = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
  968. attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
  969. maxNativeZoom: 18,
  970. maxZoom: 24,
  971. })
  972. // https://leaflet-extras.github.io/leaflet-providers/preview/
  973. mapLayers["EsriStreet"] = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}', {
  974. 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',
  975. maxZoom: 19
  976. });
  977. mapLayers["EsriSat"] = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', {
  978. 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',
  979. maxZoom: 19
  980. });
  981. mapLayers["EsriTopo"] = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}', {
  982. 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',
  983. maxZoom: 24
  984. });
  985. mapLayers["OpenStreetMap"] = L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", { //de/tiles/osmde
  986. attribution: 'Map data &copy; <a href="https://openstreetmap.org" target="_blank">OpenStreetMap</a> contributors',
  987. maxZoom: 19
  988. });
  989. mapLayers["OpenTopoMap"] = L.tileLayer("https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png", {
  990. 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>) ',
  991. maxZoom: 19
  992. });
  993. /*
  994. mapLayers["Cycle"] = L.tileLayer('https://tile.thunderforest.com/cycle/{z}/{x}/{y}.png?apikey=' + _PHP['API_KEY_THUNDERFOREST_1'], {
  995. 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>',
  996. maxZoom: 22
  997. });
  998. mapLayers["Landscape"] = L.tileLayer('https://tile.thunderforest.com/landscape/{z}/{x}/{y}.png?apikey=' + _PHP['API_KEY_THUNDERFOREST_1'], {
  999. 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>',
  1000. maxZoom: 22
  1001. });
  1002. mapLayers["Outdoor"] = L.tileLayer('https://tile.thunderforest.com/outdoors/{z}/{x}/{y}.png?apikey=' + _PHP['API_KEY_THUNDERFOREST_1'], {
  1003. 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>',
  1004. maxZoom: 22
  1005. });
  1006. */
  1007. var baseMaps = {
  1008. "MyMap": mapLayers["MyMap"],
  1009. "OpenStreetMap": mapLayers["OpenStreetMap"],
  1010. "OpenTopoMap": mapLayers["OpenTopoMap"],
  1011. "EsriSat": mapLayers["EsriSat"],
  1012. "EsriStreet": mapLayers["EsriStreet"],
  1013. "EsriTopo": mapLayers["EsriTopo"],
  1014. //"Bing": mapLayers["Bing"],
  1015. //"OSM-Cycle": mapLayers["Cycle"],
  1016. //"Landscape": mapLayers["Landscape"],
  1017. //"Outdoor": mapLayers["Outdoor"],
  1018. };
  1019. L.control.layers( baseMaps ).addTo(map);
  1020. mapLayers["MyMap"].addTo(map);
  1021. /*
  1022. Ext.Ajax.request({
  1023. url: '/lib/controller/getNetwork.php',
  1024. params: {
  1025. NID: selectedSite,
  1026. UID: <?=$UserID;?>,
  1027. SID: '<?=$Session;?>'
  1028. },
  1029. success: function( response, opts ){
  1030. /*
  1031. layout: { improvedLayout: false }
  1032. physics: { enabled: true}
  1033. For the node, set a property called fixed:
  1034. fixed: { x: true , y: true }
  1035. Here is the son of the node:
  1036. {id: 1, value: 2, label: 'xx' , x: 320, y:170 , fixed: { x: true , y: true } }
  1037. // If the response is JSON, you have to decode it
  1038. var data = Ext.decode(response.responseText);
  1039. netwodkData.nodes = new vis.DataSet( data.nodes );
  1040. netwodkData.edges = new vis.DataSet( data.edges );
  1041. //map.createPane( 'my_network' );
  1042. //map.getPane('my_network').style.zIndex = 1650;
  1043. //map.getPane('my_network').style.pointerEvents = 'none';
  1044. //map.getPane('my_network').innerHTML = "<div id=\"net_cont\" style=\"width: 640px; height: 500px;\"></div>";
  1045. //var container = document.getElementById(Ext.getCmp('net_cont').body.id);
  1046. //var container = document.getElementById( 'net_cont' );
  1047. var container =map.getPane('markerPane');
  1048. networkObj = new vis.Network( container, netwodkData, networkOpts );
  1049. },
  1050. failure: function( response, opts ) {
  1051. //Ext.fly('some_div').update('Fail!');
  1052. }
  1053. });
  1054. */
  1055. /*
  1056. var map = L.map('map', {
  1057. crs: L.CRS.Simple
  1058. });
  1059. var map = L.map('map', {
  1060. crs: L.CRS.Simple,
  1061. minZoom: -5
  1062. });
  1063. var bounds = [[0,0], [1000,1000]];
  1064. var image = L.imageOverlay('uqm_map_full.png', bounds).addTo(map);
  1065. var bounds = [[-26.5,-25], [1021.5,1023]];
  1066. var image = L.imageOverlay('uqm_map_full.png', bounds).addTo(map);
  1067. map.fitBounds(bounds);
  1068. var sol = L.latLng([ 145, 175.2 ]);
  1069. L.marker(sol).addTo(map);
  1070. map.setView( [70, 120], 1);
  1071. var travel = L.polyline([sol, deneb]).addTo(map);
  1072. L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}', {
  1073. attribution: 'Map data &copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, Imagery © <a href="https://www.mapbox.com/">Mapbox</a>',
  1074. maxZoom: 18,
  1075. id: 'mapbox/streets-v11',
  1076. tileSize: 512,
  1077. zoomOffset: -1,
  1078. accessToken: 'your.mapbox.access.token'
  1079. }).addTo(mymap);
  1080. var circle = L.circle([51.508, -0.11], {
  1081. color: 'red',
  1082. fillColor: '#f03',
  1083. fillOpacity: 0.5,
  1084. radius: 500
  1085. }).addTo(mymap);
  1086. var polygon = L.polygon([
  1087. [51.509, -0.08],
  1088. [51.503, -0.06],
  1089. [51.51, -0.047]
  1090. ]).addTo(mymap);
  1091. marker.bindPopup("<b>Hello world!</b><br>I am a popup.").openPopup();
  1092. circle.bindPopup("I am a circle.");
  1093. polygon.bindPopup("I am a polygon.");
  1094. function onMapClick(e) {
  1095. alert("You clicked the map at " + e.latlng);
  1096. }
  1097. mymap.on('click', onMapClick);
  1098. */
  1099. L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
  1100. attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
  1101. }).addTo(map);
  1102. loadLocationNodes();
  1103. };