@vidro/map-handler 1.1.4 → 1.1.15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (170) hide show
  1. package/README.md +39 -101
  2. package/dist/map-handler.js +1 -1
  3. package/examples/full/cachedToken.dat +1 -1
  4. package/examples/full/cachedTokenData.dat +1 -1
  5. package/examples/full/index.php +9 -78
  6. package/examples/full/tester.js +12 -177
  7. package/examples/serverLess/dist/index.23420cfa.js +117 -120
  8. package/examples/serverLess/dist/index.23420cfa.js.map +1 -1
  9. package/examples/serverLess/dist/index.html +1 -38
  10. package/examples/serverLess/index.html +1 -2
  11. package/examples/serverLess/main.js +2 -2
  12. package/examples/simple/index.html +1 -1
  13. package/examples/taigua/index.html +46 -8
  14. package/examples/taigua/main.js +467 -18
  15. package/examples/vidromap/index.php +1 -1
  16. package/package.json +1 -1
  17. package/src/index.js +178 -321
  18. package/examples/externalwms/index.js +0 -20
  19. package/examples/externalwms/index.php +0 -88
  20. package/examples/integration/tool/css/dist/home.css.min.css +0 -0
  21. package/examples/integration/tool/css/dist/home.min.css +0 -1
  22. package/examples/integration/tool/css/dist/home.min.css.map +0 -10
  23. package/examples/integration/tool/css/dist/style-login.css.min.css +0 -0
  24. package/examples/integration/tool/css/dist/style-login.min.css +0 -1
  25. package/examples/integration/tool/css/dist/style-login.min.css.map +0 -10
  26. package/examples/integration/tool/css/dist/style.css.min.css +0 -0
  27. package/examples/integration/tool/css/dist/style.min.css +0 -1
  28. package/examples/integration/tool/css/dist/style.min.css.map +0 -23
  29. package/examples/integration/tool/css/master/_bottom-sheet-2.scss +0 -103
  30. package/examples/integration/tool/css/master/_bottom-sheet.scss +0 -142
  31. package/examples/integration/tool/css/master/_colors.scss +0 -35
  32. package/examples/integration/tool/css/master/_dropdown-form.scss +0 -167
  33. package/examples/integration/tool/css/master/_forms.scss +0 -416
  34. package/examples/integration/tool/css/master/_header.scss +0 -134
  35. package/examples/integration/tool/css/master/_menu-toc.scss +0 -135
  36. package/examples/integration/tool/css/master/_menu-tools.scss +0 -187
  37. package/examples/integration/tool/css/master/_mixins.scss +0 -42
  38. package/examples/integration/tool/css/master/_notifyjs.scss +0 -39
  39. package/examples/integration/tool/css/master/_ol-map-controls.scss +0 -117
  40. package/examples/integration/tool/css/master/_simplelightbox.scss +0 -287
  41. package/examples/integration/tool/css/master/_toc-config.scss +0 -28
  42. package/examples/integration/tool/css/master/_toc-layouts.scss +0 -173
  43. package/examples/integration/tool/css/master/_tooltip.scss +0 -34
  44. package/examples/integration/tool/css/master/home.scss +0 -266
  45. package/examples/integration/tool/css/master/style-login.scss +0 -240
  46. package/examples/integration/tool/css/master/style.scss +0 -166
  47. package/examples/integration/tool/img/doc-gallery-placeholder.svg +0 -3
  48. package/examples/integration/tool/img/home/ic_calendar-clock.svg +0 -1
  49. package/examples/integration/tool/img/home/ic_caret-down.svg +0 -1
  50. package/examples/integration/tool/img/home/ic_cog.svg +0 -1
  51. package/examples/integration/tool/img/home/ic_marker.svg +0 -1
  52. package/examples/integration/tool/img/home/ic_play-circle.svg +0 -1
  53. package/examples/integration/tool/img/home/ic_power.svg +0 -1
  54. package/examples/integration/tool/img/home/ic_squares.svg +0 -1
  55. package/examples/integration/tool/img/home/ic_user-pointer.svg +0 -1
  56. package/examples/integration/tool/img/home/ic_user-square.svg +0 -1
  57. package/examples/integration/tool/img/home/logo_footer.svg +0 -1
  58. package/examples/integration/tool/img/ic/accessControl.svg +0 -1
  59. package/examples/integration/tool/img/ic/account-location.svg +0 -1
  60. package/examples/integration/tool/img/ic/actionDelete.svg +0 -64
  61. package/examples/integration/tool/img/ic/actionOpen.svg +0 -64
  62. package/examples/integration/tool/img/ic/addFile.svg +0 -100
  63. package/examples/integration/tool/img/ic/addFile_off.svg +0 -102
  64. package/examples/integration/tool/img/ic/arrow-left.svg +0 -1
  65. package/examples/integration/tool/img/ic/arrow-right-drop-circle-outline.svg +0 -1
  66. package/examples/integration/tool/img/ic/bt_add_photo.svg +0 -3
  67. package/examples/integration/tool/img/ic/bug.svg +0 -1
  68. package/examples/integration/tool/img/ic/caret-down-bottomsheet.svg +0 -3
  69. package/examples/integration/tool/img/ic/checkbox-blank-outline-grey.svg +0 -8
  70. package/examples/integration/tool/img/ic/checkbox-blank-outline-white.svg +0 -8
  71. package/examples/integration/tool/img/ic/checkbox-blank-outline.svg +0 -1
  72. package/examples/integration/tool/img/ic/checkbox-marked-outline-grey.svg +0 -8
  73. package/examples/integration/tool/img/ic/checkbox-marked-outline-white.svg +0 -8
  74. package/examples/integration/tool/img/ic/checkbox-marked-outline.svg +0 -1
  75. package/examples/integration/tool/img/ic/chevron-down-grey.svg +0 -7
  76. package/examples/integration/tool/img/ic/chevron-down-white.svg +0 -7
  77. package/examples/integration/tool/img/ic/chevron-down.svg +0 -1
  78. package/examples/integration/tool/img/ic/chevron-right-grey.svg +0 -7
  79. package/examples/integration/tool/img/ic/chevron-right-white.svg +0 -7
  80. package/examples/integration/tool/img/ic/chevron-right.svg +0 -1
  81. package/examples/integration/tool/img/ic/comment-text-outline.svg +0 -1
  82. package/examples/integration/tool/img/ic/cookie.svg +0 -1
  83. package/examples/integration/tool/img/ic/delete.svg +0 -1
  84. package/examples/integration/tool/img/ic/dot.svg +0 -1
  85. package/examples/integration/tool/img/ic/dump.svg +0 -1
  86. package/examples/integration/tool/img/ic/e.svg +0 -9
  87. package/examples/integration/tool/img/ic/eye-off.svg +0 -1
  88. package/examples/integration/tool/img/ic/eye.svg +0 -1
  89. package/examples/integration/tool/img/ic/forbidden.svg +0 -1
  90. package/examples/integration/tool/img/ic/form-title-1.svg +0 -3
  91. package/examples/integration/tool/img/ic/group.svg +0 -1
  92. package/examples/integration/tool/img/ic/hamburger.svg +0 -1
  93. package/examples/integration/tool/img/ic/ic-users.svg +0 -1
  94. package/examples/integration/tool/img/ic/ic_dropdown-form-close.svg +0 -3
  95. package/examples/integration/tool/img/ic/ic_dropdown-form-link.svg +0 -3
  96. package/examples/integration/tool/img/ic/ic_feature-edit-cancel.svg +0 -14
  97. package/examples/integration/tool/img/ic/ic_feature-edit-save.svg +0 -14
  98. package/examples/integration/tool/img/ic/ic_gallery-item-delete.svg +0 -3
  99. package/examples/integration/tool/img/ic/ic_gallery-item-view.svg +0 -3
  100. package/examples/integration/tool/img/ic/ic_gps.svg +0 -3
  101. package/examples/integration/tool/img/ic/ic_search.svg +0 -5
  102. package/examples/integration/tool/img/ic/ic_selector_fechas.svg +0 -63
  103. package/examples/integration/tool/img/ic/ic_zoom-to-extent.svg +0 -3
  104. package/examples/integration/tool/img/ic/icon_reminder.png +0 -0
  105. package/examples/integration/tool/img/ic/image-gallery-placeholder.svg +0 -55
  106. package/examples/integration/tool/img/ic/imaqua.svg +0 -87
  107. package/examples/integration/tool/img/ic/incidencia.svg +0 -77
  108. package/examples/integration/tool/img/ic/info_multi_selection.svg +0 -230
  109. package/examples/integration/tool/img/ic/layers.svg +0 -1
  110. package/examples/integration/tool/img/ic/map-marker.svg +0 -3
  111. package/examples/integration/tool/img/ic/map.svg +0 -1
  112. package/examples/integration/tool/img/ic/measure_area.svg +0 -111
  113. package/examples/integration/tool/img/ic/minus.svg +0 -7
  114. package/examples/integration/tool/img/ic/notification.svg +0 -1
  115. package/examples/integration/tool/img/ic/offline.svg +0 -3
  116. package/examples/integration/tool/img/ic/online.svg +0 -1
  117. package/examples/integration/tool/img/ic/pencil.svg +0 -3
  118. package/examples/integration/tool/img/ic/plus.svg +0 -1
  119. package/examples/integration/tool/img/ic/polygon_selection.svg +0 -68
  120. package/examples/integration/tool/img/ic/power.svg +0 -1
  121. package/examples/integration/tool/img/ic/remoteLocalized.svg +0 -4
  122. package/examples/integration/tool/img/ic/remoteStartLocalize.svg +0 -4
  123. package/examples/integration/tool/img/ic/ruler.svg +0 -125
  124. package/examples/integration/tool/img/ic/selection-plus.svg +0 -10
  125. package/examples/integration/tool/img/ic/selection.svg +0 -1
  126. package/examples/integration/tool/img/ic/settings.svg +0 -1
  127. package/examples/integration/tool/img/ic/sort.svg +0 -1
  128. package/examples/integration/tool/img/ic/sort_asc.svg +0 -1
  129. package/examples/integration/tool/img/ic/sort_desc.svg +0 -1
  130. package/examples/integration/tool/img/ic/spreadsheet.svg +0 -3
  131. package/examples/integration/tool/img/ic/times.svg +0 -1
  132. package/examples/integration/tool/img/ic/toolbar/AB3.svg +0 -1
  133. package/examples/integration/tool/img/ic/toolbar/AB4.svg +0 -1
  134. package/examples/integration/tool/img/ic/toolbar/IC1.svg +0 -1
  135. package/examples/integration/tool/img/ic/toolbar/TB1.svg +0 -1
  136. package/examples/integration/tool/img/ic/toolbar/TB11.svg +0 -5
  137. package/examples/integration/tool/img/ic/toolbar/TB2.svg +0 -1
  138. package/examples/integration/tool/img/ic/toolbar/TB20.svg +0 -1
  139. package/examples/integration/tool/img/ic/toolbar/TB21.svg +0 -54
  140. package/examples/integration/tool/img/ic/toolbar/TB3.svg +0 -1
  141. package/examples/integration/tool/img/ic/toolbar/TB31.svg +0 -1
  142. package/examples/integration/tool/img/ic/toolbar/TB32.svg +0 -57
  143. package/examples/integration/tool/img/ic/toolbar/TB4.svg +0 -1
  144. package/examples/integration/tool/img/ic/toolbar/TB5.svg +0 -1
  145. package/examples/integration/tool/img/ic/toolbar/TB6.svg +0 -1
  146. package/examples/integration/tool/img/ic/toolbar/TB7.svg +0 -1
  147. package/examples/integration/tool/img/ic/toolbar/TB8.svg +0 -1
  148. package/examples/integration/tool/img/ic/tools.svg +0 -28
  149. package/examples/integration/tool/img/ic/user.svg +0 -1
  150. package/examples/integration/tool/img/ic/vector-polygon.svg +0 -1
  151. package/examples/integration/tool/img/ic/visit_manager.svg +0 -135
  152. package/examples/integration/tool/img/logo-footer-login.png +0 -0
  153. package/examples/integration/tool/img/logo-footer.png +0 -0
  154. package/examples/integration/tool/img/logo-header-login.png +0 -0
  155. package/examples/integration/tool/img/logo-header-login@2x.png +0 -0
  156. package/examples/integration/tool/img/logo-header-login@3x.png +0 -0
  157. package/examples/integration/tool/img/logo-header.png +0 -0
  158. package/examples/integration/tool/img/logo-header@2x.png +0 -0
  159. package/examples/integration/tool/img/logo-header@3x.png +0 -0
  160. package/examples/integration/tool/img/logo_project.png +0 -0
  161. package/examples/integration/tool/img/photo-gallery-placeholder.svg +0 -3
  162. package/examples/integration/tool/img/pixel.png +0 -0
  163. package/examples/integration/tool/index.html +0 -228
  164. package/examples/integration/tool/js/demo.js +0 -238
  165. package/examples/integration/tool/js/interface.js +0 -147
  166. package/examples/integration/tool/js/jquery.js +0 -4
  167. package/examples/integration/vanguardia.html +0 -6636
  168. package/examples/taigua/global.css +0 -10
  169. package/examples/xavi/index.html +0 -37
  170. package/examples/xavi/main.js +0 -168
