summaryrefslogtreecommitdiff
path: root/src/js/tours.js
blob: 714928940ebfc71f3739871420e44b8ccd380e2f (plain)
  1. //Load common code that includes config, then load the app logic for this page.
  2. requirejs(['./slippymap'], function(_foo) {
  3. var depth = '../../';
  4. requirejs.config({
  5. baseUrl: depth + 'js/lib',
  6. });
  7. requirejs([
  8. 'app/mapfactory',
  9. 'json!data/tours.json'
  10. ], function(mkmap, tours) {
  11. L.Icon.Default.imagePath = depth + 'img/leaflet/';
  12. var map = mkmap('map', [
  13. [55.76846, 12.45369],
  14. [55.54883, 12.67891]
  15. ]);
  16. /*
  17. requirejs([
  18. 'app/boundary',
  19. 'json!data/bydele.json'
  20. ], function(boundary, data) {
  21. map.addLayer(boundary(data));
  22. map.layers.addOverlay(boundary(data), 'Regionsgrænse');
  23. });
  24. */
  25. function style(feature) {
  26. return {
  27. weight: '2',
  28. color: '#336699',
  29. fillOpacity: '0.4'
  30. };
  31. }
  32. var geojson;
  33. function highlightFeature(e) {
  34. var layer = e.target;
  35. layer.setStyle({
  36. weight: 5,
  37. color: '#666',
  38. dashArray: '',
  39. fillOpacity: 0.7
  40. });
  41. if (!L.Browser.ie && !L.Browser.opera && !L.Browser.edge) {
  42. layer.bringToFront();
  43. }
  44. }
  45. function resetHighlight(e) {
  46. geojson.resetStyle(e.target);
  47. }
  48. function popup (e) {
  49. var layer = e.target;
  50. return '<a href="'+layer.feature.properties.link+'">'+layer.feature.properties.link+'</a>';
  51. }
  52. function onEachFeature(feature, layer) {
  53. layer.on({
  54. click: popup,
  55. mouseover: highlightFeature,
  56. mouseout: resetHighlight
  57. });
  58. }
  59. geojson = L.geoJson(tours, {
  60. style: style,
  61. onEachFeature: onEachFeature
  62. //}).bindPopup(function (layer) {
  63. // return '<a href="'+layer.feature.properties.link+'">'+layer.feature.properties.link+'</a>';
  64. }).addTo(map);
  65. //geojson.bindPopup("<a href=../../osterbro/>Ture på Østerbro</a>");
  66. //geojson.bindPopup(popup);
  67. var polygon = L.polygon([
  68. [55.69916, 12.59171],
  69. [55.69505, 12.59359],
  70. [55.69505, 12.6002],
  71. [55.68808, 12.59952],
  72. [55.67899, 12.59351],
  73. [55.66727, 12.57162],
  74. [55.66824, 12.57188],
  75. [55.67454, 12.56424],
  76. [55.67458, 12.56021],
  77. [55.67434, 12.55815],
  78. [55.68068, 12.56021],
  79. [55.68629, 12.56467],
  80. [55.69094, 12.57162],
  81. [55.69616, 12.57986]
  82. ]).addTo(map);
  83. polygon.bindPopup("<a href=../../city/>Ture i Indre By</a>");
  84. var polygon = L.polygon([
  85. [55.69036, 12.63256],
  86. [55.67507, 12.64904],
  87. [55.66481, 12.63883],
  88. [55.63391, 12.65943],
  89. [55.63090, 12.68028],
  90. [55.60744, 12.67891],
  91. [55.60589, 12.66998],
  92. [55.59542, 12.67342],
  93. [55.59348, 12.68200],
  94. [55.58766, 12.67960],
  95. [55.55408, 12.59171],
  96. [55.60744, 12.50622],
  97. [55.64176, 12.55360],
  98. [55.66306, 12.58553],
  99. [55.66287, 12.59377],
  100. [55.66636, 12.5948],
  101. [55.66965, 12.58175],
  102. [55.67139, 12.5845],
  103. [55.66907, 12.5996],
  104. [55.67507, 12.61024],
  105. [55.68494, 12.6123]
  106. ]).addTo(map);
  107. polygon.bindPopup("<a href=../../amager/>Ture på Amager</a>");
  108. var polygon = L.polygon([
  109. [55.72829, 12.52118],
  110. [55.72784, 12.52198],
  111. [55.72743, 12.52495],
  112. [55.72665, 12.52552],
  113. [55.72719, 12.52673],
  114. [55.727, 12.5275],
  115. [55.72713, 12.52962],
  116. [55.72698, 12.5332],
  117. [55.72714, 12.53514],
  118. [55.72632, 12.53948],
  119. [55.72421, 12.54104],
  120. [55.72364, 12.5425],
  121. [55.72355, 12.5442],
  122. [55.72374, 12.54439],
  123. [55.72384, 12.54553],
  124. [55.72355, 12.54667],
  125. [55.72375, 12.54875],
  126. [55.72388, 12.54926],
  127. [55.72371, 12.54958],
  128. [55.7238, 12.55025],
  129. [55.72351, 12.55173],
  130. [55.72336, 12.55379],
  131. [55.72257, 12.55426],
  132. [55.72245, 12.5613],
  133. [55.72188, 12.56345],
  134. [55.71986, 12.56126],
  135. [55.71982, 12.5619],
  136. [55.71967, 12.56235],
  137. [55.71982, 12.56261],
  138. [55.71912, 12.56433],
  139. [55.71137, 12.55327],
  140. [55.70828, 12.54465],
  141. [55.70662, 12.54184],
  142. [55.70375, 12.53911],
  143. [55.69807, 12.53669],
  144. [55.69749, 12.53604],
  145. [55.6973, 12.53214],
  146. [55.69679, 12.53214],
  147. [55.69684, 12.53016],
  148. [55.69597, 12.52984],
  149. [55.69558, 12.52759],
  150. [55.69677, 12.52562],
  151. [55.70186, 12.51952],
  152. [55.70664, 12.51592],
  153. [55.70842, 12.51175],
  154. [55.70949, 12.51257],
  155. [55.71043, 12.51272],
  156. [55.71181, 12.51205],
  157. [55.71385, 12.51568],
  158. [55.71577, 12.51652],
  159. [55.71712, 12.51645],
  160. [55.71767, 12.51439],
  161. [55.71771, 12.513],
  162. [55.71887, 12.51323],
  163. [55.71961, 12.51315],
  164. [55.72276, 12.51484],
  165. [55.72635, 12.51783],
  166. [55.72756, 12.5195]
  167. ]).addTo(map);
  168. polygon.bindPopup("<a href=../../bispebjerg/>Ture på Bispebjerg</a>");
  169. var polygon = L.polygon([
  170. [55.66979, 12.57956],
  171. [55.66648, 12.5949],
  172. [55.66297, 12.59383],
  173. [55.66404, 12.58482],
  174. [55.65993, 12.57634],
  175. [55.65639, 12.56993],
  176. [55.64996, 12.56647],
  177. [55.64787, 12.56184],
  178. [55.64867, 12.55877],
  179. [55.66113, 12.56819]
  180. ]).addTo(map);
  181. polygon.bindPopup("<a href=../../islandsbrygge/>Ture på Islands Brygge</a>");
  182. var polygon = L.polygon([
  183. [55.69805, 12.61943],
  184. [55.69747, 12.62951],
  185. [55.69466, 12.63046],
  186. [55.69256, 12.62544],
  187. [55.69017, 12.62393],
  188. [55.68842, 12.61376],
  189. [55.68704, 12.61359],
  190. [55.68683, 12.61883],
  191. [55.68511, 12.61273],
  192. [55.67967, 12.61406],
  193. [55.67393, 12.60982],
  194. [55.66948, 12.60037],
  195. [55.66764, 12.58965],
  196. [55.66858, 12.58239],
  197. [55.66989, 12.57956],
  198. [55.6747, 12.58793],
  199. [55.67833, 12.59664],
  200. [55.67771, 12.59879],
  201. [55.67923, 12.60063],
  202. [55.67754, 12.60767],
  203. [55.68373, 12.60947],
  204. [55.68736, 12.60823],
  205. [55.68925, 12.61055],
  206. [55.68997, 12.60621],
  207. [55.69728, 12.60836]
  208. ]).addTo(map);
  209. polygon.bindPopup("<a href=../../christianshavn/>Ture på Christianshavn</a>");
  210. var polygon = L.polygon([
  211. [55.69748, 12.53594],
  212. [55.69701, 12.53544],
  213. [55.69524, 12.53446],
  214. [55.69375, 12.53609],
  215. [55.69137, 12.53622],
  216. [55.68763, 12.54126],
  217. [55.68633, 12.54491],
  218. [55.68516, 12.54720],
  219. [55.68475, 12.55355],
  220. [55.68388, 12.55529],
  221. [55.68199, 12.55778],
  222. [55.67381, 12.55536],
  223. [55.67235, 12.55563],
  224. [55.67271, 12.55156],
  225. [55.67259, 12.54969],
  226. [55.67020, 12.54023],
  227. [55.67018, 12.53767],
  228. [55.66778, 12.53025],
  229. [55.66655, 12.52364],
  230. [55.66991, 12.51111],
  231. [55.6689, 12.49626],
  232. [55.67231, 12.49527],
  233. [55.67233, 12.4954],
  234. [55.67248, 12.49304],
  235. [55.6771, 12.4924],
  236. [55.67945, 12.49274],
  237. [55.68327, 12.4948],
  238. [55.68792, 12.50429],
  239. [55.69082, 12.516],
  240. [55.69488, 12.52424],
  241. [55.69587, 12.52999],
  242. [55.69667, 12.5321],
  243. [55.69725, 12.53222]
  244. ]).addTo(map);
  245. polygon.bindPopup("<a href=../../frederiksberg/>Ture på Frederiksberg</a>");
  246. var polygon = L.polygon([
  247. [55.70927, 12.61153],
  248. [55.70533, 12.61031],
  249. [55.69795, 12.6149],
  250. [55.69736, 12.60821],
  251. [55.68939, 12.60595],
  252. [55.68554, 12.60527],
  253. [55.68408, 12.60445],
  254. [55.68372, 12.60964],
  255. [55.6775, 12.60795],
  256. [55.6793, 12.60061],
  257. [55.67038, 12.58756],
  258. [55.6723, 12.58349],
  259. [55.66984, 12.57952],
  260. [55.66131, 12.56819],
  261. [55.6632, 12.5628],
  262. [55.66782, 12.57278],
  263. [55.67855, 12.59239],
  264. [55.67875, 12.59342],
  265. [55.68765, 12.59943],
  266. [55.69529, 12.59995],
  267. [55.69539, 12.59394],
  268. [55.70598, 12.59969]
  269. ]).addTo(map);
  270. polygon.bindPopup("<a href=../../havnen/>Ture ved Københavns Havn</a>");
  271. var polygon = L.polygon([
  272. [55.67466, 12.5642],
  273. [55.66819, 12.57196],
  274. [55.66776, 12.57111],
  275. [55.6673, 12.57154],
  276. [55.66381, 12.56441],
  277. [55.66209, 12.5657],
  278. [55.65311, 12.55866],
  279. [55.65454, 12.55261],
  280. [55.65541, 12.5533],
  281. [55.65704, 12.5527],
  282. [55.65408, 12.53849],
  283. [55.65529, 12.53767],
  284. [55.66248, 12.54154],
  285. [55.66326, 12.53068],
  286. [55.66723, 12.52828],
  287. [55.67015, 12.53806],
  288. [55.67308, 12.54823],
  289. [55.67267, 12.54999],
  290. [55.67451, 12.54986],
  291. [55.67352, 12.55411],
  292. [55.67456, 12.56021],
  293. [55.67352, 12.56115]
  294. ]).addTo(map);
  295. polygon.bindPopup("<a href=../../vesterbro/>Ture på Vesterbro</a>");
  296. var polygon = L.polygon([
  297. [55.69379, 12.536],
  298. [55.69447, 12.53549],
  299. [55.69524, 12.53446],
  300. [55.6966, 12.53566],
  301. [55.69713, 12.53557],
  302. [55.69807, 12.53673],
  303. [55.70103, 12.53785],
  304. [55.70376, 12.53909],
  305. [55.70659, 12.54192],
  306. [55.70826, 12.54463],
  307. [55.7113, 12.55334],
  308. [55.71004, 12.55506],
  309. [55.70361, 12.55772],
  310. [55.70313, 12.55875],
  311. [55.70642, 12.56252],
  312. [55.69636, 12.56166],
  313. [55.69171, 12.56948],
  314. [55.68726, 12.56278],
  315. [55.68208, 12.5578],
  316. [55.68475, 12.55385],
  317. [55.68538, 12.5469],
  318. [55.6876, 12.54141],
  319. [55.69108, 12.53643],
  320. [55.69287, 12.53557]
  321. ]).addTo(map);
  322. polygon.bindPopup("<a href=../../norrebro/>Ture på Nørrebro</a>");
  323. var polygon = L.polygon([
  324. [55.67938, 12.49236],
  325. [55.67734, 12.49227],
  326. [55.67243, 12.49291],
  327. [55.67231, 12.49519],
  328. [55.6688, 12.49618],
  329. [55.66984, 12.51107],
  330. [55.6664, 12.52364],
  331. [55.6673, 12.52823],
  332. [55.66328, 12.53059],
  333. [55.66321, 12.52772],
  334. [55.66248, 12.5245],
  335. [55.65164, 12.52755],
  336. [55.65108, 12.52154],
  337. [55.65219, 12.51596],
  338. [55.64546, 12.52308],
  339. [55.64386, 12.52223],
  340. [55.64192, 12.52283],
  341. [55.63967, 12.52184],
  342. [55.63713, 12.52248],
  343. [55.63737, 12.52094],
  344. [55.63439, 12.50901],
  345. [55.64667, 12.49068],
  346. [55.65285, 12.48502],
  347. [55.65725, 12.47785],
  348. [55.67197, 12.47867],
  349. [55.67219, 12.47433],
  350. [55.67272, 12.47442],
  351. [55.67282, 12.48176],
  352. [55.67398, 12.48407],
  353. [55.67584, 12.48446]
  354. ]).addTo(map);
  355. polygon.bindPopup("<a href=../../valby/>Ture i Valby</a>");
  356. var polygon = L.polygon([
  357. [55.69602, 12.5796],
  358. [55.69164, 12.58797],
  359. [55.69522, 12.59407],
  360. [55.69517, 12.60029],
  361. [55.68825, 12.59934],
  362. [55.68731, 12.59046],
  363. [55.6892, 12.58205],
  364. [55.68746, 12.57844],
  365. [55.6846, 12.57364],
  366. [55.67865, 12.56505],
  367. [55.68109, 12.56038],
  368. [55.68671, 12.56553],
  369. [55.69295, 12.5748]
  370. ]).addTo(map);
  371. polygon.bindPopup("<a href=../../voldkvarter/>Ture i Københavns voldkvarterer</a>");
  372. var polygon = L.polygon([
  373. [55.66321, 12.5278],
  374. [55.66299, 12.53725],
  375. [55.66246, 12.54128],
  376. [55.65534, 12.53772],
  377. [55.65396, 12.53832],
  378. [55.65699, 12.55265],
  379. [55.65541, 12.55312],
  380. [55.65386, 12.55197],
  381. [55.65193, 12.55892],
  382. [55.6474, 12.553],
  383. [55.64716, 12.55621],
  384. [55.64183, 12.54862],
  385. [55.64054, 12.54969],
  386. [55.64011, 12.54883],
  387. [55.63148, 12.53128],
  388. [55.63548, 12.53111],
  389. [55.6373, 12.52544],
  390. [55.63689, 12.5227],
  391. [55.6396, 12.52192],
  392. [55.64178, 12.52291],
  393. [55.64374, 12.52227],
  394. [55.64548, 12.52313],
  395. [55.65197, 12.51622],
  396. [55.65101, 12.52145],
  397. [55.65164, 12.52772],
  398. [55.66246, 12.52454]
  399. ]).addTo(map);
  400. polygon.bindPopup("<a href=../../sydvest/>Ture i Sydvestkvarteret</a>");
  401. });
  402. });