@maptiler/client 2.6.0-rc.3 → 2.7.0-rc.1

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.
@@ -1381,8 +1381,7 @@ class MapStyleVariant {
1381
1381
  return expandMapStyle(this.getId());
1382
1382
  }
1383
1383
  warnIfDeprecated(variant = this) {
1384
- if (!variant.deprecated)
1385
- return variant;
1384
+ if (!variant.deprecated) return variant;
1386
1385
  if (variant.deprecationMessage) {
1387
1386
  console.warn(variant.deprecationMessage);
1388
1387
  } else {
@@ -1461,7 +1460,7 @@ class ReferenceMapStyle {
1461
1460
  return this.orderedVariants[0].warnIfDeprecated();
1462
1461
  }
1463
1462
  }
1464
- const mapStylePresetList = [
1463
+ const MAP_STYLE_CONFIG = [
1465
1464
  {
1466
1465
  referenceStyleID: "STREETS_V2",
1467
1466
  name: "Streets",
@@ -1571,7 +1570,7 @@ const mapStylePresetList = [
1571
1570
  {
1572
1571
  id: "base-v4-ai",
1573
1572
  name: "Base AI",
1574
- variantType: "NIGHT",
1573
+ variantType: "AI",
1575
1574
  description: "",
1576
1575
  imageURL: ""
1577
1576
  }
@@ -1587,19 +1586,23 @@ const mapStylePresetList = [
1587
1586
  name: "Default",
1588
1587
  variantType: "DEFAULT",
1589
1588
  description: "",
1590
- imageURL: ""
1589
+ imageURL: "",
1590
+ deprecated: true,
1591
+ deprecationMessage: `"outdoor-v2" is deprecated, use "outdoor-v4" instead`
1591
1592
  },
1592
1593
  {
1593
1594
  id: "outdoor-v2-dark",
1594
1595
  name: "Dark",
1595
1596
  variantType: "DARK",
1596
1597
  description: "",
1597
- imageURL: ""
1598
+ imageURL: "",
1599
+ deprecated: true,
1600
+ deprecationMessage: `"outdoor-v2-dark" is deprecated, use "outdoor-v4-dark" instead`
1598
1601
  }
1599
1602
  ]
1600
1603
  },
1601
1604
  {
1602
- referenceStyleID: "WINTER",
1605
+ referenceStyleID: "WINTER_V2",
1603
1606
  name: "Winter",
1604
1607
  description: "",
1605
1608
  variants: [
@@ -1609,6 +1612,9 @@ const mapStylePresetList = [
1609
1612
  variantType: "DEFAULT",
1610
1613
  description: "",
1611
1614
  imageURL: ""
1615
+ // this is not deprecated yet...
1616
+ // deprecated: true,
1617
+ // deprecationMessage: `"winter-v2" is deprecated, use "winter-v4" instead`,
1612
1618
  },
1613
1619
  {
1614
1620
  id: "winter-v2-dark",
@@ -1616,11 +1622,35 @@ const mapStylePresetList = [
1616
1622
  variantType: "DARK",
1617
1623
  description: "",
1618
1624
  imageURL: ""
1625
+ // this is not deprecated yet...
1626
+ // deprecated: true,
1627
+ // deprecationMessage: `"winter-v2-dark" is deprecated, use "winter-v4-dark" instead`,
1628
+ }
1629
+ ]
1630
+ },
1631
+ {
1632
+ referenceStyleID: "WINTER_V4",
1633
+ name: "Winter",
1634
+ description: "",
1635
+ variants: [
1636
+ {
1637
+ id: "winter-v4",
1638
+ name: "Default",
1639
+ variantType: "DEFAULT",
1640
+ description: "",
1641
+ imageURL: ""
1642
+ },
1643
+ {
1644
+ id: "winter-v4-dark",
1645
+ name: "Dark",
1646
+ variantType: "DARK",
1647
+ description: "",
1648
+ imageURL: ""
1619
1649
  }
1620
1650
  ]
1621
1651
  },
1622
1652
  {
1623
- referenceStyleID: "SATELLITE",
1653
+ referenceStyleID: "SATELLITE_V2",
1624
1654
  name: "Satellite",
1625
1655
  description: "",
1626
1656
  variants: [
@@ -1629,12 +1659,14 @@ const mapStylePresetList = [
1629
1659
  name: "Default",
1630
1660
  variantType: "DEFAULT",
1631
1661
  description: "",
1632
- imageURL: ""
1662
+ imageURL: "",
1663
+ deprecated: true,
1664
+ deprecationMessage: `"satellite" is deprecated, use "satellite-v4" instead`
1633
1665
  }
1634
1666
  ]
1635
1667
  },
1636
1668
  {
1637
- referenceStyleID: "HYBRID",
1669
+ referenceStyleID: "HYBRID_V2",
1638
1670
  name: "Hybrid",
1639
1671
  description: "",
1640
1672
  variants: [
@@ -1647,6 +1679,25 @@ const mapStylePresetList = [
1647
1679
  }
1648
1680
  ]
1649
1681
  },
1682
+ {
1683
+ referenceStyleID: "HYBRID_V4",
1684
+ name: "Hybrid",
1685
+ description: "",
1686
+ variants: [
1687
+ {
1688
+ id: "hybrid-v4",
1689
+ name: "Default",
1690
+ variantType: "DEFAULT",
1691
+ imageURL: ""
1692
+ },
1693
+ {
1694
+ id: "hybrid-v4-dark",
1695
+ name: "Dark",
1696
+ variantType: "DARK",
1697
+ imageURL: ""
1698
+ }
1699
+ ]
1700
+ },
1650
1701
  {
1651
1702
  referenceStyleID: "BASIC_V2",
1652
1703
  name: "Basic",
@@ -1659,21 +1710,24 @@ const mapStylePresetList = [
1659
1710
  description: "",
1660
1711
  imageURL: "",
1661
1712
  deprecated: true,
1662
- deprecationMessage: `"basic-v2" is deprecated, use "basic-v4" instead`
1713
+ deprecationMessage: `"basic-v2" is deprecated, use "base-v4" instead`
1663
1714
  },
1664
1715
  {
1665
1716
  id: "basic-v2-dark",
1666
1717
  name: "Dark",
1667
1718
  variantType: "DARK",
1668
1719
  description: "",
1669
- imageURL: ""
1720
+ imageURL: "",
1721
+ deprecationMessage: `"basic-v2" is deprecated, use "base-v4" instead`
1670
1722
  },
1671
1723
  {
1672
1724
  id: "basic-v2-light",
1673
1725
  name: "Light",
1674
1726
  variantType: "LIGHT",
1675
1727
  description: "",
1676
- imageURL: ""
1728
+ imageURL: "",
1729
+ deprecated: true,
1730
+ deprecationMessage: `"basic-v2" is deprecated, use "base-v4" instead`
1677
1731
  }
1678
1732
  ]
1679
1733
  },
@@ -1713,7 +1767,7 @@ const mapStylePresetList = [
1713
1767
  ]
1714
1768
  },
1715
1769
  {
1716
- referenceStyleID: "OPENSTREETMAP",
1770
+ referenceStyleID: "OPENSTREETMAP_V2",
1717
1771
  name: "OpenStreetMap",
1718
1772
  description: "",
1719
1773
  variants: [
@@ -1723,11 +1777,18 @@ const mapStylePresetList = [
1723
1777
  variantType: "DEFAULT",
1724
1778
  description: "",
1725
1779
  imageURL: ""
1780
+ },
1781
+ {
1782
+ id: "openstreetmap-dark",
1783
+ name: "Dark",
1784
+ variantType: "DARK",
1785
+ description: "",
1786
+ imageURL: ""
1726
1787
  }
1727
1788
  ]
1728
1789
  },
1729
1790
  {
1730
- referenceStyleID: "TOPO",
1791
+ referenceStyleID: "TOPO_V2",
1731
1792
  name: "Topo",
1732
1793
  description: "",
1733
1794
  variants: [
@@ -1736,41 +1797,49 @@ const mapStylePresetList = [
1736
1797
  name: "Default",
1737
1798
  variantType: "DEFAULT",
1738
1799
  description: "",
1739
- imageURL: ""
1800
+ imageURL: "",
1801
+ deprecated: true,
1802
+ deprecationMessage: `"topo-v2" is deprecated, use "topo-v4" instead`
1740
1803
  },
1741
1804
  {
1742
1805
  id: "topo-v2-dark",
1743
1806
  name: "Dark",
1744
1807
  variantType: "DARK",
1745
1808
  description: "",
1746
- imageURL: ""
1809
+ imageURL: "",
1810
+ deprecated: true,
1811
+ deprecationMessage: `"topo-v2-dark" is deprecated, use "topo-v4-dark" instead`
1747
1812
  },
1748
1813
  {
1749
1814
  id: "topo-v2-shiny",
1750
1815
  name: "Shiny",
1751
- deprecated: true,
1752
1816
  variantType: "SHINY",
1753
1817
  description: "",
1754
- imageURL: ""
1818
+ imageURL: "",
1819
+ deprecated: true
1755
1820
  },
1756
1821
  {
1757
1822
  id: "topo-v2-pastel",
1758
1823
  name: "Pastel",
1759
1824
  variantType: "PASTEL",
1760
1825
  description: "",
1761
- imageURL: ""
1826
+ imageURL: "",
1827
+ deprecated: true,
1828
+ deprecationMessage: `"topo-v2-pastel" is deprecated, use "topo-v4-pastel" instead`
1762
1829
  },
1763
1830
  {
1764
1831
  id: "topo-v2-topographique",
1765
1832
  name: "Topographique",
1766
1833
  variantType: "TOPOGRAPHIQUE",
1767
1834
  description: "",
1768
- imageURL: ""
1835
+ imageURL: "",
1836
+ deprecated: true,
1837
+ deprecationMessage: `"topo-v2-topographique" is deprecated, use "topo-v4-topographique" instead`
1769
1838
  }
1770
1839
  ]
1771
1840
  },
1772
1841
  {
1773
- referenceStyleID: "VOYAGER",
1842
+ referenceStyleID: "VOYAGER_V2",
1774
1843
  name: "Voyager",
1775
1844
  description: "",
1776
1845
  variants: [
@@ -1809,16 +1878,20 @@ const mapStylePresetList = [
1809
1878
  ]
1810
1879
  },
1811
1880
  {
1812
- referenceStyleID: "TONER",
1881
+ referenceStyleID: "TONER_V2",
1813
1882
  name: "Toner",
1814
1883
  description: "",
1884
+ deprecated: true,
1885
+ deprecationMessage: `"toner-v2" is deprecated, and will be no longer be a default style in the future`,
1815
1886
  variants: [
1816
1887
  {
1817
1888
  id: "toner-v2",
1818
1889
  name: "Default",
1819
1890
  variantType: "DEFAULT",
1820
1891
  description: "",
1821
- imageURL: ""
1892
+ imageURL: "",
1893
+ deprecated: true,
1894
+ deprecationMessage: `"toner-v2" is deprecated, and may be removed in future versions.`
1822
1895
  },
1823
1896
  {
1824
1897
  id: "toner-v2-background",
@@ -1826,27 +1899,31 @@ const mapStylePresetList = [
1826
1899
  variantType: "BACKGROUND",
1827
1900
  deprecated: true,
1828
1901
  description: "",
1829
- imageURL: ""
1902
+ imageURL: "",
1903
+ deprecationMessage: `"toner-v2-background" is deprecated, and may be removed in future versions.`
1830
1904
  },
1831
1905
  {
1832
1906
  id: "toner-v2-lite",
1833
1907
  name: "Lite",
1834
1908
  variantType: "LITE",
1835
1909
  description: "",
1836
- imageURL: ""
1910
+ imageURL: "",
1911
+ deprecated: true,
1912
+ deprecationMessage: `"toner-v2-lite" is deprecated, and may be removed in future versions.`
1837
1913
  },
1838
1914
  {
1839
1915
  id: "toner-v2-lines",
1840
1916
  name: "Lines",
1841
1917
  variantType: "LINES",
1842
- deprecated: true,
1843
1918
  description: "",
1844
- imageURL: ""
1919
+ imageURL: "",
1920
+ deprecated: true,
1921
+ deprecationMessage: `"toner-v2-lines" is deprecated, and may be removed in future versions.`
1845
1922
  }
1846
1923
  ]
1847
1924
  },
1848
1925
  {
1849
- referenceStyleID: "DATAVIZ",
1926
+ referenceStyleID: "DATAVIZ_V2",
1850
1927
  name: "Dataviz",
1851
1928
  description: "",
1852
1929
  variants: [
@@ -1855,26 +1932,32 @@ const mapStylePresetList = [
1855
1932
  name: "Default",
1856
1933
  variantType: "DEFAULT",
1857
1934
  description: "",
1858
- imageURL: ""
1935
+ imageURL: "",
1936
+ deprecated: true,
1937
+ deprecationMessage: `"dataviz" is deprecated, use "dataviz-v4" instead`
1859
1938
  },
1860
1939
  {
1861
1940
  id: "dataviz-dark",
1862
1941
  name: "Dark",
1863
1942
  variantType: "DARK",
1864
1943
  description: "",
1865
- imageURL: ""
1944
+ imageURL: "",
1945
+ deprecated: true,
1946
+ deprecationMessage: `"dataviz-dark" is deprecated, use "dataviz-v4-dark" instead`
1866
1947
  },
1867
1948
  {
1868
1949
  id: "dataviz-light",
1869
1950
  name: "Light",
1870
1951
  variantType: "LIGHT",
1871
1952
  description: "",
1872
- imageURL: ""
1953
+ imageURL: "",
1954
+ deprecated: true,
1955
+ deprecationMessage: `"dataviz-light" is deprecated, use "dataviz-v4-light" instead`
1873
1956
  }
1874
1957
  ]
1875
1958
  },
1876
1959
  {
1877
- referenceStyleID: "BACKDROP",
1960
+ referenceStyleID: "BACKDROP_V2",
1878
1961
  name: "Backdrop",
1879
1962
  description: "",
1880
1963
  variants: [
@@ -1883,26 +1966,32 @@ const mapStylePresetList = [
1883
1966
  name: "Default",
1884
1967
  variantType: "DEFAULT",
1885
1968
  description: "",
1886
- imageURL: ""
1969
+ imageURL: "",
1970
+ deprecated: true,
1971
+ deprecationMessage: `"backdrop" is deprecated, use "backdrop-v4" instead`
1887
1972
  },
1888
1973
  {
1889
1974
  id: "backdrop-dark",
1890
1975
  name: "Dark",
1891
1976
  variantType: "DARK",
1892
1977
  description: "",
1893
- imageURL: ""
1978
+ imageURL: "",
1979
+ deprecated: true,
1980
+ deprecationMessage: `"backdrop-dark" is deprecated, use "backdrop-v4-dark" instead`
1894
1981
  },
1895
1982
  {
1896
1983
  id: "backdrop-light",
1897
1984
  name: "Light",
1898
1985
  variantType: "LIGHT",
1899
1986
  description: "",
1900
- imageURL: ""
1987
+ imageURL: "",
1988
+ deprecated: true,
1989
+ deprecationMessage: `"backdrop-light" is deprecated, use "backdrop-v4-light" instead`
1901
1990
  }
1902
1991
  ]
1903
1992
  },
1904
1993
  {
1905
- referenceStyleID: "OCEAN",
1994
+ referenceStyleID: "OCEAN_V2",
1906
1995
  name: "Ocean",
1907
1996
  description: "",
1908
1997
  variants: [
@@ -1911,12 +2000,14 @@ const mapStylePresetList = [
1911
2000
  name: "Default",
1912
2001
  variantType: "DEFAULT",
1913
2002
  description: "",
1914
- imageURL: ""
2003
+ imageURL: "",
2004
+ deprecated: true,
2005
+ deprecationMessage: `"ocean" is deprecated, use "ocean-v4" instead`
1915
2006
  }
1916
2007
  ]
1917
2008
  },
1918
2009
  {
1919
- referenceStyleID: "AQUARELLE",
2010
+ referenceStyleID: "AQUARELLE_V2",
1920
2011
  name: "Aquarelle",
1921
2012
  description: "Watercolor map for creative use",
1922
2013
  variants: [
@@ -1925,21 +2016,27 @@ const mapStylePresetList = [
1925
2016
  name: "Default",
1926
2017
  variantType: "DEFAULT",
1927
2018
  description: "",
1928
- imageURL: ""
2019
+ imageURL: "",
2020
+ deprecated: true,
2021
+ deprecationMessage: `"aquarelle" is deprecated, use "aquarelle-v4" instead`
1929
2022
  },
1930
2023
  {
1931
2024
  id: "aquarelle-dark",
1932
2025
  name: "Dark",
1933
2026
  variantType: "DARK",
1934
2027
  description: "",
1935
- imageURL: ""
2028
+ imageURL: "",
2029
+ deprecated: true,
2030
+ deprecationMessage: `"aquarelle-dark" is deprecated, use "aquarelle-v4-dark" instead`
1936
2031
  },
1937
2032
  {
1938
2033
  id: "aquarelle-vivid",
1939
2034
  name: "Vivid",
1940
2035
  variantType: "VIVID",
1941
2036
  description: "",
1942
- imageURL: ""
2037
+ imageURL: "",
2038
+ deprecated: true,
2039
+ deprecationMessage: `"aquarelle-vivid" is deprecated, use "aquarelle-v4-vivid" instead`
1943
2040
  }
1944
2041
  ]
1945
2042
  },
@@ -2004,13 +2101,209 @@ const mapStylePresetList = [
2004
2101
  imageURL: ""
2005
2102
  }
2006
2103
  ]
2104
+ },
2105
+ {
2106
+ referenceStyleID: "SATELLITE_V4",
2107
+ name: "Satellite v4",
2108
+ description: "",
2109
+ variants: [
2110
+ {
2111
+ id: "satellite-v4",
2112
+ name: "Default",
2113
+ variantType: "DEFAULT",
2114
+ description: "",
2115
+ imageURL: ""
2116
+ },
2117
+ {
2118
+ id: "satellite-v4-dark",
2119
+ name: "Dark",
2120
+ variantType: "DARK",
2121
+ description: "",
2122
+ imageURL: ""
2123
+ }
2124
+ ]
2125
+ },
2126
+ {
2127
+ referenceStyleID: "DATAVIZ_V4",
2128
+ name: "Dataviz",
2129
+ description: "",
2130
+ variants: [
2131
+ {
2132
+ id: "dataviz-v4",
2133
+ name: "Default",
2134
+ variantType: "DEFAULT",
2135
+ description: "",
2136
+ imageURL: ""
2137
+ },
2138
+ {
2139
+ id: "dataviz-v4-dark",
2140
+ name: "Dark",
2141
+ variantType: "DARK",
2142
+ description: "",
2143
+ imageURL: ""
2144
+ },
2145
+ {
2146
+ id: "dataviz-v4-light",
2147
+ name: "Light",
2148
+ variantType: "LIGHT",
2149
+ description: "",
2150
+ imageURL: ""
2151
+ }
2152
+ ]
2153
+ },
2154
+ {
2155
+ referenceStyleID: "OUTDOOR_V4",
2156
+ name: "Outdoor",
2157
+ description: "",
2158
+ variants: [
2159
+ {
2160
+ id: "outdoor-v4",
2161
+ name: "Default",
2162
+ variantType: "DEFAULT",
2163
+ description: "",
2164
+ imageURL: ""
2165
+ },
2166
+ {
2167
+ id: "outdoor-v4-dark",
2168
+ name: "Dark",
2169
+ variantType: "DARK",
2170
+ description: "",
2171
+ imageURL: ""
2172
+ }
2173
+ ]
2174
+ },
2175
+ {
2176
+ referenceStyleID: "BACKDROP_V4",
2177
+ name: "Backdrop",
2178
+ description: "",
2179
+ variants: [
2180
+ {
2181
+ id: "backdrop-v4",
2182
+ name: "Default",
2183
+ variantType: "DEFAULT",
2184
+ description: "",
2185
+ imageURL: ""
2186
+ },
2187
+ {
2188
+ id: "backdrop-v4-dark",
2189
+ name: "Dark",
2190
+ variantType: "DARK",
2191
+ description: "",
2192
+ imageURL: ""
2193
+ },
2194
+ {
2195
+ id: "backdrop-v4-light",
2196
+ name: "Light",
2197
+ variantType: "LIGHT",
2198
+ description: "",
2199
+ imageURL: ""
2200
+ }
2201
+ ]
2202
+ },
2203
+ {
2204
+ referenceStyleID: "AQUARELLE_V4",
2205
+ name: "Aquarelle",
2206
+ description: "Watercolor map for creative use",
2207
+ variants: [
2208
+ {
2209
+ id: "aquarelle-v4",
2210
+ name: "Default",
2211
+ variantType: "DEFAULT",
2212
+ description: "",
2213
+ imageURL: ""
2214
+ },
2215
+ {
2216
+ id: "aquarelle-v4-dark",
2217
+ name: "Dark",
2218
+ variantType: "DARK",
2219
+ description: "",
2220
+ imageURL: ""
2221
+ },
2222
+ {
2223
+ id: "aquarelle-v4-vivid",
2224
+ name: "Vivid",
2225
+ variantType: "VIVID",
2226
+ description: "",
2227
+ imageURL: ""
2228
+ }
2229
+ ]
2230
+ },
2231
+ {
2232
+ referenceStyleID: "OCEAN_V4",
2233
+ name: "Ocean",
2234
+ description: "",
2235
+ variants: [
2236
+ {
2237
+ id: "ocean-v4",
2238
+ name: "Default",
2239
+ variantType: "DEFAULT",
2240
+ description: "",
2241
+ imageURL: ""
2242
+ },
2243
+ {
2244
+ id: "ocean-v4-dark",
2245
+ name: "Dark",
2246
+ variantType: "DARK",
2247
+ description: "",
2248
+ imageURL: ""
2249
+ }
2250
+ ]
2251
+ },
2252
+ {
2253
+ referenceStyleID: "TOPO_V4",
2254
+ name: "Topo",
2255
+ description: "",
2256
+ variants: [
2257
+ {
2258
+ id: "topo-v4",
2259
+ name: "Default",
2260
+ variantType: "DEFAULT",
2261
+ description: "",
2262
+ imageURL: ""
2263
+ },
2264
+ {
2265
+ id: "topo-v4-dark",
2266
+ name: "Dark",
2267
+ variantType: "DARK",
2268
+ description: "",
2269
+ imageURL: ""
2270
+ },
2271
+ {
2272
+ id: "topo-v4-pastel",
2273
+ name: "Pastel",
2274
+ variantType: "PASTEL",
2275
+ description: "",
2276
+ imageURL: ""
2277
+ },
2278
+ {
2279
+ id: "topo-v4-topographique",
2280
+ name: "Topographique",
2281
+ variantType: "TOPOGRAPHIQUE",
2282
+ description: "",
2283
+ imageURL: ""
2284
+ }
2285
+ ]
2007
2286
  }
2008
2287
  ];
2009
2288
  const defaultReferenceStyleMap = {
2010
2289
  STREETS: "STREETS_V2",
2011
2290
  BASIC: "BASIC_V2",
2012
- LANDSCAPE: "LANDSCAPE_V2"
2291
+ LANDSCAPE: "LANDSCAPE_V2",
2292
+ AQUARELLE: "AQUARELLE_V2",
2293
+ SATELLITE: "SATELLITE_V2",
2294
+ WINTER: "WINTER_V2",
2295
+ HYBRID: "HYBRID_V2",
2296
+ OCEAN: "OCEAN_V2",
2297
+ TONER: "TONER_V2",
2298
+ TOPO: "TOPO_V2",
2299
+ OPENSTREETMAP: "OPENSTREETMAP_V2",
2300
+ DATAVIZ: "DATAVIZ_V2",
2301
+ BACKDROP: "BACKDROP_V2",
2302
+ VOYAGER: "VOYAGER_V2"
2013
2303
  };
2304
+ const mapStylePresetList = [
2305
+ ...MAP_STYLE_CONFIG
2306
+ ];
2014
2307
  function applyVersionToDefaultReferenceStyle(defaultKey, referenceKey) {
2015
2308
  if (mapStylePresetList.find((style) => style.referenceStyleID === defaultKey)) {
2016
2309
  console.warn(
@@ -2367,10 +2660,12 @@ const staticMaps = {
2367
2660
 
2368
2661
  const EARTH_RADIUS = 63710088e-1;
2369
2662
  const EARTH_CIRCUMFERENCE = 2 * Math.PI * EARTH_RADIUS;
2663
+ const MAX_VALID_LATITUDE = 85.0511287;
2370
2664
  function longitudeToMercatorX(lng) {
2371
2665
  return (180 + lng) / 360;
2372
2666
  }
2373
2667
  function latitudeToMercatorY(lat) {
2668
+ lat = Math.max(Math.min(lat, MAX_VALID_LATITUDE), -MAX_VALID_LATITUDE);
2374
2669
  return (180 - 180 / Math.PI * Math.log(Math.tan(Math.PI / 4 + lat * Math.PI / 360))) / 360;
2375
2670
  }
2376
2671
  function wgs84ToMercator(position) {
@@ -2943,8 +3238,7 @@ async function at(position, options = {}) {
2943
3238
  return elevatedPositions[0];
2944
3239
  }
2945
3240
  async function batch(positions, options = {}) {
2946
- if (positions.length === 0)
2947
- return [];
3241
+ if (positions.length === 0) return [];
2948
3242
  const apiKey = options.apiKey ?? config.apiKey;
2949
3243
  const elevatedPositions = options.computeOn === "client" ? await computeOnClient(positions, apiKey, options.zoom) : await computeOnServer(positions, apiKey);
2950
3244
  if (options.smoothingKernelSize) {