@vidro/map-handler 1.0.9 → 1.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -32,6 +32,6 @@
32
32
 
33
33
  <div id="messages"></div>
34
34
  </body>
35
- <script src="https://unpkg.com/@vidro/map-handler@1.0.7/dist/map-handler.js"></script>
35
+ <script src="https://unpkg.com/@vidro/map-handler@1.0.9/dist/map-handler.js"></script>
36
36
  <script src="main.js"></script>
37
37
  </html>
@@ -64,6 +64,7 @@ communicator.on("layers", function(data){
64
64
  console.log("layers received",data);
65
65
  //fillDisplayedLayersSelect(data);
66
66
  selected_layer = data[0]; //select first layer from available layers
67
+ communicator.setActiveLayer(selected_layer);
67
68
  });
68
69
 
69
70
  //error event
@@ -158,3 +159,10 @@ if(btGetElementsFromLayer){
158
159
  communicator.getElementsFromLayer(selected_layer,limit,format);
159
160
  });
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
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vidro/map-handler",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "description": "Tool to achieve the easiest way of communication with the map",
5
5
  "homepage": "https://github.com/Vidro-Software-SL/maphandler",
6
6
  "repository": {
package/src/index.js CHANGED
@@ -179,7 +179,6 @@ class Communicator extends EventEmitter {
179
179
 
180
180
  getElementsFromLayer= (layer,limit,format) => {
181
181
  const _format = (typeof format=='undefined') ? 'xml' : format.toLowerCase();
182
- console.log(_format)
183
182
  if(_format!=="xml" && _format!=='json'){
184
183
  console.error("Format must be 'xml' or 'json");
185
184
  return;