@octostar/map-component 0.1.13 → 0.1.15

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/dist/index.mjs CHANGED
@@ -5858,6 +5858,8 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
5858
5858
  tooltipShowTimeout = null;
5859
5859
  }
5860
5860
  tooltipEl2.style.display = "none";
5861
+ tooltipEl2.style.minWidth = "";
5862
+ tooltipEl2.style.minHeight = "";
5861
5863
  tooltipLngLat = null;
5862
5864
  tooltipFeatures = [];
5863
5865
  tooltipPageIndex = 0;
@@ -5870,7 +5872,7 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
5870
5872
  if (!isMouseOverPopup) {
5871
5873
  hideTooltip2();
5872
5874
  }
5873
- }, 300);
5875
+ }, 500);
5874
5876
  };
5875
5877
  const cancelTooltipHide = () => {
5876
5878
  if (tooltipHideTimeout) {
@@ -5952,6 +5954,10 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
5952
5954
  const navHtml = `<div style="display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #eee;padding:4px 0 6px;margin-bottom:4px;font-size:12px;color:#666;user-select:none"><button data-tooltip-nav="prev" style="${btnBase}border:1px solid ${prevDisabled ? "#eee" : "#ddd"};cursor:${prevDisabled ? "default" : "pointer"};color:${prevDisabled ? "#ccc" : "#444"}"${prevDisabled ? " disabled" : ""}>&lsaquo;</button><span>${tooltipPageIndex + 1} / ${tooltipFeatures.length}</span><button data-tooltip-nav="next" style="${btnBase}border:1px solid ${nextDisabled ? "#eee" : "#ddd"};cursor:${nextDisabled ? "default" : "pointer"};color:${nextDisabled ? "#ccc" : "#444"}"${nextDisabled ? " disabled" : ""}>&rsaquo;</button></div>`;
5953
5955
  html = navHtml + html;
5954
5956
  }
5957
+ if (tooltipPageIndex > 0 && tooltipFeatures.length > 1) {
5958
+ tooltipEl2.style.minWidth = tooltipEl2.offsetWidth + "px";
5959
+ tooltipEl2.style.minHeight = tooltipEl2.offsetHeight + "px";
5960
+ }
5955
5961
  showTooltip2(tooltipLngLatForPagination, html);
5956
5962
  };
5957
5963
  customLayers.forEach((layerId) => {
@@ -5965,10 +5971,10 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
5965
5971
  clearTimeout(tooltipHideTimeout);
5966
5972
  tooltipHideTimeout = null;
5967
5973
  }
5968
- if (!isMouseOverPopup) {
5969
- tooltipEl2.style.display = "none";
5970
- tooltipLngLat = null;
5971
- }
5974
+ tooltipEl2.style.display = "none";
5975
+ tooltipEl2.style.minWidth = "";
5976
+ tooltipEl2.style.minHeight = "";
5977
+ tooltipLngLat = null;
5972
5978
  if (e.features && e.features.length > 0) {
5973
5979
  const coordinates = e.lngLat;
5974
5980
  tooltipShowTimeout = setTimeout(() => {
@@ -6007,7 +6013,7 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
6007
6013
  const layer = layersRef.current.find((l) => l.id === lid);
6008
6014
  if (layer == null ? void 0 : layer.visible) allFeatures.push(...features);
6009
6015
  });
6010
- const EPS = 1e-7;
6016
+ const EPS = 1e-6;
6011
6017
  for (const cf of allFeatures) {
6012
6018
  if (((_c = cf.geometry) == null ? void 0 : _c.type) !== "Point") continue;
6013
6019
  const cc = cf.geometry.coordinates;