@abi-software/flatmapvuer 0.2.4-beta-2 → 0.2.4-beta-3

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.
package/package-lock.json CHANGED
@@ -5,9 +5,9 @@
5
5
  "requires": true,
6
6
  "dependencies": {
7
7
  "@abi-software/flatmap-viewer": {
8
- "version": "2.2.0-beta.4",
9
- "resolved": "https://registry.npmjs.org/@abi-software/flatmap-viewer/-/flatmap-viewer-2.2.0-beta.4.tgz",
10
- "integrity": "sha512-9r0dJ+jcsSxwP+4n6IRiZey3KWaeY3VN8MLpXtw5SLiCJWwHubh55XyXc7DuJ9glZ2G8L6BnqlMoKXmdB+0ccQ==",
8
+ "version": "2.2.0-beta.6",
9
+ "resolved": "https://registry.npmjs.org/@abi-software/flatmap-viewer/-/flatmap-viewer-2.2.0-beta.6.tgz",
10
+ "integrity": "sha512-R2ejDar9zs6jvizJbq8ECbeZCx2qbrNiurhjDcmNquFeyoOb6lA6wrYK9I5n5HSnXh+H1wQemvKbke+PnH1K+Q==",
11
11
  "requires": {
12
12
  "@babel/runtime": "^7.10.4",
13
13
  "@turf/area": "^6.0.1",
@@ -1298,9 +1298,9 @@
1298
1298
  "integrity": "sha1-ioP5M1x4YO/6Lu7KJUMyqgru2PI="
1299
1299
  },
1300
1300
  "@mapbox/tiny-sdf": {
1301
- "version": "2.0.4",
1302
- "resolved": "https://registry.npmjs.org/@mapbox/tiny-sdf/-/tiny-sdf-2.0.4.tgz",
1303
- "integrity": "sha512-CBtL2rhZiYmdIryksp0zh4Mmx54iClYfNb0mpYeHrZnq4z84lVjre7LBWGPEjWspEn6AiF0lxC1HaZDye89m3g=="
1301
+ "version": "2.0.5",
1302
+ "resolved": "https://registry.npmjs.org/@mapbox/tiny-sdf/-/tiny-sdf-2.0.5.tgz",
1303
+ "integrity": "sha512-OhXt2lS//WpLdkqrzo/KwB7SRD8AiNTFFzuo9n14IBupzIMa67yGItcK7I2W9D8Ghpa4T04Sw9FWsKCJG50Bxw=="
1304
1304
  },
1305
1305
  "@mapbox/unitbezier": {
1306
1306
  "version": "0.0.1",
@@ -8055,9 +8055,9 @@
8055
8055
  }
8056
8056
  },
8057
8057
  "maplibre-gl": {
8058
- "version": "2.1.1",
8059
- "resolved": "https://registry.npmjs.org/maplibre-gl/-/maplibre-gl-2.1.1.tgz",
8060
- "integrity": "sha512-FRAHc4kPYKDF0+QMm8tnkyhv65Ed5SKLbzcH6hHM20XAK+9pqHMIHxlwpxcb4zGl+czz1bUegYf/KXjJRh9aDA==",
8058
+ "version": "2.1.6",
8059
+ "resolved": "https://registry.npmjs.org/maplibre-gl/-/maplibre-gl-2.1.6.tgz",
8060
+ "integrity": "sha512-UHdw4YeCkIyfG7vMdNK6e/sDNPB7jjUN5MUytKE1DFQB7sKM9V19ar1GUyn0uYRvQwJ5iC01fWhH3r/5bbHlKQ==",
8061
8061
  "requires": {
8062
8062
  "@mapbox/geojson-rewind": "^0.5.1",
8063
8063
  "@mapbox/jsonlint-lines-primitives": "^2.0.2",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abi-software/flatmapvuer",
3
- "version": "0.2.4-beta-2",
3
+ "version": "0.2.4-beta-3",
4
4
  "main": "./dist/flatmapvuer.common.js",
5
5
  "files": [
6
6
  "dist/*",
@@ -16,7 +16,7 @@
16
16
  "lint": "vue-cli-service lint"
17
17
  },
18
18
  "dependencies": {
19
- "@abi-software/flatmap-viewer": "2.2.0-beta.4",
19
+ "@abi-software/flatmap-viewer": "2.2.0-beta.6",
20
20
  "@abi-software/svg-sprite": "^0.1.14",
21
21
  "core-js": "^3.3.2",
22
22
  "css-element-queries": "^1.2.2",
package/src/App.vue CHANGED
@@ -18,7 +18,8 @@
18
18
  </el-popover>
19
19
 
20
20
  <MultiFlatmapVuer ref="multi" :availableSpecies="availableSpecies"
21
- @resource-selected="FlatmapSelected" :minZoom="minZoom"
21
+ @resource-selected="FlatmapSelected" :minZoom="minZoom"
22
+ @pan-zoom-callback="panZoomcallback"
22
23
  @ready="FlatmapReady" :featureInfo="featureInfo" :searchable="searchable"
23
24
  :initial="initial" :pathControls="pathControls" :helpMode="helpMode"
24
25
  :displayMinimap=true :flatmapAPI="flatmapAPI"/>
@@ -58,8 +59,12 @@ export default {
58
59
  FlatmapReady: function(component) {
59
60
  let taxon = component.mapImp.describes;
60
61
  let id = component.mapImp.addMarker("UBERON:0000948", "simulation");
62
+ component.enablePanZoomEvents(true);
61
63
  console.log(taxon, id);
62
64
  },
65
+ panZoomcallback: function(payload) {
66
+ console.log(payload);
67
+ }
63
68
  },
64
69
  data: function(){
65
70
  return {
@@ -73,6 +78,7 @@ export default {
73
78
  "Kember":{taxo: "ABI:1000001", displayWarning:true},
74
79
  "Pig":{taxo: "NCBITaxon:9823", iconClass:"icon-mapicon_pig", displayWarning:true},
75
80
  "Cat":{taxo: "NCBITaxon:9685", iconClass:"icon-mapicon_cat", displayWarning:true},
81
+ "digestive tract":{taxo: "digestive tract", displayWarning:true}
76
82
  },
77
83
  tooltipContent: undefined,
78
84
  tStyle: {
@@ -81,9 +87,10 @@ export default {
81
87
  position: "absolute"
82
88
  },
83
89
  displayCloseButton: false,
84
- initial: "Rat",
90
+ initial: "digestive tract",
85
91
  helpMode: false,
86
- flatmapAPI: "https://mapcore-demo.org/fccb/flatmap/"
92
+ //flatmapAPI: "https://mapcore-demo.org/fccb/flatmap/"
93
+ flatmapAPI: "https://mapcore-demo.org/devel/flatmap/v3/"
87
94
  }
88
95
  },
89
96
  mounted: function() {
@@ -338,24 +338,31 @@ export default {
338
338
  this.mapImp.showPaths(this.checkedItems);
339
339
  }
340
340
  },
341
+ enablePanZoomEvents: function(flag) {
342
+ this.mapImp.enablePanZoomEvents(flag);
343
+ },
341
344
  eventCallback: function() {
342
- return (eventType, feature, ...args) => {
343
- const label = feature.label;
344
- const resource = [feature.models];
345
- const taxonomy = this.entry;
346
- const data = {
347
- dataset: feature.dataset,
348
- taxonomy: taxonomy,
349
- resource: resource,
350
- label: label,
351
- feature: feature,
352
- userData: args,
353
- eventType: eventType
354
- };
355
- // Disable the nueron pop up for now.
356
- if (feature && feature.type !== "marker")
357
- this.checkAndCreatePopups(data);
358
- this.$emit("resource-selected", data);
345
+ return (eventType, data, ...args) => {
346
+ if (eventType !== "pan-zoom") {
347
+ const label = data.label;
348
+ const resource = [data.models];
349
+ const taxonomy = this.entry;
350
+ const payload = {
351
+ dataset: data.dataset,
352
+ taxonomy: taxonomy,
353
+ resource: resource,
354
+ label: label,
355
+ feature: data,
356
+ userData: args,
357
+ eventType: eventType
358
+ };
359
+ // Disable the nueron pop up for now.
360
+ if (data && data.type !== "marker")
361
+ this.checkAndCreatePopups(data);
362
+ this.$emit("resource-selected", payload);
363
+ } else {
364
+ this.$emit("pan-zoom-callback", data);
365
+ }
359
366
  };
360
367
  },
361
368
  // checkNeuronClicked shows a neuron path pop up if a path was recently clicked
@@ -36,6 +36,7 @@
36
36
  :ref="key"
37
37
  @resource-selected="FlatmapSelected"
38
38
  @ready="FlatmapReady"
39
+ @pan-zoom-callback="panZoomCallback"
39
40
  :featureInfo="featureInfo"
40
41
  :minZoom="minZoom"
41
42
  :pathControls="pathControls"
@@ -119,6 +120,9 @@ export default {
119
120
  getCurrentFlatmap: function() {
120
121
  return this.$refs[this.activeSpecies][0];
121
122
  },
123
+ panZoomCallback: function(payload) {
124
+ this.$emit("pan-zoom-callback", payload);
125
+ },
122
126
  showPopup: function(featureId, node, options) {
123
127
  let map = this.getCurrentFlatmap();
124
128
  map.showPopup(featureId, node, options);