From 37db9f28a8544352885b396b0f40a60fd3e67b88 Mon Sep 17 00:00:00 2001 From: Eugene Rodygin Date: Tue, 24 Jun 2025 01:01:57 +0300 Subject: [PATCH 1/3] Added the 'protocol' option for tiles requests --- src/DGCustomization/src/DGMap.BaseLayer.js | 14 ++++++++++---- src/doc/en/manual/map.md | 7 +++++++ src/doc/ru/manual/map.md | 7 +++++++ 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/DGCustomization/src/DGMap.BaseLayer.js b/src/DGCustomization/src/DGMap.BaseLayer.js index 64b650c0a..3f1dbb7f0 100644 --- a/src/DGCustomization/src/DGMap.BaseLayer.js +++ b/src/DGCustomization/src/DGMap.BaseLayer.js @@ -21,13 +21,19 @@ DG.Map.addInitHook(function() { var showCommPoi = (this.options.showCommPoi ? '' : '&layerType=nc'); validator.validateKeyResponse(); - var tileUrl = DG.config.secureProtocol + (DG.Browser.retina ? DG.config.retinaTileServer : DG.config.tileServer) + showCommPoi; - var arabicTileUrl = DG.config.secureProtocol + + let protocol = this.options.protocol || DG.config.secureProtocol; + // Check that last symbol is colon, and if not add it + if (protocol[protocol.length - 1] !== ':') { + protocol = protocol + ':'; + } + + var tileUrl = protocol + (DG.Browser.retina ? DG.config.retinaTileServer : DG.config.tileServer) + showCommPoi; + var arabicTileUrl = protocol + (DG.Browser.retina ? DG.config.arabicRetinaTileServer : DG.config.arabicTileServer) + showCommPoi; - var previewTileUrl = DG.config.secureProtocol + + var previewTileUrl = protocol + (DG.Browser.retina ? DG.config.previewRetinaTileServer : DG.config.previewTileServer) + showCommPoi; - var arabicPreviewTileUrl = DG.config.secureProtocol + + var arabicPreviewTileUrl = protocol + (DG.Browser.retina ? DG.config.arabicPreviewRetinaTileServer : DG.config.arabicPreviewTileServer) + showCommPoi; this.baseLayer = new BaseLayer(tileUrl, { diff --git a/src/doc/en/manual/map.md b/src/doc/en/manual/map.md index fa761b07b..b768485ad 100644 --- a/src/doc/en/manual/map.md +++ b/src/doc/en/manual/map.md @@ -66,6 +66,13 @@ Initialize the map on the "map" div with a given center and zoom: rendered in a SVG renderer. + + protocol + String + '' + Network protocol used in tiles requests. + + diff --git a/src/doc/ru/manual/map.md b/src/doc/ru/manual/map.md index 722171ae2..7eebf11f3 100644 --- a/src/doc/ru/manual/map.md +++ b/src/doc/ru/manual/map.md @@ -67,6 +67,13 @@ отрисовываются с помощью SVG рендерера. + + protocol + String + '' + Сетевой проток, используемый в запросах к тайлам. + + From 8a193c4cafaeb3f352c84b910a4c58f800b11678 Mon Sep 17 00:00:00 2001 From: Eugene Rodygin Date: Tue, 24 Jun 2025 01:11:21 +0300 Subject: [PATCH 2/3] Fixed build --- src/DGCustomization/src/DGMap.BaseLayer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DGCustomization/src/DGMap.BaseLayer.js b/src/DGCustomization/src/DGMap.BaseLayer.js index 3f1dbb7f0..2fccd9f04 100644 --- a/src/DGCustomization/src/DGMap.BaseLayer.js +++ b/src/DGCustomization/src/DGMap.BaseLayer.js @@ -21,7 +21,7 @@ DG.Map.addInitHook(function() { var showCommPoi = (this.options.showCommPoi ? '' : '&layerType=nc'); validator.validateKeyResponse(); - let protocol = this.options.protocol || DG.config.secureProtocol; + var protocol = this.options.protocol || DG.config.secureProtocol; // Check that last symbol is colon, and if not add it if (protocol[protocol.length - 1] !== ':') { protocol = protocol + ':'; From d21ab97170c88120f2b4b4d732d92b55ea958dcc Mon Sep 17 00:00:00 2001 From: Evgeny Rodygin Date: Tue, 24 Jun 2025 09:03:32 +0300 Subject: [PATCH 3/3] Update src/doc/ru/manual/map.md Fixed misprint Co-authored-by: Michel Beloshitsky --- src/doc/ru/manual/map.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doc/ru/manual/map.md b/src/doc/ru/manual/map.md index 7eebf11f3..72631492e 100644 --- a/src/doc/ru/manual/map.md +++ b/src/doc/ru/manual/map.md @@ -71,7 +71,7 @@ protocol String '' - Сетевой проток, используемый в запросах к тайлам. + Сетевой протокол, используемый в запросах к тайлам.