@maptrip/map-tiles 1.3.3 → 1.5.0
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/README.md +15 -2
- package/dist/core/VectorTileFactory.d.ts +2 -0
- package/dist/core/constants.d.ts +5 -0
- package/dist/core/rendering_config_default.d.ts +45 -32
- package/dist/core/rendering_config_grayscale.d.ts +45 -32
- package/dist/map-tiles.js +241 -143
- package/dist/map-tiles.js.map +1 -1
- package/dist/util/MapReleaseFetcher.d.ts +2 -1
- package/lib/api-extensions/leaflet/MapTripLeafletGridLayer.ts +3 -1
- package/lib/core/VectorTileFactory.ts +52 -7
- package/lib/core/VectorTileRenderer.ts +129 -129
- package/lib/core/constants.ts +12 -1
- package/lib/core/rendering_config_default.ts +32 -27
- package/lib/core/rendering_config_grayscale.ts +31 -26
- package/lib/util/MapReleaseFetcher.ts +15 -5
- package/package.json +4 -4
package/dist/map-tiles.js
CHANGED
|
@@ -1107,6 +1107,30 @@ class CollisionDetector {
|
|
|
1107
1107
|
}
|
|
1108
1108
|
}
|
|
1109
1109
|
|
|
1110
|
+
const URL_TEMPLATE = "https://v${index}.maptrip.de/?tilex=${x}&tiley=${y}&acao=true&context=tomtom${z}&project=${project}&projection=wgs84";
|
|
1111
|
+
const PROVIDER_PROJECTS = {
|
|
1112
|
+
tomtom: "TomTom_latest",
|
|
1113
|
+
orbis: "Orbis_latest",
|
|
1114
|
+
here: "HERE_latest",
|
|
1115
|
+
openstreetmap: "OSM_latest"
|
|
1116
|
+
};
|
|
1117
|
+
const PROVIDER_NAMES = {
|
|
1118
|
+
tomtom: "TomTom",
|
|
1119
|
+
orbis: "TomTom Orbis",
|
|
1120
|
+
here: "HERE",
|
|
1121
|
+
openstreetmap: "OpenStreetMap"
|
|
1122
|
+
};
|
|
1123
|
+
const PROVIDER_TRAFFIC = {
|
|
1124
|
+
tomtom: "https://v0.maptrip.de/tiles?project=TrafficMobileTomTom_EUROPE&tilex=${x}&tiley=${y}&acao=true&context=traffic${z}&projection=wgs84",
|
|
1125
|
+
here: "https://v0.maptrip.de/tiles?project=TrafficMobileHere_EUROPE&tilex=${x}&tiley=${y}&acao=true&context=traffic${z}&projection=wgs84",
|
|
1126
|
+
openstreetmap: null
|
|
1127
|
+
};
|
|
1128
|
+
const MIN_ZOOM = 2;
|
|
1129
|
+
const MAX_ZOOM = 18;
|
|
1130
|
+
const ATTRIBUTION = '© <a href="https://maptrip.de/" target="_blank">infoware GmbH</a>';
|
|
1131
|
+
const VECTOR_TILE_SIZE = 256;
|
|
1132
|
+
const VECTOR_TILE_RENDER_PADDING = 32;
|
|
1133
|
+
|
|
1110
1134
|
class VectorTileRenderer {
|
|
1111
1135
|
_styles;
|
|
1112
1136
|
_images;
|
|
@@ -1117,7 +1141,7 @@ class VectorTileRenderer {
|
|
|
1117
1141
|
}
|
|
1118
1142
|
drawTile(layer, z, boundaries, context) {
|
|
1119
1143
|
context.fillStyle = this.getBackgroundColor(z);
|
|
1120
|
-
context.fillRect(0, 0,
|
|
1144
|
+
context.fillRect(0, 0, VECTOR_TILE_SIZE, VECTOR_TILE_SIZE);
|
|
1121
1145
|
var collisions = new CollisionDetector();
|
|
1122
1146
|
let polygons = layer.filter((it) => !!it.properties && !!it.geometry.type).filter(
|
|
1123
1147
|
(it) => it.geometry.type === "Polygon" || it.geometry.type === "MultiPolygon"
|
|
@@ -1159,6 +1183,11 @@ class VectorTileRenderer {
|
|
|
1159
1183
|
"linesOutline",
|
|
1160
1184
|
collisions
|
|
1161
1185
|
);
|
|
1186
|
+
}
|
|
1187
|
+
for (let i = 0; i < rank.length; i++) {
|
|
1188
|
+
let currentRank = lines.filter(
|
|
1189
|
+
(it) => parseInt(it.properties.sort_rank) === rank[i]
|
|
1190
|
+
);
|
|
1162
1191
|
this.drawTilePhase(
|
|
1163
1192
|
currentRank,
|
|
1164
1193
|
z,
|
|
@@ -1173,7 +1202,7 @@ class VectorTileRenderer {
|
|
|
1173
1202
|
var context = canvas.getContext("2d");
|
|
1174
1203
|
if (context != null) {
|
|
1175
1204
|
context.fillStyle = "#C8C8C8";
|
|
1176
|
-
context.fillRect(0, 0,
|
|
1205
|
+
context.fillRect(0, 0, VECTOR_TILE_SIZE, VECTOR_TILE_SIZE);
|
|
1177
1206
|
context.fillStyle = "#AAA";
|
|
1178
1207
|
context.font = "15px Arial";
|
|
1179
1208
|
context.textAlign = "center";
|
|
@@ -1322,12 +1351,12 @@ class VectorTileRenderer {
|
|
|
1322
1351
|
context,
|
|
1323
1352
|
collisions
|
|
1324
1353
|
)) {
|
|
1325
|
-
const match = text.match(/([
|
|
1354
|
+
const match = text.match(/([a-zA-Z])\s?([0-9]+[a-z]*).*/);
|
|
1326
1355
|
if (match) {
|
|
1327
1356
|
const letter = match[1];
|
|
1328
1357
|
const number = match[2];
|
|
1329
|
-
if (letter === "A" || letter === "B") {
|
|
1330
|
-
text = number;
|
|
1358
|
+
if (letter === "A" || letter === "B" || letter === "s") {
|
|
1359
|
+
text = letter === "A" || letter === "B" ? number : letter + number;
|
|
1331
1360
|
this.drawImage(
|
|
1332
1361
|
coordinates,
|
|
1333
1362
|
boundaries,
|
|
@@ -1366,6 +1395,8 @@ class VectorTileRenderer {
|
|
|
1366
1395
|
}
|
|
1367
1396
|
}
|
|
1368
1397
|
}
|
|
1398
|
+
} else {
|
|
1399
|
+
console.log("no renderer for kind " + kind);
|
|
1369
1400
|
}
|
|
1370
1401
|
}
|
|
1371
1402
|
}
|
|
@@ -1417,11 +1448,18 @@ class VectorTileRenderer {
|
|
|
1417
1448
|
for (var j = 0; j < coordinates.length; j++) {
|
|
1418
1449
|
var part = coordinates[j];
|
|
1419
1450
|
context.globalAlpha = merged.opacity;
|
|
1420
|
-
|
|
1451
|
+
if ("areas" !== phase || j === 0) {
|
|
1452
|
+
context.beginPath();
|
|
1453
|
+
}
|
|
1454
|
+
const width = boundaries.max.lon - boundaries.min.lon;
|
|
1455
|
+
const height = boundaries.max.lat - boundaries.min.lat;
|
|
1456
|
+
if (width === 0 || height === 0) {
|
|
1457
|
+
return;
|
|
1458
|
+
}
|
|
1421
1459
|
var points = [];
|
|
1422
1460
|
for (let k = 0; k < part.length; k++) {
|
|
1423
|
-
let x =
|
|
1424
|
-
let y =
|
|
1461
|
+
let x = VECTOR_TILE_SIZE * (part[k][0] - boundaries.min.lon) / width;
|
|
1462
|
+
let y = VECTOR_TILE_SIZE * (part[k][1] - boundaries.min.lat) / height;
|
|
1425
1463
|
points.push({ x, y });
|
|
1426
1464
|
if (k == 0) {
|
|
1427
1465
|
context.moveTo(x, y);
|
|
@@ -1437,7 +1475,7 @@ class VectorTileRenderer {
|
|
|
1437
1475
|
context.stroke();
|
|
1438
1476
|
}
|
|
1439
1477
|
return;
|
|
1440
|
-
} else if ("areas" === phase) {
|
|
1478
|
+
} else if ("areas" === phase && j === coordinates.length - 1) {
|
|
1441
1479
|
if (merged.url) {
|
|
1442
1480
|
if (this._images[merged.url]) {
|
|
1443
1481
|
var pattern = context.createPattern(
|
|
@@ -1454,7 +1492,7 @@ class VectorTileRenderer {
|
|
|
1454
1492
|
}
|
|
1455
1493
|
context.fillStyle = merged.color;
|
|
1456
1494
|
}
|
|
1457
|
-
context.fill();
|
|
1495
|
+
context.fill("evenodd");
|
|
1458
1496
|
} else if ("areaTexts" === phase) {
|
|
1459
1497
|
if (geoJsonProperties && geoJsonProperties.NAME) {
|
|
1460
1498
|
if (texts && texts[geoJsonProperties.NAME]) {
|
|
@@ -1462,7 +1500,7 @@ class VectorTileRenderer {
|
|
|
1462
1500
|
}
|
|
1463
1501
|
let merged2 = { ...VectorTileRenderer.DEFAULT_STYLE.TEXT, ...style };
|
|
1464
1502
|
context.globalAlpha = merged2.opacity;
|
|
1465
|
-
context.font = merged2.fontStyle
|
|
1503
|
+
context.font = `${merged2.fontStyle} ${merged2.fontWeight} ${merged2.size}px ${merged2.font}`;
|
|
1466
1504
|
context.textAlign = "left";
|
|
1467
1505
|
context.textBaseline = "top";
|
|
1468
1506
|
var metrics = context.measureText(geoJsonProperties.NAME);
|
|
@@ -1471,7 +1509,7 @@ class VectorTileRenderer {
|
|
|
1471
1509
|
let y = centroid.y;
|
|
1472
1510
|
let w = metrics.width;
|
|
1473
1511
|
let h = merged2.size;
|
|
1474
|
-
if (x < 0 || x + w >
|
|
1512
|
+
if (x < 0 || x + w > VECTOR_TILE_SIZE || y < 0 || y + h > VECTOR_TILE_SIZE) {
|
|
1475
1513
|
return;
|
|
1476
1514
|
}
|
|
1477
1515
|
if (collisions && collisions.isCollision(x, y, w, h)) {
|
|
@@ -1551,13 +1589,11 @@ class VectorTileRenderer {
|
|
|
1551
1589
|
projectCoordinates(coordinates, boundaries) {
|
|
1552
1590
|
var lastX, lastY;
|
|
1553
1591
|
var points = [];
|
|
1592
|
+
const width = boundaries.max.lon - boundaries.min.lon;
|
|
1593
|
+
const height = boundaries.max.lat - boundaries.min.lat;
|
|
1554
1594
|
for (var j = 0; j < coordinates.length; j++) {
|
|
1555
|
-
var x = Math.round(
|
|
1556
|
-
|
|
1557
|
-
);
|
|
1558
|
-
var y = Math.round(
|
|
1559
|
-
256 * (coordinates[j][1] - boundaries.min.lat) / (boundaries.max.lat - boundaries.min.lat)
|
|
1560
|
-
);
|
|
1595
|
+
var x = Math.round(VECTOR_TILE_SIZE * (coordinates[j][0] - boundaries.min.lon) / width);
|
|
1596
|
+
var y = Math.round(VECTOR_TILE_SIZE * (coordinates[j][1] - boundaries.min.lat) / height);
|
|
1561
1597
|
if (x != lastX || y != lastY) {
|
|
1562
1598
|
points.push({ x, y });
|
|
1563
1599
|
}
|
|
@@ -1592,35 +1628,50 @@ class VectorTileRenderer {
|
|
|
1592
1628
|
context.setLineDash([]);
|
|
1593
1629
|
}
|
|
1594
1630
|
if (merged.url && this._images[merged.url]) {
|
|
1595
|
-
|
|
1596
|
-
|
|
1631
|
+
const desiredDistance = 40;
|
|
1632
|
+
const margin = Math.round(desiredDistance / 2);
|
|
1633
|
+
let totalLength = 0;
|
|
1634
|
+
for (let i2 = 0; i2 < points.length - 1; i2++) {
|
|
1635
|
+
totalLength += Math.hypot(
|
|
1636
|
+
points[i2 + 1].x - points[i2].x,
|
|
1637
|
+
points[i2 + 1].y - points[i2].y
|
|
1638
|
+
);
|
|
1639
|
+
}
|
|
1640
|
+
let distance = margin;
|
|
1641
|
+
let traveled = 0;
|
|
1597
1642
|
for (var i = 0; i < points.length - 1; i++) {
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1643
|
+
const dx = points[i + 1].x - points[i].x;
|
|
1644
|
+
const dy = points[i + 1].y - points[i].y;
|
|
1645
|
+
let angle = Math.atan2(dy, dx);
|
|
1601
1646
|
if (merged.direction != "reverse") {
|
|
1602
1647
|
angle = angle + Math.PI;
|
|
1603
1648
|
}
|
|
1604
|
-
|
|
1649
|
+
const distanceToNext = Math.sqrt(dx * dx + dy * dy);
|
|
1605
1650
|
while (distance < distanceToNext) {
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1651
|
+
if (traveled + distance <= totalLength - margin) {
|
|
1652
|
+
const f = distance / distanceToNext;
|
|
1653
|
+
const x = points[i].x + f * dx;
|
|
1654
|
+
const y = points[i].y + f * dy;
|
|
1655
|
+
const size = Math.max(12, 1.5 * merged.width);
|
|
1656
|
+
if (x > size && y > size && x < VECTOR_TILE_SIZE - size && y < VECTOR_TILE_SIZE - size) {
|
|
1657
|
+
context.save();
|
|
1658
|
+
context.translate(x, y);
|
|
1659
|
+
context.rotate(angle);
|
|
1660
|
+
context.translate(-x, -y);
|
|
1661
|
+
context.drawImage(
|
|
1662
|
+
this._images[merged.url],
|
|
1663
|
+
x - size / 2,
|
|
1664
|
+
y - size / 2,
|
|
1665
|
+
size,
|
|
1666
|
+
size
|
|
1667
|
+
);
|
|
1668
|
+
context.restore();
|
|
1669
|
+
}
|
|
1670
|
+
}
|
|
1671
|
+
distance += desiredDistance;
|
|
1622
1672
|
}
|
|
1623
|
-
|
|
1673
|
+
traveled += distanceToNext;
|
|
1674
|
+
distance -= distanceToNext;
|
|
1624
1675
|
}
|
|
1625
1676
|
}
|
|
1626
1677
|
}
|
|
@@ -1634,7 +1685,7 @@ class VectorTileRenderer {
|
|
|
1634
1685
|
}
|
|
1635
1686
|
var merged = { ...VectorTileRenderer.DEFAULT_STYLE.TEXT, ...style };
|
|
1636
1687
|
context.globalAlpha = merged.opacity;
|
|
1637
|
-
context.font = merged.fontStyle
|
|
1688
|
+
context.font = `${merged.fontStyle} ${merged.fontWeight} ${merged.size}px ${merged.font}`;
|
|
1638
1689
|
var points = this.projectCoordinates(coordinates, boundaries);
|
|
1639
1690
|
if (points.length < 2) {
|
|
1640
1691
|
return;
|
|
@@ -1808,10 +1859,10 @@ class VectorTileRenderer {
|
|
|
1808
1859
|
if (merged.url) {
|
|
1809
1860
|
if (this._images[merged.url]) {
|
|
1810
1861
|
var x = Math.round(
|
|
1811
|
-
|
|
1862
|
+
VECTOR_TILE_SIZE * (coordinate[0] - boundaries.min.lon) / (boundaries.max.lon - boundaries.min.lon)
|
|
1812
1863
|
);
|
|
1813
1864
|
var y = Math.round(
|
|
1814
|
-
|
|
1865
|
+
VECTOR_TILE_SIZE * (coordinate[1] - boundaries.min.lat) / (boundaries.max.lat - boundaries.min.lat)
|
|
1815
1866
|
);
|
|
1816
1867
|
if (merged.width && merged.height) {
|
|
1817
1868
|
merged.width = Number(merged.width);
|
|
@@ -1832,15 +1883,15 @@ class VectorTileRenderer {
|
|
|
1832
1883
|
*/
|
|
1833
1884
|
isTextCollision(coordinate, name, boundaries, style, context, collisions) {
|
|
1834
1885
|
var merged = { ...VectorTileRenderer.DEFAULT_STYLE.TEXT, ...style };
|
|
1835
|
-
|
|
1836
|
-
|
|
1886
|
+
let x = Math.round(
|
|
1887
|
+
VECTOR_TILE_SIZE * (coordinate[0] - boundaries.min.lon) / (boundaries.max.lon - boundaries.min.lon)
|
|
1837
1888
|
);
|
|
1838
|
-
|
|
1839
|
-
|
|
1889
|
+
let y = Math.round(
|
|
1890
|
+
VECTOR_TILE_SIZE * (coordinate[1] - boundaries.min.lat) / (boundaries.max.lat - boundaries.min.lat)
|
|
1840
1891
|
);
|
|
1841
|
-
context.font = merged.fontStyle
|
|
1842
|
-
|
|
1843
|
-
|
|
1892
|
+
context.font = `${merged.fontStyle} ${merged.fontWeight} ${merged.size}px ${merged.font}`;
|
|
1893
|
+
const w = context.measureText(name).width;
|
|
1894
|
+
const h = merged.size;
|
|
1844
1895
|
x = x - w / 2;
|
|
1845
1896
|
return collisions.isCollision(x, y, w, h);
|
|
1846
1897
|
}
|
|
@@ -1850,13 +1901,13 @@ class VectorTileRenderer {
|
|
|
1850
1901
|
drawText(coordinate, name, boundaries, style, context, collisions) {
|
|
1851
1902
|
var merged = { ...VectorTileRenderer.DEFAULT_STYLE.TEXT, ...style };
|
|
1852
1903
|
var x = Math.round(
|
|
1853
|
-
|
|
1904
|
+
VECTOR_TILE_SIZE * (coordinate[0] - boundaries.min.lon) / (boundaries.max.lon - boundaries.min.lon)
|
|
1854
1905
|
);
|
|
1855
1906
|
var y = Math.round(
|
|
1856
|
-
|
|
1907
|
+
VECTOR_TILE_SIZE * (coordinate[1] - boundaries.min.lat) / (boundaries.max.lat - boundaries.min.lat)
|
|
1857
1908
|
);
|
|
1858
1909
|
context.globalAlpha = merged.opacity;
|
|
1859
|
-
context.font = merged.fontStyle
|
|
1910
|
+
context.font = `${merged.fontStyle} ${merged.fontWeight} ${merged.size}px ${merged.font}`;
|
|
1860
1911
|
var w = context.measureText(name).width;
|
|
1861
1912
|
var h = merged.size;
|
|
1862
1913
|
x = x - w / 2;
|
|
@@ -1897,7 +1948,7 @@ class VectorTileRenderer {
|
|
|
1897
1948
|
let text = this._styles.renderers[renderer][i].text;
|
|
1898
1949
|
if (text) {
|
|
1899
1950
|
let merged = { ...VectorTileRenderer.DEFAULT_STYLE.TEXT, ...text };
|
|
1900
|
-
let font =
|
|
1951
|
+
let font = `${merged.fontStyle} ${merged.fontWeight} ${merged.size}px ${merged.font}`.trim();
|
|
1901
1952
|
result.push(font);
|
|
1902
1953
|
}
|
|
1903
1954
|
}
|
|
@@ -1946,21 +1997,6 @@ class VectorTileRenderer {
|
|
|
1946
1997
|
};
|
|
1947
1998
|
}
|
|
1948
1999
|
|
|
1949
|
-
const URL_TEMPLATE = "https://v${index}.maptrip.de/?tilex=${x}&tiley=${y}&acao=true&context=tomtom${z}&project=${project}&projection=wgs84";
|
|
1950
|
-
const PROVIDER_PROJECTS = {
|
|
1951
|
-
tomtom: "TomTom_latest",
|
|
1952
|
-
here: "HERE_latest",
|
|
1953
|
-
openstreetmap: "OSM_latest"
|
|
1954
|
-
};
|
|
1955
|
-
const PROVIDER_TRAFFIC = {
|
|
1956
|
-
tomtom: "https://v0.maptrip.de/tiles?project=TrafficMobileTomTom_EUROPE&tilex=${x}&tiley=${y}&acao=true&context=traffic${z}&projection=wgs84",
|
|
1957
|
-
here: "https://v0.maptrip.de/tiles?project=TrafficMobileHere_EUROPE&tilex=${x}&tiley=${y}&acao=true&context=traffic${z}&projection=wgs84",
|
|
1958
|
-
openstreetmap: null
|
|
1959
|
-
};
|
|
1960
|
-
const MIN_ZOOM = 2;
|
|
1961
|
-
const MAX_ZOOM = 18;
|
|
1962
|
-
const ATTRIBUTION = '© <a href="https://maptrip.de/" target="_blank">infoware GmbH</a>';
|
|
1963
|
-
|
|
1964
2000
|
var webfontloader = {exports: {}};
|
|
1965
2001
|
|
|
1966
2002
|
/* Web Font Loader v1.6.28 - (c) Adobe Systems, Google. License: Apache 2.0 */
|
|
@@ -2212,7 +2248,7 @@ const RENDERING_CONFIG_DEFAULT = {
|
|
|
2212
2248
|
from: 1,
|
|
2213
2249
|
to: 19,
|
|
2214
2250
|
polygon: {
|
|
2215
|
-
color: "
|
|
2251
|
+
color: "rgba(0, 0, 0, 0.05)"
|
|
2216
2252
|
}
|
|
2217
2253
|
}
|
|
2218
2254
|
],
|
|
@@ -2765,7 +2801,9 @@ const RENDERING_CONFIG_DEFAULT = {
|
|
|
2765
2801
|
to: 19,
|
|
2766
2802
|
line: {
|
|
2767
2803
|
width: 7,
|
|
2768
|
-
color: "#ffffff"
|
|
2804
|
+
color: "#ffffff",
|
|
2805
|
+
outlineColor: "#cccccc",
|
|
2806
|
+
outlineWidth: 1
|
|
2769
2807
|
},
|
|
2770
2808
|
text: {
|
|
2771
2809
|
size: 12,
|
|
@@ -2804,13 +2842,12 @@ const RENDERING_CONFIG_DEFAULT = {
|
|
|
2804
2842
|
from: 17,
|
|
2805
2843
|
to: 19,
|
|
2806
2844
|
line: {
|
|
2807
|
-
width:
|
|
2845
|
+
width: 7,
|
|
2808
2846
|
color: "#ffffff",
|
|
2809
2847
|
url: "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48c3ZnIHZlcnNpb249IjEuMSIgaWQ9ImFycm93IiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMTAgNiIgd2lkdGg9IjEwIiBoZWlnaHQ9IjYiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDEwIDY7IiB4bWw6c3BhY2U9InByZXNlcnZlIj48c3R5bGUgdHlwZT0idGV4dC9jc3MiPi5zdDB7ZmlsbDpub25lO3N0cm9rZTojOUI5QTlBO308L3N0eWxlPjxwb2x5bGluZSBjbGFzcz0ic3QwIiBwb2ludHM9IjUuOSw1LjEgOS4xLDMgNS45LDAuOSIvPjxsaW5lIGNsYXNzPSJzdDAiIHgxPSI5LjEiIHkxPSIzIiB4Mj0iMC45IiB5Mj0iMyIvPjwvc3ZnPg==",
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
direction: "forward"
|
|
2848
|
+
direction: "forward",
|
|
2849
|
+
outlineColor: "#cccccc",
|
|
2850
|
+
outlineWidth: 1
|
|
2814
2851
|
},
|
|
2815
2852
|
text: {
|
|
2816
2853
|
size: 12,
|
|
@@ -2849,13 +2886,12 @@ const RENDERING_CONFIG_DEFAULT = {
|
|
|
2849
2886
|
from: 17,
|
|
2850
2887
|
to: 19,
|
|
2851
2888
|
line: {
|
|
2852
|
-
width:
|
|
2889
|
+
width: 7,
|
|
2853
2890
|
color: "#ffffff",
|
|
2854
2891
|
url: "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48c3ZnIHZlcnNpb249IjEuMSIgaWQ9ImFycm93IiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMTAgNiIgd2lkdGg9IjEwIiBoZWlnaHQ9IjYiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDEwIDY7IiB4bWw6c3BhY2U9InByZXNlcnZlIj48c3R5bGUgdHlwZT0idGV4dC9jc3MiPi5zdDB7ZmlsbDpub25lO3N0cm9rZTojOUI5QTlBO308L3N0eWxlPjxwb2x5bGluZSBjbGFzcz0ic3QwIiBwb2ludHM9IjUuOSw1LjEgOS4xLDMgNS45LDAuOSIvPjxsaW5lIGNsYXNzPSJzdDAiIHgxPSI5LjEiIHkxPSIzIiB4Mj0iMC45IiB5Mj0iMyIvPjwvc3ZnPg==",
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
direction: "reverse"
|
|
2892
|
+
direction: "reverse",
|
|
2893
|
+
outlineColor: "#cccccc",
|
|
2894
|
+
outlineWidth: 1
|
|
2859
2895
|
},
|
|
2860
2896
|
text: {
|
|
2861
2897
|
size: 12,
|
|
@@ -2895,7 +2931,7 @@ const RENDERING_CONFIG_DEFAULT = {
|
|
|
2895
2931
|
to: 19,
|
|
2896
2932
|
line: {
|
|
2897
2933
|
width: 2,
|
|
2898
|
-
color: "#
|
|
2934
|
+
color: "#B0B9C4"
|
|
2899
2935
|
},
|
|
2900
2936
|
text: {
|
|
2901
2937
|
size: 12,
|
|
@@ -2910,7 +2946,7 @@ const RENDERING_CONFIG_DEFAULT = {
|
|
|
2910
2946
|
to: 16,
|
|
2911
2947
|
line: {
|
|
2912
2948
|
width: 1,
|
|
2913
|
-
color: "#
|
|
2949
|
+
color: "#B0B9C4"
|
|
2914
2950
|
},
|
|
2915
2951
|
text: {
|
|
2916
2952
|
size: 12,
|
|
@@ -2925,7 +2961,7 @@ const RENDERING_CONFIG_DEFAULT = {
|
|
|
2925
2961
|
to: 14,
|
|
2926
2962
|
line: {
|
|
2927
2963
|
width: 1,
|
|
2928
|
-
color: "#
|
|
2964
|
+
color: "#B0B9C4"
|
|
2929
2965
|
}
|
|
2930
2966
|
}
|
|
2931
2967
|
],
|
|
@@ -2934,7 +2970,7 @@ const RENDERING_CONFIG_DEFAULT = {
|
|
|
2934
2970
|
from: 17,
|
|
2935
2971
|
to: 19,
|
|
2936
2972
|
line: {
|
|
2937
|
-
width:
|
|
2973
|
+
width: 3,
|
|
2938
2974
|
color: "#ffffff"
|
|
2939
2975
|
},
|
|
2940
2976
|
text: {
|
|
@@ -2966,12 +3002,9 @@ const RENDERING_CONFIG_DEFAULT = {
|
|
|
2966
3002
|
from: 17,
|
|
2967
3003
|
to: 19,
|
|
2968
3004
|
line: {
|
|
2969
|
-
width:
|
|
3005
|
+
width: 3,
|
|
2970
3006
|
color: "#ffffff",
|
|
2971
3007
|
url: "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48c3ZnIHZlcnNpb249IjEuMSIgaWQ9ImFycm93IiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMTAgNiIgd2lkdGg9IjEwIiBoZWlnaHQ9IjYiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDEwIDY7IiB4bWw6c3BhY2U9InByZXNlcnZlIj48c3R5bGUgdHlwZT0idGV4dC9jc3MiPi5zdDB7ZmlsbDpub25lO3N0cm9rZTojOUI5QTlBO308L3N0eWxlPjxwb2x5bGluZSBjbGFzcz0ic3QwIiBwb2ludHM9IjUuOSw1LjEgOS4xLDMgNS45LDAuOSIvPjxsaW5lIGNsYXNzPSJzdDAiIHgxPSI5LjEiIHkxPSIzIiB4Mj0iMC45IiB5Mj0iMyIvPjwvc3ZnPg==",
|
|
2972
|
-
height: 6,
|
|
2973
|
-
dx: -5,
|
|
2974
|
-
dy: -3,
|
|
2975
3008
|
direction: "forward"
|
|
2976
3009
|
},
|
|
2977
3010
|
text: {
|
|
@@ -3003,12 +3036,9 @@ const RENDERING_CONFIG_DEFAULT = {
|
|
|
3003
3036
|
from: 17,
|
|
3004
3037
|
to: 19,
|
|
3005
3038
|
line: {
|
|
3006
|
-
width:
|
|
3039
|
+
width: 3,
|
|
3007
3040
|
color: "#ffffff",
|
|
3008
3041
|
url: "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48c3ZnIHZlcnNpb249IjEuMSIgaWQ9ImFycm93IiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMTAgNiIgd2lkdGg9IjEwIiBoZWlnaHQ9IjYiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDEwIDY7IiB4bWw6c3BhY2U9InByZXNlcnZlIj48c3R5bGUgdHlwZT0idGV4dC9jc3MiPi5zdDB7ZmlsbDpub25lO3N0cm9rZTojOUI5QTlBO308L3N0eWxlPjxwb2x5bGluZSBjbGFzcz0ic3QwIiBwb2ludHM9IjUuOSw1LjEgOS4xLDMgNS45LDAuOSIvPjxsaW5lIGNsYXNzPSJzdDAiIHgxPSI5LjEiIHkxPSIzIiB4Mj0iMC45IiB5Mj0iMyIvPjwvc3ZnPg==",
|
|
3009
|
-
height: 6,
|
|
3010
|
-
dx: -5,
|
|
3011
|
-
dy: -3,
|
|
3012
3042
|
direction: "reverse"
|
|
3013
3043
|
},
|
|
3014
3044
|
text: {
|
|
@@ -3042,7 +3072,7 @@ const RENDERING_CONFIG_DEFAULT = {
|
|
|
3042
3072
|
line: {
|
|
3043
3073
|
width: 2,
|
|
3044
3074
|
color: "rgba(1, 1, 1, 0)",
|
|
3045
|
-
dashColor: "#
|
|
3075
|
+
dashColor: "#B0B9C4",
|
|
3046
3076
|
dashLength: 6
|
|
3047
3077
|
},
|
|
3048
3078
|
text: {
|
|
@@ -3056,11 +3086,22 @@ const RENDERING_CONFIG_DEFAULT = {
|
|
|
3056
3086
|
],
|
|
3057
3087
|
rail: [
|
|
3058
3088
|
{
|
|
3059
|
-
from:
|
|
3089
|
+
from: 16,
|
|
3060
3090
|
to: 19,
|
|
3091
|
+
line: {
|
|
3092
|
+
width: 2,
|
|
3093
|
+
color: "#8B8C8C",
|
|
3094
|
+
dashColor: "#FAFAFA",
|
|
3095
|
+
dashLength: 10
|
|
3096
|
+
}
|
|
3097
|
+
},
|
|
3098
|
+
{
|
|
3099
|
+
from: 12,
|
|
3100
|
+
to: 15,
|
|
3061
3101
|
line: {
|
|
3062
3102
|
width: 1,
|
|
3063
|
-
color: "#
|
|
3103
|
+
color: "#8B8C8C",
|
|
3104
|
+
dashLength: 10
|
|
3064
3105
|
}
|
|
3065
3106
|
}
|
|
3066
3107
|
],
|
|
@@ -3069,7 +3110,7 @@ const RENDERING_CONFIG_DEFAULT = {
|
|
|
3069
3110
|
from: 17,
|
|
3070
3111
|
to: 19,
|
|
3071
3112
|
line: {
|
|
3072
|
-
width:
|
|
3113
|
+
width: 3,
|
|
3073
3114
|
color: "#74a8e1"
|
|
3074
3115
|
},
|
|
3075
3116
|
text: {
|
|
@@ -3084,7 +3125,7 @@ const RENDERING_CONFIG_DEFAULT = {
|
|
|
3084
3125
|
from: 14,
|
|
3085
3126
|
to: 16,
|
|
3086
3127
|
line: {
|
|
3087
|
-
width:
|
|
3128
|
+
width: 2,
|
|
3088
3129
|
color: "#74a8e1"
|
|
3089
3130
|
},
|
|
3090
3131
|
text: {
|
|
@@ -3099,7 +3140,7 @@ const RENDERING_CONFIG_DEFAULT = {
|
|
|
3099
3140
|
from: 10,
|
|
3100
3141
|
to: 13,
|
|
3101
3142
|
line: {
|
|
3102
|
-
width:
|
|
3143
|
+
width: 1,
|
|
3103
3144
|
color: "#74a8e1"
|
|
3104
3145
|
}
|
|
3105
3146
|
}
|
|
@@ -3333,13 +3374,54 @@ class VectorTileFactory {
|
|
|
3333
3374
|
return RENDERING_CONFIG_TRAFFIC;
|
|
3334
3375
|
}
|
|
3335
3376
|
}
|
|
3377
|
+
createCanvas(size, padding) {
|
|
3378
|
+
let canvas = document.createElement("canvas");
|
|
3379
|
+
const paddedTileSize = size + 2 * padding;
|
|
3380
|
+
canvas.width = paddedTileSize;
|
|
3381
|
+
canvas.height = paddedTileSize;
|
|
3382
|
+
canvas.style.width = paddedTileSize + "px";
|
|
3383
|
+
canvas.style.height = paddedTileSize + "px";
|
|
3384
|
+
canvas.style.maxWidth = paddedTileSize + "px";
|
|
3385
|
+
canvas.style.maxHeight = paddedTileSize + "px";
|
|
3386
|
+
canvas.style.left = -padding + "px";
|
|
3387
|
+
canvas.style.top = -padding + "px";
|
|
3388
|
+
const context = canvas.getContext("2d");
|
|
3389
|
+
if (!context) {
|
|
3390
|
+
throw new Error("Failed to create canvas");
|
|
3391
|
+
}
|
|
3392
|
+
if (typeof context.setTransform === "function") {
|
|
3393
|
+
context.setTransform(1, 0, 0, 1, padding, padding);
|
|
3394
|
+
} else {
|
|
3395
|
+
context.translate(padding, padding);
|
|
3396
|
+
}
|
|
3397
|
+
return canvas;
|
|
3398
|
+
}
|
|
3399
|
+
cropCanvas(source, target) {
|
|
3400
|
+
const ctx = target.getContext("2d");
|
|
3401
|
+
if (ctx) {
|
|
3402
|
+
ctx.drawImage(
|
|
3403
|
+
source,
|
|
3404
|
+
VECTOR_TILE_RENDER_PADDING,
|
|
3405
|
+
VECTOR_TILE_RENDER_PADDING,
|
|
3406
|
+
// position in source
|
|
3407
|
+
VECTOR_TILE_SIZE,
|
|
3408
|
+
VECTOR_TILE_SIZE,
|
|
3409
|
+
// size in source
|
|
3410
|
+
0,
|
|
3411
|
+
0,
|
|
3412
|
+
// position in target
|
|
3413
|
+
VECTOR_TILE_SIZE,
|
|
3414
|
+
VECTOR_TILE_SIZE
|
|
3415
|
+
// size in target
|
|
3416
|
+
);
|
|
3417
|
+
}
|
|
3418
|
+
}
|
|
3336
3419
|
getJsonTile(z, x, y, token, callback) {
|
|
3337
3420
|
let maximumIndex = Math.pow(2, z);
|
|
3338
3421
|
x = (x + 16 * maximumIndex) % maximumIndex;
|
|
3339
3422
|
y = (y + 16 * maximumIndex) % maximumIndex;
|
|
3340
|
-
let
|
|
3341
|
-
|
|
3342
|
-
canvas.height = 256;
|
|
3423
|
+
let resultCanvas = this.createCanvas(VECTOR_TILE_SIZE, 0);
|
|
3424
|
+
let tempCanvas = this.createCanvas(VECTOR_TILE_SIZE, VECTOR_TILE_RENDER_PADDING);
|
|
3343
3425
|
let baseMapUrl = this.resolveTileUrl(z, x, y);
|
|
3344
3426
|
let urls = baseMapUrl ? [baseMapUrl] : [];
|
|
3345
3427
|
this._additionalUrls.forEach((it) => {
|
|
@@ -3348,13 +3430,14 @@ class VectorTileFactory {
|
|
|
3348
3430
|
);
|
|
3349
3431
|
});
|
|
3350
3432
|
let tileLoadedSuccessfullyCallback = (json) => {
|
|
3351
|
-
this.drawTile(json, z, x, y,
|
|
3433
|
+
this.drawTile(json, z, x, y, tempCanvas);
|
|
3434
|
+
this.cropCanvas(tempCanvas, resultCanvas);
|
|
3352
3435
|
if (callback) {
|
|
3353
|
-
callback(
|
|
3436
|
+
callback(resultCanvas);
|
|
3354
3437
|
}
|
|
3355
3438
|
};
|
|
3356
3439
|
let tile_FailedCallback = () => {
|
|
3357
|
-
this.drawErroredTile(
|
|
3440
|
+
this.drawErroredTile(resultCanvas);
|
|
3358
3441
|
if (callback) {
|
|
3359
3442
|
callback(null);
|
|
3360
3443
|
}
|
|
@@ -3367,7 +3450,7 @@ class VectorTileFactory {
|
|
|
3367
3450
|
if (VectorTileFactory._fonts === "active") {
|
|
3368
3451
|
this._tileLoader.loadNext();
|
|
3369
3452
|
}
|
|
3370
|
-
return
|
|
3453
|
+
return resultCanvas;
|
|
3371
3454
|
}
|
|
3372
3455
|
/**
|
|
3373
3456
|
* @private
|
|
@@ -3674,7 +3757,7 @@ const RENDERING_CONFIG_GRAYSCALE = {
|
|
|
3674
3757
|
from: 1,
|
|
3675
3758
|
to: 19,
|
|
3676
3759
|
polygon: {
|
|
3677
|
-
color: "
|
|
3760
|
+
color: "rgba(0, 0, 0, 0.05)"
|
|
3678
3761
|
}
|
|
3679
3762
|
}
|
|
3680
3763
|
],
|
|
@@ -3731,7 +3814,7 @@ const RENDERING_CONFIG_GRAYSCALE = {
|
|
|
3731
3814
|
width: 1
|
|
3732
3815
|
},
|
|
3733
3816
|
polygon: {
|
|
3734
|
-
color: "#
|
|
3817
|
+
color: "#BBC5CF"
|
|
3735
3818
|
},
|
|
3736
3819
|
text: {
|
|
3737
3820
|
size: 14,
|
|
@@ -4227,7 +4310,9 @@ const RENDERING_CONFIG_GRAYSCALE = {
|
|
|
4227
4310
|
to: 19,
|
|
4228
4311
|
line: {
|
|
4229
4312
|
width: 7,
|
|
4230
|
-
color: "#ffffff"
|
|
4313
|
+
color: "#ffffff",
|
|
4314
|
+
outlineColor: "#cccccc",
|
|
4315
|
+
outlineWidth: 1
|
|
4231
4316
|
},
|
|
4232
4317
|
text: {
|
|
4233
4318
|
size: 12,
|
|
@@ -4266,13 +4351,12 @@ const RENDERING_CONFIG_GRAYSCALE = {
|
|
|
4266
4351
|
from: 17,
|
|
4267
4352
|
to: 19,
|
|
4268
4353
|
line: {
|
|
4269
|
-
width:
|
|
4354
|
+
width: 7,
|
|
4270
4355
|
color: "#ffffff",
|
|
4271
4356
|
url: "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48c3ZnIHZlcnNpb249IjEuMSIgaWQ9ImFycm93IiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMTAgNiIgd2lkdGg9IjEwIiBoZWlnaHQ9IjYiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDEwIDY7IiB4bWw6c3BhY2U9InByZXNlcnZlIj48c3R5bGUgdHlwZT0idGV4dC9jc3MiPi5zdDB7ZmlsbDpub25lO3N0cm9rZTojOUI5QTlBO308L3N0eWxlPjxwb2x5bGluZSBjbGFzcz0ic3QwIiBwb2ludHM9IjUuOSw1LjEgOS4xLDMgNS45LDAuOSIvPjxsaW5lIGNsYXNzPSJzdDAiIHgxPSI5LjEiIHkxPSIzIiB4Mj0iMC45IiB5Mj0iMyIvPjwvc3ZnPg==",
|
|
4272
|
-
|
|
4273
|
-
|
|
4274
|
-
|
|
4275
|
-
direction: "forward"
|
|
4357
|
+
direction: "forward",
|
|
4358
|
+
outlineColor: "#cccccc",
|
|
4359
|
+
outlineWidth: 1
|
|
4276
4360
|
},
|
|
4277
4361
|
text: {
|
|
4278
4362
|
size: 12,
|
|
@@ -4311,13 +4395,12 @@ const RENDERING_CONFIG_GRAYSCALE = {
|
|
|
4311
4395
|
from: 17,
|
|
4312
4396
|
to: 19,
|
|
4313
4397
|
line: {
|
|
4314
|
-
width:
|
|
4398
|
+
width: 7,
|
|
4315
4399
|
color: "#ffffff",
|
|
4316
4400
|
url: "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48c3ZnIHZlcnNpb249IjEuMSIgaWQ9ImFycm93IiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMTAgNiIgd2lkdGg9IjEwIiBoZWlnaHQ9IjYiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDEwIDY7IiB4bWw6c3BhY2U9InByZXNlcnZlIj48c3R5bGUgdHlwZT0idGV4dC9jc3MiPi5zdDB7ZmlsbDpub25lO3N0cm9rZTojOUI5QTlBO308L3N0eWxlPjxwb2x5bGluZSBjbGFzcz0ic3QwIiBwb2ludHM9IjUuOSw1LjEgOS4xLDMgNS45LDAuOSIvPjxsaW5lIGNsYXNzPSJzdDAiIHgxPSI5LjEiIHkxPSIzIiB4Mj0iMC45IiB5Mj0iMyIvPjwvc3ZnPg==",
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
|
|
4320
|
-
direction: "reverse"
|
|
4401
|
+
direction: "reverse",
|
|
4402
|
+
outlineColor: "#cccccc",
|
|
4403
|
+
outlineWidth: 1
|
|
4321
4404
|
},
|
|
4322
4405
|
text: {
|
|
4323
4406
|
size: 12,
|
|
@@ -4356,7 +4439,7 @@ const RENDERING_CONFIG_GRAYSCALE = {
|
|
|
4356
4439
|
from: 17,
|
|
4357
4440
|
to: 19,
|
|
4358
4441
|
line: {
|
|
4359
|
-
width:
|
|
4442
|
+
width: 2,
|
|
4360
4443
|
color: "#cccccc"
|
|
4361
4444
|
},
|
|
4362
4445
|
text: {
|
|
@@ -4394,7 +4477,7 @@ const RENDERING_CONFIG_GRAYSCALE = {
|
|
|
4394
4477
|
from: 17,
|
|
4395
4478
|
to: 19,
|
|
4396
4479
|
line: {
|
|
4397
|
-
width:
|
|
4480
|
+
width: 3,
|
|
4398
4481
|
color: "#ffffff"
|
|
4399
4482
|
},
|
|
4400
4483
|
text: {
|
|
@@ -4426,12 +4509,9 @@ const RENDERING_CONFIG_GRAYSCALE = {
|
|
|
4426
4509
|
from: 17,
|
|
4427
4510
|
to: 19,
|
|
4428
4511
|
line: {
|
|
4429
|
-
width:
|
|
4512
|
+
width: 3,
|
|
4430
4513
|
color: "#ffffff",
|
|
4431
4514
|
url: "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48c3ZnIHZlcnNpb249IjEuMSIgaWQ9ImFycm93IiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMTAgNiIgd2lkdGg9IjEwIiBoZWlnaHQ9IjYiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDEwIDY7IiB4bWw6c3BhY2U9InByZXNlcnZlIj48c3R5bGUgdHlwZT0idGV4dC9jc3MiPi5zdDB7ZmlsbDpub25lO3N0cm9rZTojOUI5QTlBO308L3N0eWxlPjxwb2x5bGluZSBjbGFzcz0ic3QwIiBwb2ludHM9IjUuOSw1LjEgOS4xLDMgNS45LDAuOSIvPjxsaW5lIGNsYXNzPSJzdDAiIHgxPSI5LjEiIHkxPSIzIiB4Mj0iMC45IiB5Mj0iMyIvPjwvc3ZnPg==",
|
|
4432
|
-
height: 6,
|
|
4433
|
-
dx: -5,
|
|
4434
|
-
dy: -3,
|
|
4435
4515
|
direction: "forward"
|
|
4436
4516
|
},
|
|
4437
4517
|
text: {
|
|
@@ -4463,12 +4543,9 @@ const RENDERING_CONFIG_GRAYSCALE = {
|
|
|
4463
4543
|
from: 17,
|
|
4464
4544
|
to: 19,
|
|
4465
4545
|
line: {
|
|
4466
|
-
width:
|
|
4546
|
+
width: 3,
|
|
4467
4547
|
color: "#ffffff",
|
|
4468
4548
|
url: "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48c3ZnIHZlcnNpb249IjEuMSIgaWQ9ImFycm93IiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMTAgNiIgd2lkdGg9IjEwIiBoZWlnaHQ9IjYiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDEwIDY7IiB4bWw6c3BhY2U9InByZXNlcnZlIj48c3R5bGUgdHlwZT0idGV4dC9jc3MiPi5zdDB7ZmlsbDpub25lO3N0cm9rZTojOUI5QTlBO308L3N0eWxlPjxwb2x5bGluZSBjbGFzcz0ic3QwIiBwb2ludHM9IjUuOSw1LjEgOS4xLDMgNS45LDAuOSIvPjxsaW5lIGNsYXNzPSJzdDAiIHgxPSI5LjEiIHkxPSIzIiB4Mj0iMC45IiB5Mj0iMyIvPjwvc3ZnPg==",
|
|
4469
|
-
height: 6,
|
|
4470
|
-
dx: -5,
|
|
4471
|
-
dy: -3,
|
|
4472
4549
|
direction: "reverse"
|
|
4473
4550
|
},
|
|
4474
4551
|
text: {
|
|
@@ -4502,7 +4579,7 @@ const RENDERING_CONFIG_GRAYSCALE = {
|
|
|
4502
4579
|
line: {
|
|
4503
4580
|
width: 2,
|
|
4504
4581
|
color: "rgba(1, 1, 1, 0)",
|
|
4505
|
-
dashColor: "#
|
|
4582
|
+
dashColor: "#cccccc",
|
|
4506
4583
|
dashLength: 6
|
|
4507
4584
|
},
|
|
4508
4585
|
text: {
|
|
@@ -4516,11 +4593,22 @@ const RENDERING_CONFIG_GRAYSCALE = {
|
|
|
4516
4593
|
],
|
|
4517
4594
|
rail: [
|
|
4518
4595
|
{
|
|
4519
|
-
from:
|
|
4596
|
+
from: 16,
|
|
4520
4597
|
to: 19,
|
|
4598
|
+
line: {
|
|
4599
|
+
width: 2,
|
|
4600
|
+
color: "#8B8C8C",
|
|
4601
|
+
dashColor: "#FAFAFA",
|
|
4602
|
+
dashLength: 10
|
|
4603
|
+
}
|
|
4604
|
+
},
|
|
4605
|
+
{
|
|
4606
|
+
from: 12,
|
|
4607
|
+
to: 15,
|
|
4521
4608
|
line: {
|
|
4522
4609
|
width: 1,
|
|
4523
|
-
color: "#
|
|
4610
|
+
color: "#8B8C8C",
|
|
4611
|
+
dashLength: 10
|
|
4524
4612
|
}
|
|
4525
4613
|
}
|
|
4526
4614
|
],
|
|
@@ -4529,7 +4617,7 @@ const RENDERING_CONFIG_GRAYSCALE = {
|
|
|
4529
4617
|
from: 17,
|
|
4530
4618
|
to: 19,
|
|
4531
4619
|
line: {
|
|
4532
|
-
width:
|
|
4620
|
+
width: 3,
|
|
4533
4621
|
color: "#9e9e9e"
|
|
4534
4622
|
},
|
|
4535
4623
|
text: {
|
|
@@ -4544,7 +4632,7 @@ const RENDERING_CONFIG_GRAYSCALE = {
|
|
|
4544
4632
|
from: 14,
|
|
4545
4633
|
to: 16,
|
|
4546
4634
|
line: {
|
|
4547
|
-
width:
|
|
4635
|
+
width: 2,
|
|
4548
4636
|
color: "#9e9e9e"
|
|
4549
4637
|
},
|
|
4550
4638
|
text: {
|
|
@@ -4559,7 +4647,7 @@ const RENDERING_CONFIG_GRAYSCALE = {
|
|
|
4559
4647
|
from: 10,
|
|
4560
4648
|
to: 13,
|
|
4561
4649
|
line: {
|
|
4562
|
-
width:
|
|
4650
|
+
width: 1,
|
|
4563
4651
|
color: "#9e9e9e"
|
|
4564
4652
|
}
|
|
4565
4653
|
}
|
|
@@ -4588,6 +4676,7 @@ const RENDERING_CONFIG_GRAYSCALE = {
|
|
|
4588
4676
|
class MapReleaseFetcher {
|
|
4589
4677
|
_token;
|
|
4590
4678
|
_tomtom = null;
|
|
4679
|
+
_orbis = null;
|
|
4591
4680
|
_osm = null;
|
|
4592
4681
|
_here = null;
|
|
4593
4682
|
constructor(token) {
|
|
@@ -4597,24 +4686,31 @@ class MapReleaseFetcher {
|
|
|
4597
4686
|
if (provider === "tomtom") {
|
|
4598
4687
|
if (!this._tomtom) {
|
|
4599
4688
|
const url = "https://v1.maptrip.de/?CMD=GETFILE&PROJECT=TomTom_latest&RELATIVEPATH=/data/mapset/data/routing_geocoder/admin.bin&acao=true";
|
|
4600
|
-
this._tomtom = this.fetchAndExtractRelease(url);
|
|
4689
|
+
this._tomtom = this.fetchAndExtractRelease(provider, url);
|
|
4601
4690
|
}
|
|
4602
4691
|
return this._tomtom;
|
|
4692
|
+
}
|
|
4693
|
+
if (provider === "orbis") {
|
|
4694
|
+
if (!this._orbis) {
|
|
4695
|
+
const url = "https://v1.maptrip.de/?CMD=GETFILE&PROJECT=Orbis_latest&RELATIVEPATH=/data/mapset/data/routing_geocoder/admin.bin&acao=true";
|
|
4696
|
+
this._orbis = this.fetchAndExtractRelease(provider, url);
|
|
4697
|
+
}
|
|
4698
|
+
return this._orbis;
|
|
4603
4699
|
} else if (provider === "here") {
|
|
4604
4700
|
if (!this._here) {
|
|
4605
4701
|
const url = "https://v1.maptrip.de/?CMD=GETFILE&PROJECT=HERE_latest&RELATIVEPATH=/data/mapset/data/routing_geocoder/admin.bin&acao=true";
|
|
4606
|
-
this._here = this.fetchAndExtractRelease(url);
|
|
4702
|
+
this._here = this.fetchAndExtractRelease(provider, url);
|
|
4607
4703
|
}
|
|
4608
4704
|
return this._here;
|
|
4609
4705
|
} else if (provider === "openstreetmap") {
|
|
4610
4706
|
if (!this._osm) {
|
|
4611
4707
|
const url = "https://v1.maptrip.de/?CMD=GETFILE&PROJECT=OSM_latest&RELATIVEPATH=/data/mapset/data/routing_geocoder/admin.bin&acao=true";
|
|
4612
|
-
this._osm = this.fetchAndExtractRelease(url);
|
|
4708
|
+
this._osm = this.fetchAndExtractRelease(provider, url);
|
|
4613
4709
|
}
|
|
4614
4710
|
return this._osm;
|
|
4615
4711
|
}
|
|
4616
4712
|
}
|
|
4617
|
-
async fetchAndExtractRelease(url) {
|
|
4713
|
+
async fetchAndExtractRelease(provider, url) {
|
|
4618
4714
|
return new Promise((resolve, reject) => {
|
|
4619
4715
|
var xhr = new XMLHttpRequest();
|
|
4620
4716
|
xhr.onreadystatechange = () => {
|
|
@@ -4623,7 +4719,7 @@ class MapReleaseFetcher {
|
|
|
4623
4719
|
const text = new TextDecoder("latin1").decode(xhr.response);
|
|
4624
4720
|
const textString = this.extractTargetString(text);
|
|
4625
4721
|
const formattedString = textString.split("Q").join(" Q");
|
|
4626
|
-
const release = ` ${formattedString}`;
|
|
4722
|
+
const release = ` ${PROVIDER_NAMES[provider]} ${formattedString}`;
|
|
4627
4723
|
resolve(release);
|
|
4628
4724
|
} else {
|
|
4629
4725
|
reject(`Error fetching: ${xhr.status}`);
|
|
@@ -19264,10 +19360,12 @@ class MapTripLeafletGridLayer extends L$1.GridLayer {
|
|
|
19264
19360
|
const eventProvider = event.layer.options.provider;
|
|
19265
19361
|
let newProvider;
|
|
19266
19362
|
if (eventProvider) {
|
|
19267
|
-
if (eventProvider.toLowerCase() === "
|
|
19363
|
+
if (eventProvider.toLowerCase() === "openstreetmap") {
|
|
19268
19364
|
newProvider = "openstreetmap";
|
|
19269
19365
|
} else if (eventProvider.toLowerCase() === "tomtom") {
|
|
19270
19366
|
newProvider = "tomtom";
|
|
19367
|
+
} else if (eventProvider.toLowerCase() === "orbis") {
|
|
19368
|
+
newProvider = "orbis";
|
|
19271
19369
|
} else if (eventProvider.toLowerCase() === "here") {
|
|
19272
19370
|
newProvider = "here";
|
|
19273
19371
|
} else {
|
|
@@ -21941,7 +22039,7 @@ function getPointResolution(projection, resolution, point, units) {
|
|
|
21941
22039
|
pointResolution = getter(resolution, point);
|
|
21942
22040
|
} else {
|
|
21943
22041
|
const projUnits = projection.getUnits();
|
|
21944
|
-
if ((projUnits == 'degrees' &&
|
|
22042
|
+
if ((projUnits == 'degrees' && !units) || units == 'degrees') {
|
|
21945
22043
|
pointResolution = resolution;
|
|
21946
22044
|
} else {
|
|
21947
22045
|
// Estimate point resolution by transforming the center pixel to EPSG:4326,
|