@vidro/map-handler 1.2.165 → 1.2.166

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.
Files changed (3) hide show
  1. package/README.md +15 -1
  2. package/package.json +1 -1
  3. package/src/index.js +19 -4
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Map Handler
2
2
 
3
- #### Version 1.2.158 - August 2024
3
+ #### Version 1.2.164 - October 2024
4
4
 
5
5
  Tool to achieve the easiest way of communication with the map iframe.
6
6
 
@@ -274,6 +274,20 @@ Notifies errors
274
274
 
275
275
  Notifies map status, as tiled loaded, background visible, etc..
276
276
 
277
+ ##### hover
278
+
279
+ When user puts mouse pointer over a feauture for more than 1 second, a `hover` event is dispatched.
280
+
281
+ If is no hover any feature event is dispatched with `feature:null`
282
+
283
+
284
+ > E.G
285
+
286
+ ```
287
+
288
+ {type: "hover", feature: {'property':'somevalue',...}
289
+ ```
290
+
277
291
  ## Methods
278
292
 
279
293
  ##### ZoomIn()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vidro/map-handler",
3
- "version": "1.2.165",
3
+ "version": "1.2.166",
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
@@ -151,7 +151,7 @@ class Communicator extends EventEmitter {
151
151
  layers: layers,
152
152
  });
153
153
  } else {
154
- this.emit("error", { error: "no layers" });
154
+ this.emitEvent("error", { error: "no layers" }, this.domId);
155
155
  }
156
156
  };
157
157
 
@@ -175,7 +175,12 @@ class Communicator extends EventEmitter {
175
175
  if (properties.singletile !== null) {
176
176
  if (typeof properties.singletile !== "boolean") {
177
177
  properties.singletile = null;
178
- this.emit("error", { error: "singletile must be a Boolean" });
178
+
179
+ this.emitEvent(
180
+ "error",
181
+ { error: "singletile must be a Boolean" },
182
+ this.domId
183
+ );
179
184
  }
180
185
  }
181
186
  if (
@@ -185,7 +190,12 @@ class Communicator extends EventEmitter {
185
190
  ) {
186
191
  if (isNaN(parseInt(properties.gutter))) {
187
192
  properties.gutter = null;
188
- this.emit("error", { error: "Gutter must be a number" });
193
+
194
+ this.emitEvent(
195
+ "error",
196
+ { error: "Gutter must be a number" },
197
+ this.domId
198
+ );
189
199
  }
190
200
  if (properties.singletile) {
191
201
  properties.gutter = null;
@@ -199,7 +209,12 @@ class Communicator extends EventEmitter {
199
209
  if (properties.transparent !== null) {
200
210
  if (typeof properties.transparent !== "boolean") {
201
211
  properties.transparent = null;
202
- this.emit("error", { error: "transparent must be a Boolean" });
212
+
213
+ this.emitEvent(
214
+ "error",
215
+ { error: "transparent must be a Boolean" },
216
+ this.domId
217
+ );
203
218
  }
204
219
  }
205
220
  this.com.sendMessageToMap({