@cowegis/client 1.0.3 → 1.0.5

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.
@@ -2,6 +2,8 @@ import osmtogeojson from 'osmtogeojson';
2
2
 
3
3
  import leaflet from '../leaflet';
4
4
  import {mapFactory} from "../factory";
5
+ import {determineListener} from "../factory/bindEvents";
6
+ import pointToLayer from "../geojson/pointToLayer";
5
7
 
6
8
  /**
7
9
  * Get the bounds as overpass bbox string.
@@ -32,12 +34,13 @@ export default leaflet.FeatureGroup.extend({
32
34
  * @param options
33
35
  */
34
36
  initialize: function (options, element) {
35
- if (!options.pointToLayer) {
36
- options.pointToLayer = this.pointToLayer;
37
- }
38
- if (!options.onEachFeature) {
39
- options.onEachFeature = this.onEachFeature;
40
- }
37
+ options.pointToLayer = options.pointToLayer
38
+ ? determineListener(options.pointToLayer, element)
39
+ : this.pointToLayer;
40
+
41
+ options.onEachFeature = options.onEachFeature
42
+ ? determineListener(options.onEachFeature, element)
43
+ : this.onEachFeature;
41
44
 
42
45
  leaflet.Util.setOptions(this, options);
43
46
  this.options.dynamicLoad = !this.options.adjustBounds && !!this.options.query.match(/BBOX/g);
@@ -83,6 +83,10 @@ export default async function (config, element) {
83
83
  ? determineListener(config.options.pointToLayer, element)
84
84
  : pointToLayer;
85
85
 
86
+ if (config.options.onEachFeature) {
87
+ config.options.onEachFeature = determineListener(config.options.onEachFeature, element);
88
+ }
89
+
86
90
  config.options.pointToLayer = (feature, latlng) => pointToLayerCallback(feature, latlng, element, pointToLayer);
87
91
 
88
92
  const layer = leaflet.geoJSON(data, config.options);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cowegis/client",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "Cowegis web client",
5
5
  "main": "js/client.js",
6
6
  "repository": {
@@ -20,18 +20,18 @@
20
20
  },
21
21
  "homepage": "https://github.com/cowegis/client#readme",
22
22
  "dependencies": {
23
- "@fortawesome/fontawesome-svg-core": "^6.1",
24
- "@fortawesome/free-brands-svg-icons": "^6.1",
25
- "@fortawesome/free-regular-svg-icons": "^6.1",
26
- "@fortawesome/free-solid-svg-icons": "^6.1",
27
- "@geoman-io/leaflet-geoman-free": "^2.13.0",
23
+ "@fortawesome/fontawesome-svg-core": "^7.3",
24
+ "@fortawesome/free-brands-svg-icons": "^7.3",
25
+ "@fortawesome/free-regular-svg-icons": "^7.3",
26
+ "@fortawesome/free-solid-svg-icons": "^7.3",
27
+ "@geoman-io/leaflet-geoman-free": "^2.20.0",
28
28
  "@mapbox/togeojson": "^0.16.0",
29
29
  "@raruto/leaflet-gesture-handling": "^1.4.3",
30
30
  "leaflet": "^1.9.4",
31
- "leaflet-control-geocoder": "^2.4.0",
31
+ "leaflet-control-geocoder": "^4.0.0",
32
32
  "leaflet-loading": "^0.1.24",
33
- "leaflet-providers": "^2.0.0",
34
- "leaflet.fullscreen": "^3.0.2",
33
+ "leaflet-providers": "^3.0.0",
34
+ "leaflet.fullscreen": "^5.0.0",
35
35
  "leaflet.markercluster": "^1.5.3",
36
36
  "leaflet.markercluster.layersupport": "^2.0.1",
37
37
  "osmtogeojson": "^3.0.0-beta.5",