Skip to content

Commit 37db9f2

Browse files
author
Eugene Rodygin
committed
Added the 'protocol' option for tiles requests
1 parent 6894e9e commit 37db9f2

File tree

3 files changed

+24
-4
lines changed

3 files changed

+24
-4
lines changed

src/DGCustomization/src/DGMap.BaseLayer.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,19 @@ DG.Map.addInitHook(function() {
2121
var showCommPoi = (this.options.showCommPoi ? '' : '&layerType=nc');
2222
validator.validateKeyResponse();
2323

24-
var tileUrl = DG.config.secureProtocol + (DG.Browser.retina ? DG.config.retinaTileServer : DG.config.tileServer) + showCommPoi;
25-
var arabicTileUrl = DG.config.secureProtocol +
24+
let protocol = this.options.protocol || DG.config.secureProtocol;
25+
// Check that last symbol is colon, and if not add it
26+
if (protocol[protocol.length - 1] !== ':') {
27+
protocol = protocol + ':';
28+
}
29+
30+
var tileUrl = protocol + (DG.Browser.retina ? DG.config.retinaTileServer : DG.config.tileServer) + showCommPoi;
31+
var arabicTileUrl = protocol +
2632
(DG.Browser.retina ? DG.config.arabicRetinaTileServer : DG.config.arabicTileServer) + showCommPoi;
2733

28-
var previewTileUrl = DG.config.secureProtocol +
34+
var previewTileUrl = protocol +
2935
(DG.Browser.retina ? DG.config.previewRetinaTileServer : DG.config.previewTileServer) + showCommPoi;
30-
var arabicPreviewTileUrl = DG.config.secureProtocol +
36+
var arabicPreviewTileUrl = protocol +
3137
(DG.Browser.retina ? DG.config.arabicPreviewRetinaTileServer : DG.config.arabicPreviewTileServer) + showCommPoi;
3238

3339
this.baseLayer = new BaseLayer(tileUrl, {

src/doc/en/manual/map.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,13 @@ Initialize the map on the "map" div with a given center and zoom:
6666
rendered in a <a href="/doc/maps/en/manual/vector-layers#dgsvg"><code>SVG</code></a> renderer.
6767
</td>
6868
</tr>
69+
<tr id="map-protocol">
70+
<td><code><b>protocol</b></code></td>
71+
<td><code>String </code></td>
72+
<td><code>''</code></td>
73+
<td>Network protocol used in tiles requests.
74+
</td>
75+
</tr>
6976
</tbody>
7077
</table>
7178

src/doc/ru/manual/map.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,13 @@
6767
отрисовываются с помощью <a href="/doc/maps/ru/manual/vector-layers#dgsvg"><code>SVG</code></a> рендерера.
6868
</td>
6969
</tr>
70+
<tr id="map-protocol">
71+
<td><code><b>protocol</b></code></td>
72+
<td><code>String </code></td>
73+
<td><code>''</code></td>
74+
<td>Сетевой проток, используемый в запросах к тайлам.
75+
</td>
76+
</tr>
7077
</tbody>
7178
</table>
7279

0 commit comments

Comments
 (0)