From 4dd7f142ad4c8845bc2dd40a3947f8eb6752e891 Mon Sep 17 00:00:00 2001 From: Junqiu Lei Date: Fri, 12 Aug 2022 08:14:55 -0700 Subject: [PATCH] Fix maps wms zoom limitation (#1915) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When using WMS to customize base tile maps in region map or coordinate maps, user aren’t able to get into higher zoom levels than opensearch maps service default maximum zoom level. Issue Resolved: https://github.com/opensearch-project/maps/issues/19 Signed-off-by: Junqiu Lei --- src/plugins/maps_legacy/public/map/base_maps_visualization.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/maps_legacy/public/map/base_maps_visualization.js b/src/plugins/maps_legacy/public/map/base_maps_visualization.js index b544997c74d7..4eccea6faf92 100644 --- a/src/plugins/maps_legacy/public/map/base_maps_visualization.js +++ b/src/plugins/maps_legacy/public/map/base_maps_visualization.js @@ -164,7 +164,8 @@ export function BaseMapsVisualizationProvider() { try { if (this._wmsConfigured()) { - if (WMS_MINZOOM > this._opensearchDashboardsMap.getMaxZoomLevel()) { + const currentMaxZoomLevel = this._opensearchDashboardsMap.getMaxZoomLevel(); + if (WMS_MINZOOM < currentMaxZoomLevel || WMS_MAXZOOM > currentMaxZoomLevel) { this._opensearchDashboardsMap.setMinZoom(WMS_MINZOOM); this._opensearchDashboardsMap.setMaxZoom(WMS_MAXZOOM); }