@maptiler/client 2.6.0-rc.1 → 2.6.0-rc.2
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/CHANGELOG.md +1 -1
- package/dist/maptiler-client.cjs +100 -54
- package/dist/maptiler-client.cjs.map +1 -1
- package/dist/maptiler-client.d.ts +50 -21
- package/dist/maptiler-client.min.mjs +1 -1
- package/dist/maptiler-client.mjs +100 -54
- package/dist/maptiler-client.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/maptiler-client.cjs
CHANGED
|
@@ -1463,35 +1463,14 @@ class ReferenceMapStyle {
|
|
|
1463
1463
|
}
|
|
1464
1464
|
const mapStylePresetList = [
|
|
1465
1465
|
{
|
|
1466
|
-
referenceStyleID: "
|
|
1466
|
+
referenceStyleID: "STREETS_V2",
|
|
1467
1467
|
name: "Streets",
|
|
1468
1468
|
description: "",
|
|
1469
1469
|
variants: [
|
|
1470
|
-
{
|
|
1471
|
-
id: "streets-v4",
|
|
1472
|
-
name: "Default",
|
|
1473
|
-
variantType: "DEFAULT",
|
|
1474
|
-
description: "",
|
|
1475
|
-
imageURL: ""
|
|
1476
|
-
},
|
|
1477
|
-
{
|
|
1478
|
-
id: "streets-v4-dark",
|
|
1479
|
-
name: "Dark",
|
|
1480
|
-
variantType: "DARK",
|
|
1481
|
-
description: "",
|
|
1482
|
-
imageURL: ""
|
|
1483
|
-
},
|
|
1484
|
-
{
|
|
1485
|
-
id: "streets-v4-pastel",
|
|
1486
|
-
name: "Pastel",
|
|
1487
|
-
variantType: "PASTEL",
|
|
1488
|
-
description: "",
|
|
1489
|
-
imageURL: ""
|
|
1490
|
-
},
|
|
1491
1470
|
{
|
|
1492
1471
|
id: "streets-v2",
|
|
1493
1472
|
name: "Default v2",
|
|
1494
|
-
variantType: "
|
|
1473
|
+
variantType: "DEFAULT",
|
|
1495
1474
|
description: "",
|
|
1496
1475
|
imageURL: "",
|
|
1497
1476
|
deprecated: true,
|
|
@@ -1500,7 +1479,7 @@ const mapStylePresetList = [
|
|
|
1500
1479
|
{
|
|
1501
1480
|
id: "streets-v2-dark",
|
|
1502
1481
|
name: "Dark v2",
|
|
1503
|
-
variantType: "
|
|
1482
|
+
variantType: "DARK",
|
|
1504
1483
|
description: "",
|
|
1505
1484
|
imageURL: "",
|
|
1506
1485
|
deprecated: true,
|
|
@@ -1509,7 +1488,7 @@ const mapStylePresetList = [
|
|
|
1509
1488
|
{
|
|
1510
1489
|
id: "streets-v2-light",
|
|
1511
1490
|
name: "Light v2",
|
|
1512
|
-
variantType: "
|
|
1491
|
+
variantType: "LIGHT",
|
|
1513
1492
|
description: "",
|
|
1514
1493
|
imageURL: "",
|
|
1515
1494
|
deprecated: true,
|
|
@@ -1518,7 +1497,7 @@ const mapStylePresetList = [
|
|
|
1518
1497
|
{
|
|
1519
1498
|
id: "streets-v2-night",
|
|
1520
1499
|
name: "Night v2",
|
|
1521
|
-
variantType: "
|
|
1500
|
+
variantType: "NIGHT",
|
|
1522
1501
|
description: "",
|
|
1523
1502
|
imageURL: "",
|
|
1524
1503
|
deprecated: true,
|
|
@@ -1527,7 +1506,7 @@ const mapStylePresetList = [
|
|
|
1527
1506
|
{
|
|
1528
1507
|
id: "streets-v2-pastel",
|
|
1529
1508
|
name: "Pastel v2",
|
|
1530
|
-
variantType: "
|
|
1509
|
+
variantType: "PASTEL",
|
|
1531
1510
|
description: "",
|
|
1532
1511
|
imageURL: "",
|
|
1533
1512
|
deprecated: true,
|
|
@@ -1536,7 +1515,35 @@ const mapStylePresetList = [
|
|
|
1536
1515
|
]
|
|
1537
1516
|
},
|
|
1538
1517
|
{
|
|
1539
|
-
referenceStyleID: "
|
|
1518
|
+
referenceStyleID: "STREETS_V4",
|
|
1519
|
+
name: "Streets",
|
|
1520
|
+
description: "",
|
|
1521
|
+
variants: [
|
|
1522
|
+
{
|
|
1523
|
+
id: "streets-v4",
|
|
1524
|
+
name: "Default",
|
|
1525
|
+
variantType: "DEFAULT",
|
|
1526
|
+
description: "",
|
|
1527
|
+
imageURL: ""
|
|
1528
|
+
},
|
|
1529
|
+
{
|
|
1530
|
+
id: "streets-v4-dark",
|
|
1531
|
+
name: "Dark",
|
|
1532
|
+
variantType: "DARK",
|
|
1533
|
+
description: "",
|
|
1534
|
+
imageURL: ""
|
|
1535
|
+
},
|
|
1536
|
+
{
|
|
1537
|
+
id: "streets-v4-pastel",
|
|
1538
|
+
name: "Pastel",
|
|
1539
|
+
variantType: "PASTEL",
|
|
1540
|
+
description: "",
|
|
1541
|
+
imageURL: ""
|
|
1542
|
+
}
|
|
1543
|
+
]
|
|
1544
|
+
},
|
|
1545
|
+
{
|
|
1546
|
+
referenceStyleID: "BASE_V4",
|
|
1540
1547
|
name: "Base",
|
|
1541
1548
|
description: "",
|
|
1542
1549
|
variants: [
|
|
@@ -1563,7 +1570,7 @@ const mapStylePresetList = [
|
|
|
1563
1570
|
},
|
|
1564
1571
|
{
|
|
1565
1572
|
id: "base-v4-ai",
|
|
1566
|
-
name: "
|
|
1573
|
+
name: "Base AI",
|
|
1567
1574
|
variantType: "NIGHT",
|
|
1568
1575
|
description: "",
|
|
1569
1576
|
imageURL: ""
|
|
@@ -1641,7 +1648,7 @@ const mapStylePresetList = [
|
|
|
1641
1648
|
]
|
|
1642
1649
|
},
|
|
1643
1650
|
{
|
|
1644
|
-
referenceStyleID: "
|
|
1651
|
+
referenceStyleID: "BASIC_V2",
|
|
1645
1652
|
name: "Basic",
|
|
1646
1653
|
description: "",
|
|
1647
1654
|
variants: [
|
|
@@ -1650,7 +1657,9 @@ const mapStylePresetList = [
|
|
|
1650
1657
|
name: "Default",
|
|
1651
1658
|
variantType: "DEFAULT",
|
|
1652
1659
|
description: "",
|
|
1653
|
-
imageURL: ""
|
|
1660
|
+
imageURL: "",
|
|
1661
|
+
deprecated: true,
|
|
1662
|
+
deprecationMessage: `"basic-v2" is deprecated, use "basic-v4" instead`
|
|
1654
1663
|
},
|
|
1655
1664
|
{
|
|
1656
1665
|
id: "basic-v2-dark",
|
|
@@ -1935,61 +1944,98 @@ const mapStylePresetList = [
|
|
|
1935
1944
|
]
|
|
1936
1945
|
},
|
|
1937
1946
|
{
|
|
1938
|
-
referenceStyleID: "
|
|
1947
|
+
referenceStyleID: "LANDSCAPE_V2",
|
|
1939
1948
|
name: "Landscape",
|
|
1940
1949
|
description: "Terrain map for data overlays and visualisations",
|
|
1941
1950
|
variants: [
|
|
1942
1951
|
{
|
|
1943
|
-
id: "landscape
|
|
1952
|
+
id: "landscape",
|
|
1944
1953
|
name: "Default",
|
|
1945
1954
|
variantType: "DEFAULT",
|
|
1946
1955
|
description: "",
|
|
1947
|
-
imageURL: ""
|
|
1956
|
+
imageURL: "",
|
|
1957
|
+
deprecated: true,
|
|
1958
|
+
deprecationMessage: `"landscape" is deprecated, use "landscape-v4" instead`
|
|
1948
1959
|
},
|
|
1949
1960
|
{
|
|
1950
|
-
id: "landscape-
|
|
1961
|
+
id: "landscape-dark",
|
|
1951
1962
|
name: "Dark",
|
|
1952
1963
|
variantType: "DARK",
|
|
1953
1964
|
description: "",
|
|
1954
|
-
imageURL: ""
|
|
1965
|
+
imageURL: "",
|
|
1966
|
+
deprecated: true,
|
|
1967
|
+
deprecationMessage: `"landscape-dark" is deprecated, use "landscape-v4-dark" instead`
|
|
1955
1968
|
},
|
|
1956
1969
|
{
|
|
1957
|
-
id: "landscape-
|
|
1970
|
+
id: "landscape-vivid",
|
|
1958
1971
|
name: "Vivid",
|
|
1959
1972
|
variantType: "VIVID",
|
|
1960
1973
|
description: "",
|
|
1961
|
-
imageURL: ""
|
|
1962
|
-
|
|
1974
|
+
imageURL: "",
|
|
1975
|
+
deprecated: true,
|
|
1976
|
+
deprecationMessage: `"landscape-vivid" is deprecated, use "landscape-v4-vivid" instead`
|
|
1977
|
+
}
|
|
1978
|
+
]
|
|
1979
|
+
},
|
|
1980
|
+
{
|
|
1981
|
+
referenceStyleID: "LANDSCAPE_V4",
|
|
1982
|
+
name: "Landscape",
|
|
1983
|
+
description: "Terrain map for data overlays and visualisations",
|
|
1984
|
+
variants: [
|
|
1963
1985
|
{
|
|
1964
|
-
id: "landscape",
|
|
1986
|
+
id: "landscape-v4",
|
|
1965
1987
|
name: "Default",
|
|
1966
|
-
variantType: "
|
|
1988
|
+
variantType: "DEFAULT",
|
|
1967
1989
|
description: "",
|
|
1968
|
-
imageURL: ""
|
|
1969
|
-
deprecated: true,
|
|
1970
|
-
deprecationMessage: `"landscape" is deprecated, use "landscape-v4" instead`
|
|
1990
|
+
imageURL: ""
|
|
1971
1991
|
},
|
|
1972
1992
|
{
|
|
1973
|
-
id: "landscape-dark",
|
|
1993
|
+
id: "landscape-v4-dark",
|
|
1974
1994
|
name: "Dark",
|
|
1975
|
-
variantType: "
|
|
1995
|
+
variantType: "DARK",
|
|
1976
1996
|
description: "",
|
|
1977
|
-
imageURL: ""
|
|
1978
|
-
deprecated: true,
|
|
1979
|
-
deprecationMessage: `"landscape-dark" is deprecated, use "landscape-v4-dark" instead`
|
|
1997
|
+
imageURL: ""
|
|
1980
1998
|
},
|
|
1981
1999
|
{
|
|
1982
|
-
id: "landscape-vivid",
|
|
2000
|
+
id: "landscape-v4-vivid",
|
|
1983
2001
|
name: "Vivid",
|
|
1984
|
-
variantType: "
|
|
2002
|
+
variantType: "VIVID",
|
|
1985
2003
|
description: "",
|
|
1986
|
-
imageURL: ""
|
|
1987
|
-
deprecated: true,
|
|
1988
|
-
deprecationMessage: `"landscape-vivid" is deprecated, use "landscape-v4-vivid" instead`
|
|
2004
|
+
imageURL: ""
|
|
1989
2005
|
}
|
|
1990
2006
|
]
|
|
1991
2007
|
}
|
|
1992
2008
|
];
|
|
2009
|
+
const defaultReferenceStyleMap = {
|
|
2010
|
+
STREETS: "STREETS_V2",
|
|
2011
|
+
BASIC: "BASIC_V2",
|
|
2012
|
+
LANDSCAPE: "LANDSCAPE_V2"
|
|
2013
|
+
};
|
|
2014
|
+
function applyVersionToDefaultReferenceStyle(defaultKey, referenceKey) {
|
|
2015
|
+
if (mapStylePresetList.find((style) => style.referenceStyleID === defaultKey)) {
|
|
2016
|
+
console.warn(
|
|
2017
|
+
`Default reference style ${defaultKey} already exists, it will be overwritten...`
|
|
2018
|
+
);
|
|
2019
|
+
}
|
|
2020
|
+
const versionedMapStyle = mapStylePresetList.find(
|
|
2021
|
+
(style) => style.referenceStyleID === referenceKey
|
|
2022
|
+
);
|
|
2023
|
+
if (!versionedMapStyle) {
|
|
2024
|
+
throw new Error(
|
|
2025
|
+
`Versioned map style not found for reference style: ${referenceKey}`
|
|
2026
|
+
);
|
|
2027
|
+
}
|
|
2028
|
+
const defaultStyle = {
|
|
2029
|
+
...versionedMapStyle,
|
|
2030
|
+
referenceStyleID: defaultKey
|
|
2031
|
+
};
|
|
2032
|
+
mapStylePresetList.push(defaultStyle);
|
|
2033
|
+
}
|
|
2034
|
+
Object.entries(defaultReferenceStyleMap).forEach(
|
|
2035
|
+
([defaultKey, referenceKey]) => {
|
|
2036
|
+
applyVersionToDefaultReferenceStyle(defaultKey, referenceKey);
|
|
2037
|
+
}
|
|
2038
|
+
);
|
|
1993
2039
|
function makeReferenceStyleProxy(referenceStyle) {
|
|
1994
2040
|
return new Proxy(referenceStyle, {
|
|
1995
2041
|
get(target, prop, receiver) {
|