@@ -1,10 +0,0 @@
1
- body {
2
- margin: 0; /* Reset default margin */
3
- }
4
- iframe {
5
- display: block; /* iframes are inline by default */
6
- background: #000;
7
- border: none; /* Reset default border */
8
- height: 100vh; /* Viewport-relative units */
9
- width: 100vw;
10
- }
@@ -1,37 +0,0 @@
1
-
2
- <!DOCTYPE html>
3
- <html>
4
- <link rel="stylesheet" type="text/css" href="./css/fulla.css" media="screen" />
5
- <body>
6
- <div><iframe id="map-frame" name="map-frame" width="100%" height="750" allow="geolocation"
7
- src="https://component.vidrosoftware.com?sessionToken=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiJmYzYyYmY3ZTcyN2I5N2MxMTU3YzRjODQ0MjgxOGYyM2E5MDM0MmYyIiwiZGF0YSI6eyJ6b29tIjo5LCJiYWNrZ3JvdW5kIjoiQ2FydG9EQkxpZ2h0Iiwic3JpZCI6bnVsbCwiZXh0ZW50IjpudWxsLCJnZW9zZXJ2aWNlIjoiUUdJUyIsIm5hbWUiOiJQVU5UU01PU1RSRUlHMiIsInByZXZpZXciOmZhbHNlLCJhcGkiOiJodHRwczpcL1wvYXBpLnZpZHJvc29mdHdhcmUuY29tXC8iLCJ0eXBlIjoidmlkcm9tYXAiLCJ0b2tlbiI6ImIzYWM0N2M0MDIzYzJiMjBmNTU2MGVkZGFlMzllMDIyIiwic2hvd19sYXllcnMiOiJQVU5UU01PU1RSRUlHIiwiaWQiOjE5MSwibG9nbyI6Imh0dHBzOlwvXC93d3cudmlkcm9zb2Z0d2FyZS5jb21cL2xvZ29zXC9WSURSTy5zdmcifX0.V810R82nV0qpw4UcZQuUfINuTeCXSOX7bOwJzMxWurTcHXw-Zxlzb753aQuI0-biodJQrIvV_MQMh5PJImrKQOEEDa-z4pDiEhiHo1uAdOHLRHBmcdG7p_ejRVc76LGeIF3Dh566pnPPAFZRSdsd_tS5Wdeye84OTyUoQG9oZ27UsE-ctr43Umlo1oi-As0g41ITv6nuao51hSd1xOAqozKYqf1IUVY-z4g9EbvVikOn8RVs9BIedQOA3YtKPeV_UXMpjBIWgjnJDCkty08DYxZGsxnaoKo2YoBOTR9deaRIEVygvXPY485hJY3mD25SSmuJof474WlpmyVqSPZTunAMU7uRBCV-XpMYb9hlLzG0mXB26E-l41PEZGwPsBi0p-QvnYFcUhT2F9pZckcI63lxU4-XRdaTbaG0N3Aznk9zO6_RC3QEHp6fLaq74zrMUbOROR5gkBmEAg28PkUNv4zMPV91lcx6qLJVkO7M_4uzr9bSJmifC7XFvm5MiRSgdfEVCG4-TNnc_V-ake_ijNAFU-YsmSoZ2HejbZf61uemYu6S8_JnTAS1fGamv4DA4L0cDsCfNcwtbC-yIaQeRdq36b1Q612RcWIChX8MHpb_RoRfrI-lLsyf8VgX24I0piAAq9TAIsk2UYFu10ebYR0kpeMzXS0wxkKE-ArfTFU"></iframe>
8
- </div>
9
- <div id="botonera">
10
-
11
- <button id="btZoomIn" name="btZoomIn"> <img id="img" src="./img/zoom-in.png"/></button>
12
- <button id="btZoomOut" name="btZoomOut"><img id="img" src="./img/zoom-out.png"></button>
13
- <button id="btPosition" name="btPosition"><img id="img" src="./img/geo.png"></button>
14
- <button id="btZoomToCoordinates" name="btZoomToCoordinates"><img id="img" src="./img/geo.png"></button>
15
- <button id="btGetElementsFromLayer" name="btGetElementsFromLayer">Get Elements from layer</button>
16
- <br>
17
- <label>Cercar:</label>
18
- <ul>
19
- <li><a href="">Punt 1</a></li>
20
- <li><a href="">Punt 2</a></li>
21
- </ul>
22
-
23
- </div>
24
- <p>
25
- <a href="http://jigsaw.w3.org/css-validator/check/referer">
26
- <img style="border:0;width:88px;height:31px"
27
- src="http://jigsaw.w3.org/css-validator/images/vcss-blue"
28
- alt="¡CSS Válido!" />
29
- </a>
30
- </p>
31
-
32
-
33
- <div id="messages"></div>
34
- </body>
35
- <script src="https://unpkg.com/@vidro/map-handler@1.0.10/dist/map-handler.js"></script>
36
- <script src="main.js"></script>
37
- </html>
@@ -1,168 +0,0 @@
1
- var sessionToken =
2
- "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJleHAiOjE2NTQ5MzMyMTksImF1ZCI6ImM1NzhjY2IyODFlMTY1ZGEwODljZWZlYzgxMGE5NDliNDllYWU5ODEiLCJkYXRhIjp7Inpvb20iOjksImJhY2tncm91bmQiOiJDYXJ0b0RCTGlnaHQiLCJzcmlkIjpudWxsLCJleHRlbnQiOm51bGwsImdlb3NlcnZpY2UiOiJRR0lTIiwibmFtZSI6IlBVTlRTTU9TVFJFSUcyIiwicHJldmlldyI6dHJ1ZSwiYXBpIjoiaHR0cHM6XC9cL2FwaS52aWRyb3NvZnR3YXJlLmNvbVwvIiwidHlwZSI6InZpZHJvbWFwIiwidG9rZW4iOiIwZGNkZTI2MjdhNDk0MTcxNjk0YTIxZmFmNjcwNmE5NiIsInNob3dfbGF5ZXJzIjoiUFVOVFNNT1NUUkVJRyIsImlkIjoxOTEsImxvZ28iOiJodHRwczpcL1wvd3d3LnZpZHJvc29mdHdhcmUuY29tXC9sb2dvc1wvVklEUk8uc3ZnIn19.qq2NOgCYPGqauE0IbCAoZoU8kHUaqhk9Z43f1ahFmNVAnjGpQ12xv2ITsvDR4g9LhfJg2s3MQaUKreZQTesIvDPLJGrwrCriDiBrsHnfgh0S0G3wQdUw58KxQapVVJKqznCK9QVaCQiA2xAm4HcLeRBHGpjd7f0sRa1kkGc-MGUkT5-S4WfPhJa7svs2YKM2n17MRBR5KCI6Ujlw-HMTt-UnBFs7CcHcvq-P5rbEs4UzMmvAiwM3Do-w3Mwx2fAeTq3RD1TdAobvPM3SiFKjoQINDW-4zj3Ds0Iuc2NNdIGzJX7hKelD80hXm5iHO3N8M-Du8lX2YCQS1qkz-XeKmRhKkLP_WCDC1ry1yKwTvd6xWvR_Hz1YbeAm6jmUYp6gIf0UZl_ZuwA-UQjMCWWmDrNvO9it215OwUEDPGznuvTfg-ESNLpmvxkedQoIsrVIRuSMwH4Vk990OMXSvYsZbJJZb71Z9BA1HhMQQ-ifT77m0vnBBfqeBikRAUhm0-uQq97JMRrb9GC9Pg_IQwg4jLtubirE5T-8JMjS6SWRfjeWdHmzFHngFxLkCayai7j8Bf8QoorBT0_zdcXYnzTKL3W9TDHmHdvQ4M8C7RVe3_NtNpJPm4ErmdWDL1NecsA8HUxWz5m6Y0FY7z8KO9hYpsRsj5MS4Q8zyldqvs91rx0"
3
- var clickedCoordinates = null;
4
- var communicator = new VidroMaps.Communicator({
5
- sessionToken: sessionToken,
6
- });
7
- var selected_layer; //active layer
8
-
9
- //ZoomIn -------------------------------------------------------------
10
- var btZoomIn = document.getElementById("btZoomIn");
11
- btZoomIn.addEventListener("click", function () {
12
- console.log("Zoom In");
13
- communicator.ZoomIn();
14
- });
15
- //ZoomOut-------------------------------------------------------------
16
- var btZoomOut = document.getElementById("btZoomOut");
17
- btZoomOut.addEventListener("click", function () {
18
- console.log("Zoom Out");
19
- communicator.ZoomOut();
20
- });
21
-
22
- //GeoPosicionament----------------------------------------------------
23
- var btZoomToCoordinates = document.getElementById("btZoomToCoordinates");
24
-
25
- /*btZoomToCoordinates.addEventListener("click", function () {
26
- //console.log("m'han clicat i demanat geolocalitzacio");
27
- //containerMessages.innerHTML = `Coordinates -> x: ${data.coordinates[0]}, y: ${data.coordinates[1]}`;
28
- //communicator.zoomToCoordinates;
29
-
30
- communicator.zoomToCoordinates(419006.12985785044, 4576698.8136144625, 18);
31
- console.log("llego")
32
- });
33
- */
34
-
35
- //zoomTocoordinates
36
- if(btZoomToCoordinates){
37
- btZoomToCoordinates.addEventListener("click", function(){
38
- console.log("btZoomToCoordinates clicked" )
39
- let level = 18;
40
- if(document.getElementById('zoomLevelToCoordinates')){
41
- //zoom Level
42
- level = document.getElementById('zoomLevelToCoordinates').value
43
- }
44
- if(clickedCoordinates){
45
- communicator.zoomToCoordinates(clickedCoordinates[0],clickedCoordinates[1],level);
46
- }else{
47
- console.error("No coordinates provided");
48
- }
49
- });
50
- }
51
-
52
-
53
- var btZoomToExtent = document.querySelector("#btZoomToExtent");
54
-
55
- //capa actual
56
- var currentActiveLayer = null;
57
- function cleanContainers(){
58
- Error_container.innerHTML = '';
59
- Result_container.innerHTML = '';
60
- }
61
-
62
- //per veure les capas
63
- communicator.on("layers", function(data){
64
- console.log("layers received",data);
65
- //fillDisplayedLayersSelect(data);
66
- selected_layer = data[0]; //select first layer from available layers
67
- communicator.setActiveLayer(selected_layer);
68
- });
69
-
70
- //error event
71
- communicator.on("error", function(data){
72
- console.error("error",data);
73
- cleanContainers();
74
- Error_container.innerHTML = data.error;
75
- });
76
-
77
- //clicked coordinates
78
- communicator.on("coordinates", function (data) {
79
- console.info("coordinates", data);
80
-
81
- clickedCoordinates = [data.coordinates[0], data.coordinates[1]];
82
- containerMessages.innerHTML = `Clicked coordinates -> x: ${data.coordinates[0]}, y: ${data.coordinates[1]}`;
83
- });
84
-
85
- //event geolocation
86
- communicator.on("geolocation", function(data){
87
- console.info("geolocation",data);
88
- containerMessages.innerHTML= `Geolocation: -> ${data}`;
89
-
90
- cleanContainers();
91
- });
92
-
93
- //info event
94
- communicator.on("info", function(data){
95
- console.log("info received",data);
96
- var dataToRender = data.data;
97
- //depending on infoType, data.data can be an string or a JSON
98
- if(data.infoType==="giswater"){
99
- dataToRender = JSON.stringify(data.data)
100
- }
101
- cleanContainers();
102
- Result_container.innerText = dataToRender;
103
- });
104
-
105
-
106
-
107
-
108
- var containerMessages = document.getElementById("messages");
109
-
110
- //geolocation
111
- communicator.on("geolocation", function(data){
112
- console.info("geolocation",data);
113
- cleanContainers();
114
- result_container.innerHTML = `Clicked coordinates -> x: ${data.coordinates[0]}, y: ${data.coordinates[1]}`;
115
-
116
- });
117
-
118
-
119
-
120
- communicator.on("onZoomChange", function (data) {
121
- console.log("onZoomChange event", data);
122
- //containerMessages.innerHTML = `Zoom aplicat: ${data}`;
123
- });
124
-
125
- communicator.on("loaded", function (data) {
126
- console.log("loaded event", data);
127
- });
128
-
129
- //zoom to extent
130
- if(btZoomToExtent){
131
- btZoomToExtent.addEventListener("click", function(){
132
- cleanContainers();
133
- communicator.zoomToExtent();
134
- });
135
- }
136
-
137
-
138
- //info event
139
- communicator.on("info", function (data) {
140
- console.log("info received", data);
141
- var dataToRender = data.data;
142
- //depending on infoType, data.data can be an string or a JSON
143
- if (data.infoType === "giswater") {
144
- dataToRender = JSON.stringify(data.data);
145
- }
146
-
147
- containerMessages.innerText = dataToRender;
148
- });
149
-
150
-
151
- //NEW
152
-
153
- var btGetElementsFromLayer = document.querySelector("#btGetElementsFromLayer");
154
- if(btGetElementsFromLayer){
155
-
156
- btGetElementsFromLayer.addEventListener("click", function(){
157
- let limit = document.getElementById('limit') ? document.getElementById('limit').value : 100;
158
- let format = document.getElementById('format') ? document.getElementById('format').value : 'xml';
159
- communicator.getElementsFromLayer(selected_layer,limit,format);
160
- });
161
- }
162
- //Layer elements list
163
- communicator.on("layerElements", function(data){
164
- console.log("layerElements received",data);
165
- var dataToRender = data.data;
166
- //depending on requested format, data.data can be an string (xml) or a JSON
167
- console.log((typeof dataToRender==="object")? JSON.stringify(dataToRender): dataToRender);
168
- });