@abi-software/flatmap-viewer 2.2.1-beta.8 → 2.2.1-beta.9

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/README.rst CHANGED
@@ -38,7 +38,7 @@ The map server endpoint is specified as ``MAP_ENDPOINT`` in ``src/main.js``. It
38
38
  Package Installation
39
39
  ====================
40
40
 
41
- * ``npm install @abi-software/flatmap-viewer@2.2.1-beta.8``
41
+ * ``npm install @abi-software/flatmap-viewer@2.2.1-beta.9``
42
42
 
43
43
  Documentation
44
44
  -------------
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abi-software/flatmap-viewer",
3
- "version": "2.2.1-beta.8",
3
+ "version": "2.2.1-beta.9",
4
4
  "description": "Flatmap viewer using Maplibre GL",
5
5
  "repository": "https://github.com/AnatomicMaps/flatmap-viewer.git",
6
6
  "main": "src/main.js",
@@ -649,7 +649,10 @@ export class UserInteractions
649
649
  && !('labelled' in properties)) {
650
650
  let tooltip = '';
651
651
  const label = properties.label;
652
- tooltips.push((label.substr(0, 1).toUpperCase() + label.substr(1)).replaceAll("\n", "<br/>"));
652
+ const cleanLabel = (label.substr(0, 1).toUpperCase() + label.substr(1)).replaceAll("\n", "<br/>");
653
+ if (!tooltips.includes(cleanLabel)) {
654
+ tooltips.push(cleanLabel);
655
+ }
653
656
  }
654
657
  }
655
658
  if (tooltips.length === 0) {
@@ -814,11 +817,17 @@ export class UserInteractions
814
817
  }
815
818
  info = `<div id="info-control-info">${htmlList.join('\n')}</div>`;
816
819
  }
817
- this.activateFeature_(feature);
818
820
  if ('nerveId' in feature.properties) {
821
+ if (feature.properties.active) {
822
+ this.activateFeature_(feature);
823
+ } else {
824
+ tooltip = '';
825
+ }
819
826
  if (feature.properties.nerveId !== feature.properties.featureId) {
820
827
  this.activateNerveFeatures_(feature.properties.nerveId);
821
828
  }
829
+ } else {
830
+ this.activateFeature_(feature);
822
831
  }
823
832
  if ('hyperlink' in feature.properties) {
824
833
  this._map.getCanvas().style.cursor = 'pointer';
package/src/styling.js CHANGED
@@ -454,7 +454,8 @@ export class FeatureNerveLayer extends VectorStyleLayer
454
454
  ['boolean', ['feature-state', 'active'], false], '#222',
455
455
  ['boolean', ['feature-state', 'selected'], false], 'red',
456
456
  ['boolean', ['feature-state', 'hidden'], false], '#CCC',
457
- '#888'
457
+ ['boolean', ['get', 'active'], false], '#888',
458
+ '#FFF'
458
459
  ],
459
460
  'line-opacity': [
460
461
  'case',