@provoly/dashboard 0.22.7 → 0.22.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.
@@ -1796,14 +1796,19 @@ class WidgetMapComponent extends DataWidgetComponent {
1796
1796
  this.map.setLayers([...mapStyleLayer]);
1797
1797
  }
1798
1798
  }));
1799
- this.subscriptions.add(combineLatest([this.wmsFeatures$, this.classicFeatures$, this.widgetSize$, this.displayHeader$]).subscribe(([wmsFeatures, classicFeatures, size, header]) => {
1799
+ this.subscriptions.add(combineLatest([this.wmsFeatures$, this.classicFeatures$])
1800
+ .pipe(withLatestFrom(this.widgetSize$, this.displayHeader$))
1801
+ .subscribe(([[wmsFeatures, classicFeatures], size, header]) => {
1800
1802
  if (this.map) {
1801
1803
  this.tooltipIndex = 0;
1802
- const popupOverlay = new Overlay({
1804
+ if (this.popupOverlay !== null) {
1805
+ this.clearTooltip();
1806
+ }
1807
+ this.popupOverlay = new Overlay({
1803
1808
  element: this.popup.nativeElement,
1804
1809
  offset: [9, 9]
1805
1810
  });
1806
- this.map.addOverlay(popupOverlay);
1811
+ this.map.addOverlay(this.popupOverlay);
1807
1812
  this.popupContent.clear();
1808
1813
  const componentPromises = [];
1809
1814
  wmsFeatures.forEach((value) => {
@@ -1817,7 +1822,7 @@ class WidgetMapComponent extends DataWidgetComponent {
1817
1822
  this.tooltipNumber = realComponents.length;
1818
1823
  if (realComponents.length <= 0) {
1819
1824
  this.popup.nativeElement.hidden = true;
1820
- popupOverlay.setPosition([-9999999999, -9999999999]);
1825
+ this.popupOverlay?.setPosition([-9999999999, -9999999999]);
1821
1826
  }
1822
1827
  else {
1823
1828
  this.popup.nativeElement.hidden = false;
@@ -1836,11 +1841,21 @@ class WidgetMapComponent extends DataWidgetComponent {
1836
1841
  setTimeout(() => {
1837
1842
  this.tooltipMove(0);
1838
1843
  }, 10);
1839
- popupOverlay.setPosition(this.map.getCoordinateFromPixel(pixel ?? [0, 0]));
1844
+ this.popupOverlay?.setPosition(this.map.getCoordinateFromPixel(pixel ?? [0, 0]));
1840
1845
  }
1841
1846
  });
1842
1847
  }
1843
1848
  }));
1849
+ window.addEventListener('forceCloseMapTooltip', () => {
1850
+ this.clearTooltip();
1851
+ });
1852
+ }
1853
+ clearTooltip() {
1854
+ if (this.popupOverlay)
1855
+ this.map.removeOverlay(this.popupOverlay);
1856
+ this.popupContent.clear();
1857
+ this.previousTooltip?.destroy();
1858
+ this.previousTooltipSub?.unsubscribe();
1844
1859
  }
1845
1860
  addEmptyWebGlLayerBelowSlideHeatmaps(layers) {
1846
1861
  const _layers = [];
@@ -2152,7 +2167,7 @@ class WidgetMapComponent extends DataWidgetComponent {
2152
2167
  FEATURE_COUNT: 10,
2153
2168
  ...layer.getProperties()['getFeatureInfoAdditionalParameters']
2154
2169
  });
2155
- if (url) {
2170
+ if (url && url.indexOf('I=-1') === -1 && url.indexOf('J=-1') === -1) {
2156
2171
  this.store.dispatch(DashboardActions.getWmsFeatures({
2157
2172
  url,
2158
2173
  oClass: layer.getProperties()['oClass'] ?? '',