pois.js 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360
  1. var poiAlpha = {
  2. pin_width: 100,
  3. id: "Poi01",
  4. img: null,
  5. type: "GENERIC",
  6. cat: 'FF',
  7. pin: function(){
  8. },
  9. isFixed: function(){
  10. return (this.cat=='FI'||this.cat=='UD');
  11. },
  12. isOverlappedToPoi: function(poi){
  13. var rec1 = [poi.x,poi.y,poi.x+this.pin_width,poi.y+this.pin_width];
  14. var rec2 = [this.x,this.y,this.x+this.pin_width,this.y+this.pin_width];
  15. return this.isOverlapped(rec1);
  16. },
  17. isOverlapped: function(rec1){
  18. var rec2 = [this.x,this.y,this.x+this.pin_width,this.y+this.pin_width];
  19. // check if either rectangle is actually a line
  20. if (rec1[0] == rec1[2] || rec1[1] == rec1[3] ||
  21. rec2[0] == rec2[2] || rec2[1] == rec2[3]) {
  22. // the line cannot have positive overlap
  23. return false;
  24. }
  25. return !(rec1[2] <= rec2[0] || // left
  26. rec1[3] <= rec2[1] || // bottom
  27. rec1[0] >= rec2[2] || // right
  28. rec1[1] >= rec2[3]); // top
  29. }
  30. };
  31. var pois=[];
  32. //Types
  33. // - "I": immagine
  34. // - "T": Testo/html
  35. // - "V": Video
  36. //Cat(egories):
  37. // - "FI": FIume (Position Fixed)
  38. // - "FL": FLora
  39. // - "FI": FAuna
  40. // - "UD": UDatinos (Position Fixed)
  41. var poi=Object.create(poiAlpha);
  42. //-----------
  43. // FIUME
  44. //-----------
  45. //0
  46. poi.x = 346;
  47. poi.y = 332;
  48. poi.id = "First One";
  49. poi.type = 'I'; //looking for "asset/I_0.jpg"
  50. poi.cat = 'FI'
  51. pois.push(poi);
  52. //1
  53. poi=Object.create(poiAlpha);
  54. poi.x= 746;
  55. poi.y= 432;
  56. poi.id="Two";
  57. poi.type = 'V'; //looking for "asset/V_1.mp4"
  58. poi.cat = 'FI'
  59. pois.push(poi);
  60. //2
  61. poi=Object.create(poiAlpha);
  62. poi.x= 700;
  63. poi.y= 402;
  64. poi.id="Two";
  65. poi.type = 'T'; //looking for "asset/T_2.html"
  66. poi.cat = 'FI'
  67. pois.push(poi);
  68. //3
  69. poi=Object.create(poiAlpha);
  70. poi.x = 246;
  71. poi.y = 532;
  72. poi.id = "3";
  73. poi.type = 'I';
  74. poi.cat = 'FI'
  75. pois.push(poi);
  76. //4
  77. poi=Object.create(poiAlpha);
  78. poi.x = 646;
  79. poi.y = 532;
  80. poi.id = "4";
  81. poi.type = 'I';
  82. poi.cat = 'FI'
  83. pois.push(poi);
  84. //-----------
  85. // FLORA
  86. //-----------
  87. //5
  88. poi=Object.create(poiAlpha);
  89. poi.x = -1;
  90. poi.y = -1;
  91. poi.id = "5";
  92. poi.type = 'I';
  93. poi.cat = 'FL'
  94. pois.push(poi);
  95. //6
  96. poi=Object.create(poiAlpha);
  97. poi.x = -1;
  98. poi.y = -1;
  99. poi.id = "6";
  100. poi.type = 'I';
  101. poi.cat = 'FL'
  102. pois.push(poi);
  103. //7
  104. poi=Object.create(poiAlpha);
  105. poi.x = -1;
  106. poi.y = -1;
  107. poi.id = "7";
  108. poi.type = 'I';
  109. poi.cat = 'FL'
  110. pois.push(poi);
  111. //8
  112. poi=Object.create(poiAlpha);
  113. poi.x = -1;
  114. poi.y = -1;
  115. poi.id = "8";
  116. poi.type = 'I';
  117. poi.cat = 'FL'
  118. pois.push(poi);
  119. //9
  120. poi=Object.create(poiAlpha);
  121. poi.x = -1;
  122. poi.y = -1;
  123. poi.id = "9";
  124. poi.type = 'I';
  125. poi.cat = 'FL'
  126. pois.push(poi);
  127. //10
  128. poi=Object.create(poiAlpha);
  129. poi.x = -1;
  130. poi.y = -1;
  131. poi.id = "10";
  132. poi.type = 'V';
  133. poi.cat = 'FL'
  134. pois.push(poi);
  135. //11
  136. poi=Object.create(poiAlpha);
  137. poi.x = -1;
  138. poi.y = -1;
  139. poi.id = "11";
  140. poi.type = 'V';
  141. poi.cat = 'FL'
  142. pois.push(poi);
  143. //12
  144. poi=Object.create(poiAlpha);
  145. poi.x = -1;
  146. poi.y = -1;
  147. poi.id = "12";
  148. poi.type = 'I';
  149. poi.cat = 'FL'
  150. pois.push(poi);
  151. //13
  152. poi=Object.create(poiAlpha);
  153. poi.x = -1;
  154. poi.y = -1;
  155. poi.id = "13";
  156. poi.type = 'V';
  157. poi.cat = 'FL'
  158. pois.push(poi);
  159. //14
  160. poi=Object.create(poiAlpha);
  161. poi.x = -1;
  162. poi.y = -1;
  163. poi.id = "14";
  164. poi.type = 'T';
  165. poi.cat = 'FL'
  166. pois.push(poi);
  167. //-----------
  168. // FAUNA
  169. //-----------
  170. //15
  171. poi=Object.create(poiAlpha);
  172. poi.x = -1;
  173. poi.y = -1;
  174. poi.id = "5";
  175. poi.type = 'I';
  176. poi.cat = 'FA'
  177. pois.push(poi);
  178. //16
  179. poi=Object.create(poiAlpha);
  180. poi.x = -1;
  181. poi.y = -1;
  182. poi.id = "6";
  183. poi.type = 'I';
  184. poi.cat = 'FA'
  185. pois.push(poi);
  186. //17
  187. poi=Object.create(poiAlpha);
  188. poi.x = -1;
  189. poi.y = -1;
  190. poi.id = "7";
  191. poi.type = 'I';
  192. poi.cat = 'FA'
  193. pois.push(poi);
  194. //18
  195. poi=Object.create(poiAlpha);
  196. poi.x = -1;
  197. poi.y = -1;
  198. poi.id = "8";
  199. poi.type = 'I';
  200. poi.cat = 'FA'
  201. pois.push(poi);
  202. //19
  203. poi=Object.create(poiAlpha);
  204. poi.x = -1;
  205. poi.y = -1;
  206. poi.id = "9";
  207. poi.type = 'I';
  208. poi.cat = 'FA'
  209. pois.push(poi);
  210. //20
  211. poi=Object.create(poiAlpha);
  212. poi.x = -1;
  213. poi.y = -1;
  214. poi.id = "10";
  215. poi.type = 'V';
  216. poi.cat = 'FA'
  217. pois.push(poi);
  218. //21
  219. poi=Object.create(poiAlpha);
  220. poi.x = -1;
  221. poi.y = -1;
  222. poi.id = "11";
  223. poi.type = 'V';
  224. poi.cat = 'FA'
  225. pois.push(poi);
  226. //22
  227. poi=Object.create(poiAlpha);
  228. poi.x = -1;
  229. poi.y = -1;
  230. poi.id = "12";
  231. poi.type = 'I';
  232. poi.cat = 'FA'
  233. pois.push(poi);
  234. //23
  235. poi=Object.create(poiAlpha);
  236. poi.x = -1;
  237. poi.y = -1;
  238. poi.id = "13";
  239. poi.type = 'V';
  240. poi.cat = 'FA'
  241. pois.push(poi);
  242. //24
  243. poi=Object.create(poiAlpha);
  244. poi.x = -1;
  245. poi.y = -1;
  246. poi.id = "14";
  247. poi.type = 'T';
  248. poi.cat = 'FA'
  249. pois.push(poi);
  250. //-----------
  251. // UDATINOS
  252. //-----------
  253. //25
  254. poi=Object.create(poiAlpha);
  255. poi.x = 1146;
  256. poi.y = 543;
  257. poi.id = "First One";
  258. poi.type = 'I'; //looking for "asset/I_0.jpg"
  259. poi.cat = 'UD'
  260. pois.push(poi);
  261. //26
  262. poi=Object.create(poiAlpha);
  263. poi.x= 789;
  264. poi.y= 100;
  265. poi.id="Two";
  266. poi.type = 'V'; //looking for "asset/V_1.mp4"
  267. poi.cat = 'UD'
  268. pois.push(poi);
  269. //27
  270. poi=Object.create(poiAlpha);
  271. poi.x= 1053;
  272. poi.y= 438;
  273. poi.id="Two";
  274. poi.type = 'T'; //looking for "asset/T_2.html"
  275. poi.cat = 'UD'
  276. pois.push(poi);
  277. //28
  278. poi=Object.create(poiAlpha);
  279. poi.x = 26;
  280. poi.y = 411;
  281. poi.id = "3";
  282. poi.type = 'I';
  283. poi.cat = 'UD'
  284. pois.push(poi);
  285. //29
  286. poi=Object.create(poiAlpha);
  287. poi.x =180;
  288. poi.y = 701;
  289. poi.id = "4";
  290. poi.type = 'I';
  291. poi.cat = 'UD'
  292. pois.push(poi);
  293. //30
  294. poi.x = 316;
  295. poi.y = 532;
  296. poi.id = "First One";
  297. poi.type = 'I'; //looking for "asset/I_0.jpg"
  298. poi.cat = 'UD'
  299. pois.push(poi);
  300. //31
  301. poi=Object.create(poiAlpha);
  302. poi.x= 710;
  303. poi.y= 236;
  304. poi.id="Two";
  305. poi.type = 'V'; //looking for "asset/V_1.mp4"
  306. poi.cat = 'UD'
  307. pois.push(poi);
  308. //32
  309. poi=Object.create(poiAlpha);
  310. poi.x= 301;
  311. poi.y= 323;
  312. poi.id="Two";
  313. poi.type = 'T'; //looking for "asset/T_2.html"
  314. poi.cat = 'UD'
  315. pois.push(poi);
  316. //33
  317. poi=Object.create(poiAlpha);
  318. poi.x = 506;
  319. poi.y = 562;
  320. poi.id = "3";
  321. poi.type = 'I';
  322. poi.cat = 'UD'
  323. pois.push(poi);
  324. //34
  325. poi=Object.create(poiAlpha);
  326. poi.x = 616;
  327. poi.y = 232;
  328. poi.id = "4";
  329. poi.type = 'I';
  330. poi.cat = 'UD'
  331. pois.push(poi);