@deck.gl/carto 8.9.4 → 8.9.6

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.
Files changed (88) hide show
  1. package/dist/dist.dev.js +420 -222
  2. package/dist/es5/api/layer-map.js +44 -44
  3. package/dist/es5/api/layer-map.js.map +1 -1
  4. package/dist/es5/api/maps-v3-client.js +22 -4
  5. package/dist/es5/api/maps-v3-client.js.map +1 -1
  6. package/dist/es5/api/parseMap.js +64 -48
  7. package/dist/es5/api/parseMap.js.map +1 -1
  8. package/dist/es5/index.js +8 -0
  9. package/dist/es5/index.js.map +1 -1
  10. package/dist/es5/layers/point-label-layer.js +268 -0
  11. package/dist/es5/layers/point-label-layer.js.map +1 -0
  12. package/dist/es5/layers/schema/carto-spatial-tile-loader.js +1 -9
  13. package/dist/es5/layers/schema/carto-spatial-tile-loader.js.map +1 -1
  14. package/dist/es5/layers/schema/carto-spatial-tile.js +5 -31
  15. package/dist/es5/layers/schema/carto-spatial-tile.js.map +1 -1
  16. package/dist/es5/layers/schema/carto-tile.js +12 -6
  17. package/dist/es5/layers/schema/carto-tile.js.map +1 -1
  18. package/dist/es5/layers/schema/carto-vector-tile-loader.js +1 -21
  19. package/dist/es5/layers/schema/carto-vector-tile-loader.js.map +1 -1
  20. package/dist/es5/layers/schema/fast-pbf.js +22 -0
  21. package/dist/es5/layers/schema/fast-pbf.js.map +1 -0
  22. package/dist/es5/layers/schema/tile-loader-utils.js +0 -17
  23. package/dist/es5/layers/schema/tile-loader-utils.js.map +1 -1
  24. package/dist/es5/layers/spatial-index-tile-layer.js +19 -1
  25. package/dist/es5/layers/spatial-index-tile-layer.js.map +1 -1
  26. package/dist/esm/api/layer-map.js +29 -21
  27. package/dist/esm/api/layer-map.js.map +1 -1
  28. package/dist/esm/api/maps-v3-client.js +12 -1
  29. package/dist/esm/api/maps-v3-client.js.map +1 -1
  30. package/dist/esm/api/parseMap.js +59 -44
  31. package/dist/esm/api/parseMap.js.map +1 -1
  32. package/dist/esm/index.js +1 -0
  33. package/dist/esm/index.js.map +1 -1
  34. package/dist/esm/layers/point-label-layer.js +198 -0
  35. package/dist/esm/layers/point-label-layer.js.map +1 -0
  36. package/dist/esm/layers/schema/carto-spatial-tile-loader.js +2 -4
  37. package/dist/esm/layers/schema/carto-spatial-tile-loader.js.map +1 -1
  38. package/dist/esm/layers/schema/carto-spatial-tile.js +3 -28
  39. package/dist/esm/layers/schema/carto-spatial-tile.js.map +1 -1
  40. package/dist/esm/layers/schema/carto-tile.js +12 -6
  41. package/dist/esm/layers/schema/carto-tile.js.map +1 -1
  42. package/dist/esm/layers/schema/carto-vector-tile-loader.js +2 -18
  43. package/dist/esm/layers/schema/carto-vector-tile-loader.js.map +1 -1
  44. package/dist/esm/layers/schema/fast-pbf.js +13 -0
  45. package/dist/esm/layers/schema/fast-pbf.js.map +1 -0
  46. package/dist/esm/layers/schema/tile-loader-utils.js +0 -16
  47. package/dist/esm/layers/schema/tile-loader-utils.js.map +1 -1
  48. package/dist/esm/layers/spatial-index-tile-layer.js +21 -1
  49. package/dist/esm/layers/spatial-index-tile-layer.js.map +1 -1
  50. package/dist.min.js +24 -23
  51. package/package.json +2 -2
  52. package/src/api/layer-map.ts +21 -25
  53. package/src/api/maps-v3-client.ts +19 -4
  54. package/src/api/parseMap.ts +67 -44
  55. package/src/api/types.ts +1 -0
  56. package/src/index.ts +1 -0
  57. package/src/layers/point-label-layer.ts +266 -0
  58. package/src/layers/schema/carto-spatial-tile-loader.ts +2 -5
  59. package/src/layers/schema/carto-spatial-tile.ts +5 -30
  60. package/src/layers/schema/carto-tile.ts +11 -12
  61. package/src/layers/schema/carto-vector-tile-loader.ts +2 -9
  62. package/src/layers/schema/fast-pbf.ts +13 -0
  63. package/src/layers/schema/tile-loader-utils.ts +0 -15
  64. package/src/layers/spatial-index-tile-layer.ts +22 -1
  65. package/typed/api/layer-map.d.ts +1 -2
  66. package/typed/api/layer-map.d.ts.map +1 -1
  67. package/typed/api/maps-v3-client.d.ts +4 -1
  68. package/typed/api/maps-v3-client.d.ts.map +1 -1
  69. package/typed/api/parseMap.d.ts +1 -1
  70. package/typed/api/parseMap.d.ts.map +1 -1
  71. package/typed/api/types.d.ts +1 -0
  72. package/typed/api/types.d.ts.map +1 -1
  73. package/typed/index.d.ts +1 -0
  74. package/typed/index.d.ts.map +1 -1
  75. package/typed/layers/point-label-layer.d.ts +56 -0
  76. package/typed/layers/point-label-layer.d.ts.map +1 -0
  77. package/typed/layers/schema/carto-spatial-tile-loader.d.ts.map +1 -1
  78. package/typed/layers/schema/carto-spatial-tile.d.ts +2 -2
  79. package/typed/layers/schema/carto-spatial-tile.d.ts.map +1 -1
  80. package/typed/layers/schema/carto-tile.d.ts +2 -9
  81. package/typed/layers/schema/carto-tile.d.ts.map +1 -1
  82. package/typed/layers/schema/carto-vector-tile-loader.d.ts.map +1 -1
  83. package/typed/layers/schema/fast-pbf.d.ts +3 -0
  84. package/typed/layers/schema/fast-pbf.d.ts.map +1 -0
  85. package/typed/layers/schema/tile-loader-utils.d.ts +0 -3
  86. package/typed/layers/schema/tile-loader-utils.d.ts.map +1 -1
  87. package/typed/layers/spatial-index-tile-layer.d.ts +1 -0
  88. package/typed/layers/spatial-index-tile-layer.d.ts.map +1 -1
package/dist/dist.dev.js CHANGED
@@ -106,8 +106,8 @@ var __exports__ = (() => {
106
106
  return input instanceof Date || Object.prototype.toString.call(input) === "[object Date]";
107
107
  }
108
108
  function map2(arr, fn) {
109
- var res = [], i;
110
- for (i = 0; i < arr.length; ++i) {
109
+ var res = [], i, arrLen = arr.length;
110
+ for (i = 0; i < arrLen; ++i) {
111
111
  res.push(fn(arr[i], i));
112
112
  }
113
113
  return res;
@@ -196,7 +196,7 @@ var __exports__ = (() => {
196
196
  }
197
197
  var momentProperties = hooks.momentProperties = [], updateInProgress = false;
198
198
  function copyConfig(to2, from2) {
199
- var i, prop, val;
199
+ var i, prop, val, momentPropertiesLen = momentProperties.length;
200
200
  if (!isUndefined(from2._isAMomentObject)) {
201
201
  to2._isAMomentObject = from2._isAMomentObject;
202
202
  }
@@ -227,8 +227,8 @@ var __exports__ = (() => {
227
227
  if (!isUndefined(from2._locale)) {
228
228
  to2._locale = from2._locale;
229
229
  }
230
- if (momentProperties.length > 0) {
231
- for (i = 0; i < momentProperties.length; i++) {
230
+ if (momentPropertiesLen > 0) {
231
+ for (i = 0; i < momentPropertiesLen; i++) {
232
232
  prop = momentProperties[i];
233
233
  val = from2[prop];
234
234
  if (!isUndefined(val)) {
@@ -265,8 +265,8 @@ var __exports__ = (() => {
265
265
  hooks.deprecationHandler(null, msg);
266
266
  }
267
267
  if (firstTime) {
268
- var args = [], arg, i, key;
269
- for (i = 0; i < arguments.length; i++) {
268
+ var args = [], arg, i, key, argLen = arguments.length;
269
+ for (i = 0; i < argLen; i++) {
270
270
  arg = "";
271
271
  if (typeof arguments[i] === "object") {
272
272
  arg += "\n[" + i + "] ";
@@ -596,8 +596,8 @@ var __exports__ = (() => {
596
596
  function stringSet(units, value) {
597
597
  if (typeof units === "object") {
598
598
  units = normalizeObjectUnits(units);
599
- var prioritized = getPrioritizedUnits(units), i;
600
- for (i = 0; i < prioritized.length; i++) {
599
+ var prioritized = getPrioritizedUnits(units), i, prioritizedLen = prioritized.length;
600
+ for (i = 0; i < prioritizedLen; i++) {
601
601
  this[prioritized[i].unit](units[prioritized[i].unit]);
602
602
  }
603
603
  } else {
@@ -623,9 +623,12 @@ var __exports__ = (() => {
623
623
  }
624
624
  function unescapeFormat(s) {
625
625
  return regexEscape(
626
- s.replace("\\", "").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function(matched, p1, p2, p3, p4) {
627
- return p1 || p2 || p3 || p4;
628
- })
626
+ s.replace("\\", "").replace(
627
+ /\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,
628
+ function(matched, p1, p2, p3, p4) {
629
+ return p1 || p2 || p3 || p4;
630
+ }
631
+ )
629
632
  );
630
633
  }
631
634
  function regexEscape(s) {
@@ -633,7 +636,7 @@ var __exports__ = (() => {
633
636
  }
634
637
  var tokens = {};
635
638
  function addParseToken(token2, callback) {
636
- var i, func = callback;
639
+ var i, func = callback, tokenLen;
637
640
  if (typeof token2 === "string") {
638
641
  token2 = [token2];
639
642
  }
@@ -642,7 +645,8 @@ var __exports__ = (() => {
642
645
  array[callback] = toInt(input);
643
646
  };
644
647
  }
645
- for (i = 0; i < token2.length; i++) {
648
+ tokenLen = token2.length;
649
+ for (i = 0; i < tokenLen; i++) {
646
650
  tokens[token2[i]] = func;
647
651
  }
648
652
  }
@@ -715,9 +719,7 @@ var __exports__ = (() => {
715
719
  });
716
720
  var defaultLocaleMonths = "January_February_March_April_May_June_July_August_September_October_November_December".split(
717
721
  "_"
718
- ), defaultLocaleMonthsShort = "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split(
719
- "_"
720
- ), MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/, defaultMonthsShortRegex = matchWord, defaultMonthsRegex = matchWord;
722
+ ), defaultLocaleMonthsShort = "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"), MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/, defaultMonthsShortRegex = matchWord, defaultMonthsRegex = matchWord;
721
723
  function localeMonths(m, format3) {
722
724
  if (!m) {
723
725
  return isArray(this._months) ? this._months : this._months["standalone"];
@@ -1019,9 +1021,12 @@ var __exports__ = (() => {
1019
1021
  addRegexToken("ww", match1to2, match2);
1020
1022
  addRegexToken("W", match1to2);
1021
1023
  addRegexToken("WW", match1to2, match2);
1022
- addWeekParseToken(["w", "ww", "W", "WW"], function(input, week, config, token2) {
1023
- week[token2.substr(0, 1)] = toInt(input);
1024
- });
1024
+ addWeekParseToken(
1025
+ ["w", "ww", "W", "WW"],
1026
+ function(input, week, config, token2) {
1027
+ week[token2.substr(0, 1)] = toInt(input);
1028
+ }
1029
+ );
1025
1030
  function localeWeek(mom) {
1026
1031
  return weekOfYear(mom, this._week.dow, this._week.doy).week;
1027
1032
  }
@@ -1106,9 +1111,7 @@ var __exports__ = (() => {
1106
1111
  function shiftWeekdays(ws, n) {
1107
1112
  return ws.slice(n, 7).concat(ws.slice(0, n));
1108
1113
  }
1109
- var defaultLocaleWeekdays = "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split(
1110
- "_"
1111
- ), defaultLocaleWeekdaysShort = "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"), defaultLocaleWeekdaysMin = "Su_Mo_Tu_We_Th_Fr_Sa".split("_"), defaultWeekdaysRegex = matchWord, defaultWeekdaysShortRegex = matchWord, defaultWeekdaysMinRegex = matchWord;
1114
+ var defaultLocaleWeekdays = "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), defaultLocaleWeekdaysShort = "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"), defaultLocaleWeekdaysMin = "Su_Mo_Tu_We_Th_Fr_Sa".split("_"), defaultWeekdaysRegex = matchWord, defaultWeekdaysShortRegex = matchWord, defaultWeekdaysMinRegex = matchWord;
1112
1115
  function localeWeekdays(m, format3) {
1113
1116
  var weekdays = isArray(this._weekdays) ? this._weekdays : this._weekdays[m && m !== true && this._weekdays.isFormat.test(format3) ? "format" : "standalone"];
1114
1117
  return m === true ? shiftWeekdays(weekdays, this._week.dow) : m ? weekdays[m.day()] : weekdays;
@@ -1492,9 +1495,12 @@ var __exports__ = (() => {
1492
1495
  }
1493
1496
  return globalLocale;
1494
1497
  }
1498
+ function isLocaleNameSane(name) {
1499
+ return name.match("^[^/\\\\]*$") != null;
1500
+ }
1495
1501
  function loadLocale(name) {
1496
1502
  var oldLocale = null, aliasedRequire;
1497
- if (locales[name] === void 0 && typeof module !== "undefined" && module && module.exports) {
1503
+ if (locales[name] === void 0 && typeof module !== "undefined" && module && module.exports && isLocaleNameSane(name)) {
1498
1504
  try {
1499
1505
  oldLocale = globalLocale._abbr;
1500
1506
  aliasedRequire = __require;
@@ -1675,10 +1681,10 @@ var __exports__ = (() => {
1675
1681
  PST: -8 * 60
1676
1682
  };
1677
1683
  function configFromISO(config) {
1678
- var i, l, string = config._i, match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string), allowTime, dateFormat, timeFormat, tzFormat;
1684
+ var i, l, string = config._i, match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string), allowTime, dateFormat, timeFormat, tzFormat, isoDatesLen = isoDates.length, isoTimesLen = isoTimes.length;
1679
1685
  if (match) {
1680
1686
  getParsingFlags(config).iso = true;
1681
- for (i = 0, l = isoDates.length; i < l; i++) {
1687
+ for (i = 0, l = isoDatesLen; i < l; i++) {
1682
1688
  if (isoDates[i][1].exec(match[1])) {
1683
1689
  dateFormat = isoDates[i][0];
1684
1690
  allowTime = isoDates[i][2] !== false;
@@ -1690,7 +1696,7 @@ var __exports__ = (() => {
1690
1696
  return;
1691
1697
  }
1692
1698
  if (match[3]) {
1693
- for (i = 0, l = isoTimes.length; i < l; i++) {
1699
+ for (i = 0, l = isoTimesLen; i < l; i++) {
1694
1700
  if (isoTimes[i][1].exec(match[3])) {
1695
1701
  timeFormat = (match[2] || " ") + isoTimes[i][0];
1696
1702
  break;
@@ -1742,7 +1748,7 @@ var __exports__ = (() => {
1742
1748
  return year;
1743
1749
  }
1744
1750
  function preprocessRFC2822(s) {
1745
- return s.replace(/\([^)]*\)|[\n\t]/g, " ").replace(/(\s\s+)/g, " ").replace(/^\s\s*/, "").replace(/\s\s*$/, "");
1751
+ return s.replace(/\([^()]*\)|[\n\t]/g, " ").replace(/(\s\s+)/g, " ").replace(/^\s\s*/, "").replace(/\s\s*$/, "");
1746
1752
  }
1747
1753
  function checkWeekday(weekdayStr, parsedInput, config) {
1748
1754
  if (weekdayStr) {
@@ -1946,9 +1952,10 @@ var __exports__ = (() => {
1946
1952
  }
1947
1953
  config._a = [];
1948
1954
  getParsingFlags(config).empty = true;
1949
- var string = "" + config._i, i, parsedInput, tokens2, token2, skipped, stringLength = string.length, totalParsedInputLength = 0, era;
1955
+ var string = "" + config._i, i, parsedInput, tokens2, token2, skipped, stringLength = string.length, totalParsedInputLength = 0, era, tokenLen;
1950
1956
  tokens2 = expandFormat(config._f, config._locale).match(formattingTokens) || [];
1951
- for (i = 0; i < tokens2.length; i++) {
1957
+ tokenLen = tokens2.length;
1958
+ for (i = 0; i < tokenLen; i++) {
1952
1959
  token2 = tokens2[i];
1953
1960
  parsedInput = (string.match(getParseRegexForToken(token2, config)) || [])[0];
1954
1961
  if (parsedInput) {
@@ -2014,13 +2021,13 @@ var __exports__ = (() => {
2014
2021
  }
2015
2022
  }
2016
2023
  function configFromStringAndArray(config) {
2017
- var tempConfig, bestMoment, scoreToBeat, i, currentScore, validFormatFound, bestFormatIsValid = false;
2018
- if (config._f.length === 0) {
2024
+ var tempConfig, bestMoment, scoreToBeat, i, currentScore, validFormatFound, bestFormatIsValid = false, configfLen = config._f.length;
2025
+ if (configfLen === 0) {
2019
2026
  getParsingFlags(config).invalidFormat = true;
2020
2027
  config._d = new Date(NaN);
2021
2028
  return;
2022
2029
  }
2023
- for (i = 0; i < config._f.length; i++) {
2030
+ for (i = 0; i < configfLen; i++) {
2024
2031
  currentScore = 0;
2025
2032
  validFormatFound = false;
2026
2033
  tempConfig = copyConfig({}, config);
@@ -2203,13 +2210,13 @@ var __exports__ = (() => {
2203
2210
  "millisecond"
2204
2211
  ];
2205
2212
  function isDurationValid(m) {
2206
- var key, unitHasDecimal = false, i;
2213
+ var key, unitHasDecimal = false, i, orderLen = ordering.length;
2207
2214
  for (key in m) {
2208
2215
  if (hasOwnProp(m, key) && !(indexOf.call(ordering, key) !== -1 && (m[key] == null || !isNaN(m[key])))) {
2209
2216
  return false;
2210
2217
  }
2211
2218
  }
2212
- for (i = 0; i < ordering.length; ++i) {
2219
+ for (i = 0; i < orderLen; ++i) {
2213
2220
  if (m[ordering[i]]) {
2214
2221
  if (unitHasDecimal) {
2215
2222
  return false;
@@ -2570,8 +2577,8 @@ var __exports__ = (() => {
2570
2577
  "milliseconds",
2571
2578
  "millisecond",
2572
2579
  "ms"
2573
- ], i, property;
2574
- for (i = 0; i < properties.length; i += 1) {
2580
+ ], i, property, propertyLen = properties.length;
2581
+ for (i = 0; i < propertyLen; i += 1) {
2575
2582
  property = properties[i];
2576
2583
  propertyTest = propertyTest || hasOwnProp(input, property);
2577
2584
  }
@@ -3031,14 +3038,17 @@ var __exports__ = (() => {
3031
3038
  addRegexToken("NNN", matchEraAbbr);
3032
3039
  addRegexToken("NNNN", matchEraName);
3033
3040
  addRegexToken("NNNNN", matchEraNarrow);
3034
- addParseToken(["N", "NN", "NNN", "NNNN", "NNNNN"], function(input, array, config, token2) {
3035
- var era = config._locale.erasParse(input, token2, config._strict);
3036
- if (era) {
3037
- getParsingFlags(config).era = era;
3038
- } else {
3039
- getParsingFlags(config).invalidEra = input;
3041
+ addParseToken(
3042
+ ["N", "NN", "NNN", "NNNN", "NNNNN"],
3043
+ function(input, array, config, token2) {
3044
+ var era = config._locale.erasParse(input, token2, config._strict);
3045
+ if (era) {
3046
+ getParsingFlags(config).era = era;
3047
+ } else {
3048
+ getParsingFlags(config).invalidEra = input;
3049
+ }
3040
3050
  }
3041
- });
3051
+ );
3042
3052
  addRegexToken("y", matchUnsigned);
3043
3053
  addRegexToken("yy", matchUnsigned);
3044
3054
  addRegexToken("yyy", matchUnsigned);
@@ -3240,9 +3250,12 @@ var __exports__ = (() => {
3240
3250
  addRegexToken("gggg", match1to4, match4);
3241
3251
  addRegexToken("GGGGG", match1to6, match6);
3242
3252
  addRegexToken("ggggg", match1to6, match6);
3243
- addWeekParseToken(["gggg", "ggggg", "GGGG", "GGGGG"], function(input, week, config, token2) {
3244
- week[token2.substr(0, 2)] = toInt(input);
3245
- });
3253
+ addWeekParseToken(
3254
+ ["gggg", "ggggg", "GGGG", "GGGGG"],
3255
+ function(input, week, config, token2) {
3256
+ week[token2.substr(0, 2)] = toInt(input);
3257
+ }
3258
+ );
3246
3259
  addWeekParseToken(["gg", "GG"], function(input, week, config, token2) {
3247
3260
  week[token2] = hooks.parseTwoDigitYear(input);
3248
3261
  });
@@ -3910,7 +3923,7 @@ var __exports__ = (() => {
3910
3923
  addParseToken("x", function(input, array, config) {
3911
3924
  config._d = new Date(toInt(input));
3912
3925
  });
3913
- hooks.version = "2.29.1";
3926
+ hooks.version = "2.29.4";
3914
3927
  setHookCallback(createLocal);
3915
3928
  hooks.fn = proto;
3916
3929
  hooks.min = min2;
@@ -5441,8 +5454,8 @@ var __exports__ = (() => {
5441
5454
  Pbf.Fixed64 = 1;
5442
5455
  Pbf.Bytes = 2;
5443
5456
  Pbf.Fixed32 = 5;
5444
- var SHIFT_LEFT_322 = (1 << 16) * (1 << 16);
5445
- var SHIFT_RIGHT_32 = 1 / SHIFT_LEFT_322;
5457
+ var SHIFT_LEFT_32 = (1 << 16) * (1 << 16);
5458
+ var SHIFT_RIGHT_32 = 1 / SHIFT_LEFT_32;
5446
5459
  var TEXT_DECODER_MIN_LENGTH = 12;
5447
5460
  var utf8TextDecoder = typeof TextDecoder === "undefined" ? null : new TextDecoder("utf8");
5448
5461
  Pbf.prototype = {
@@ -5474,12 +5487,12 @@ var __exports__ = (() => {
5474
5487
  return val;
5475
5488
  },
5476
5489
  readFixed64: function() {
5477
- var val = readUInt32(this.buf, this.pos) + readUInt32(this.buf, this.pos + 4) * SHIFT_LEFT_322;
5490
+ var val = readUInt32(this.buf, this.pos) + readUInt32(this.buf, this.pos + 4) * SHIFT_LEFT_32;
5478
5491
  this.pos += 8;
5479
5492
  return val;
5480
5493
  },
5481
5494
  readSFixed64: function() {
5482
- var val = readUInt32(this.buf, this.pos) + readInt32(this.buf, this.pos + 4) * SHIFT_LEFT_322;
5495
+ var val = readUInt32(this.buf, this.pos) + readInt32(this.buf, this.pos + 4) * SHIFT_LEFT_32;
5483
5496
  this.pos += 8;
5484
5497
  return val;
5485
5498
  },
@@ -5542,7 +5555,7 @@ var __exports__ = (() => {
5542
5555
  readPackedVarint: function(arr, isSigned) {
5543
5556
  if (this.type !== Pbf.Bytes)
5544
5557
  return arr.push(this.readVarint(isSigned));
5545
- var end = readPackedEnd2(this);
5558
+ var end = readPackedEnd(this);
5546
5559
  arr = arr || [];
5547
5560
  while (this.pos < end)
5548
5561
  arr.push(this.readVarint(isSigned));
@@ -5551,7 +5564,7 @@ var __exports__ = (() => {
5551
5564
  readPackedSVarint: function(arr) {
5552
5565
  if (this.type !== Pbf.Bytes)
5553
5566
  return arr.push(this.readSVarint());
5554
- var end = readPackedEnd2(this);
5567
+ var end = readPackedEnd(this);
5555
5568
  arr = arr || [];
5556
5569
  while (this.pos < end)
5557
5570
  arr.push(this.readSVarint());
@@ -5560,7 +5573,7 @@ var __exports__ = (() => {
5560
5573
  readPackedBoolean: function(arr) {
5561
5574
  if (this.type !== Pbf.Bytes)
5562
5575
  return arr.push(this.readBoolean());
5563
- var end = readPackedEnd2(this);
5576
+ var end = readPackedEnd(this);
5564
5577
  arr = arr || [];
5565
5578
  while (this.pos < end)
5566
5579
  arr.push(this.readBoolean());
@@ -5569,7 +5582,7 @@ var __exports__ = (() => {
5569
5582
  readPackedFloat: function(arr) {
5570
5583
  if (this.type !== Pbf.Bytes)
5571
5584
  return arr.push(this.readFloat());
5572
- var end = readPackedEnd2(this);
5585
+ var end = readPackedEnd(this);
5573
5586
  arr = arr || [];
5574
5587
  while (this.pos < end)
5575
5588
  arr.push(this.readFloat());
@@ -5578,7 +5591,7 @@ var __exports__ = (() => {
5578
5591
  readPackedDouble: function(arr) {
5579
5592
  if (this.type !== Pbf.Bytes)
5580
5593
  return arr.push(this.readDouble());
5581
- var end = readPackedEnd2(this);
5594
+ var end = readPackedEnd(this);
5582
5595
  arr = arr || [];
5583
5596
  while (this.pos < end)
5584
5597
  arr.push(this.readDouble());
@@ -5587,7 +5600,7 @@ var __exports__ = (() => {
5587
5600
  readPackedFixed32: function(arr) {
5588
5601
  if (this.type !== Pbf.Bytes)
5589
5602
  return arr.push(this.readFixed32());
5590
- var end = readPackedEnd2(this);
5603
+ var end = readPackedEnd(this);
5591
5604
  arr = arr || [];
5592
5605
  while (this.pos < end)
5593
5606
  arr.push(this.readFixed32());
@@ -5596,7 +5609,7 @@ var __exports__ = (() => {
5596
5609
  readPackedSFixed32: function(arr) {
5597
5610
  if (this.type !== Pbf.Bytes)
5598
5611
  return arr.push(this.readSFixed32());
5599
- var end = readPackedEnd2(this);
5612
+ var end = readPackedEnd(this);
5600
5613
  arr = arr || [];
5601
5614
  while (this.pos < end)
5602
5615
  arr.push(this.readSFixed32());
@@ -5605,7 +5618,7 @@ var __exports__ = (() => {
5605
5618
  readPackedFixed64: function(arr) {
5606
5619
  if (this.type !== Pbf.Bytes)
5607
5620
  return arr.push(this.readFixed64());
5608
- var end = readPackedEnd2(this);
5621
+ var end = readPackedEnd(this);
5609
5622
  arr = arr || [];
5610
5623
  while (this.pos < end)
5611
5624
  arr.push(this.readFixed64());
@@ -5614,7 +5627,7 @@ var __exports__ = (() => {
5614
5627
  readPackedSFixed64: function(arr) {
5615
5628
  if (this.type !== Pbf.Bytes)
5616
5629
  return arr.push(this.readSFixed64());
5617
- var end = readPackedEnd2(this);
5630
+ var end = readPackedEnd(this);
5618
5631
  arr = arr || [];
5619
5632
  while (this.pos < end)
5620
5633
  arr.push(this.readSFixed64());
@@ -5852,7 +5865,7 @@ var __exports__ = (() => {
5852
5865
  return toNum(l, h, s);
5853
5866
  throw new Error("Expected varint not more than 10 bytes");
5854
5867
  }
5855
- function readPackedEnd2(pbf) {
5868
+ function readPackedEnd(pbf) {
5856
5869
  return pbf.type === Pbf.Bytes ? pbf.readVarint() + pbf.pos : pbf.pos + 1;
5857
5870
  }
5858
5871
  function toNum(low, high, isSigned) {
@@ -8317,6 +8330,7 @@ var __exports__ = (() => {
8317
8330
  TILE_FORMATS: () => TILE_FORMATS,
8318
8331
  _CartoTileLayer: () => CartoTileLayer,
8319
8332
  _H3TileLayer: () => H3TileLayer,
8333
+ _PointLabelLayer: () => PointLabelLayer,
8320
8334
  _QuadbinTileLayer: () => QuadbinTileLayer,
8321
8335
  _getDataV2: () => getDataV2,
8322
8336
  _mapInstantiation: () => mapInstantiation,
@@ -8436,7 +8450,7 @@ var __exports__ = (() => {
8436
8450
  }
8437
8451
 
8438
8452
  // src/layers/carto-layer.ts
8439
- var import_core8 = __toESM(require_core());
8453
+ var import_core9 = __toESM(require_core());
8440
8454
  var import_geo_layers8 = __toESM(require_geo_layers());
8441
8455
 
8442
8456
  // src/api/carto-api-error.ts
@@ -11127,6 +11141,20 @@ ${formatErrorKey(key)}: ${errorContext[key]}`;
11127
11141
  // src/layers/carto-tile-layer.ts
11128
11142
  var import_core = __toESM(require_core2());
11129
11143
 
11144
+ // src/layers/schema/fast-pbf.ts
11145
+ function readPackedDouble(pbf, obj) {
11146
+ const end = pbf.type === 2 ? pbf.readVarint() + pbf.pos : pbf.pos + 1;
11147
+ obj.value = new Float64Array(pbf.buf.buffer.slice(pbf.pos, end));
11148
+ pbf.pos = end;
11149
+ return obj.value;
11150
+ }
11151
+ function readPackedFixed64(pbf, obj) {
11152
+ const end = pbf.type === 2 ? pbf.readVarint() + pbf.pos : pbf.pos + 1;
11153
+ obj.value = new BigUint64Array(pbf.buf.buffer.slice(pbf.pos, end));
11154
+ pbf.pos = end;
11155
+ return obj.value;
11156
+ }
11157
+
11130
11158
  // src/layers/schema/carto-tile.ts
11131
11159
  var KeyValueObjectReader = class {
11132
11160
  static read(pbf, end) {
@@ -11144,13 +11172,16 @@ ${formatErrorKey(key)}: ${errorContext[key]}`;
11144
11172
  };
11145
11173
  var PropertiesReader = class {
11146
11174
  static read(pbf, end) {
11147
- return pbf.readFields(PropertiesReader._readField, {
11148
- data: []
11149
- }, end);
11175
+ return pbf.readFields(PropertiesReader._readField, {}, end);
11150
11176
  }
11151
11177
  static _readField(tag, obj, pbf) {
11152
- if (tag === 1)
11153
- obj.data.push(KeyValueObjectReader.read(pbf, pbf.readVarint() + pbf.pos));
11178
+ if (tag === 1) {
11179
+ const {
11180
+ key,
11181
+ value
11182
+ } = KeyValueObjectReader.read(pbf, pbf.readVarint() + pbf.pos);
11183
+ obj[key] = value;
11184
+ }
11154
11185
  }
11155
11186
  };
11156
11187
  var DoublesReader = class {
@@ -11169,7 +11200,7 @@ ${formatErrorKey(key)}: ${errorContext[key]}`;
11169
11200
  }
11170
11201
  static _readField(tag, obj, pbf) {
11171
11202
  if (tag === 1)
11172
- pbf.readPackedDouble(obj.value);
11203
+ readPackedDouble(pbf, obj);
11173
11204
  else if (tag === 2)
11174
11205
  obj.size = pbf.readVarint(true);
11175
11206
  }
@@ -11214,7 +11245,7 @@ ${formatErrorKey(key)}: ${errorContext[key]}`;
11214
11245
  }
11215
11246
  static _readField(tag, obj, pbf) {
11216
11247
  if (tag === 1)
11217
- pbf.readPackedDouble(obj.value);
11248
+ readPackedDouble(pbf, obj);
11218
11249
  }
11219
11250
  };
11220
11251
  var NumericPropKeyValueReader = class {
@@ -11349,21 +11380,6 @@ ${formatErrorKey(key)}: ${errorContext[key]}`;
11349
11380
  const tile = TileReader3.read(pbf);
11350
11381
  return tile;
11351
11382
  }
11352
- function unpackProperties(properties) {
11353
- if (!properties || !properties.length) {
11354
- return [];
11355
- }
11356
- return properties.map((item) => {
11357
- const currentRecord = {};
11358
- item.data.forEach(({
11359
- key,
11360
- value
11361
- }) => {
11362
- currentRecord[key] = value;
11363
- });
11364
- return currentRecord;
11365
- });
11366
- }
11367
11383
 
11368
11384
  // src/layers/schema/carto-vector-tile-loader.ts
11369
11385
  var CartoVectorTileLoader = {
@@ -11383,26 +11399,7 @@ ${formatErrorKey(key)}: ${errorContext[key]}`;
11383
11399
  if (!arrayBuffer)
11384
11400
  return null;
11385
11401
  const tile = parsePbf(arrayBuffer, TileReader);
11386
- const {
11387
- points,
11388
- lines,
11389
- polygons
11390
- } = tile;
11391
- const data = {
11392
- points: {
11393
- ...points,
11394
- properties: unpackProperties(points.properties)
11395
- },
11396
- lines: {
11397
- ...lines,
11398
- properties: unpackProperties(lines.properties)
11399
- },
11400
- polygons: {
11401
- ...polygons,
11402
- properties: unpackProperties(polygons.properties)
11403
- }
11404
- };
11405
- return data;
11402
+ return tile;
11406
11403
  }
11407
11404
  var carto_vector_tile_loader_default = CartoVectorTileLoader;
11408
11405
 
@@ -11815,18 +11812,13 @@ ${formatErrorKey(key)}: ${errorContext[key]}`;
11815
11812
  // src/layers/schema/carto-spatial-tile.ts
11816
11813
  var IndicesReader = class {
11817
11814
  static read(pbf, end) {
11818
- const {
11819
- value
11820
- } = pbf.readFields(IndicesReader._readField, {
11815
+ return pbf.readFields(IndicesReader._readField, {
11821
11816
  value: []
11822
11817
  }, end);
11823
- return {
11824
- value: new BigUint64Array(value)
11825
- };
11826
11818
  }
11827
11819
  static _readField(tag, obj, pbf) {
11828
11820
  if (tag === 1)
11829
- readPackedFixed64(pbf, obj.value);
11821
+ readPackedFixed64(pbf, obj);
11830
11822
  }
11831
11823
  };
11832
11824
  var CellsReader = class {
@@ -11862,24 +11854,6 @@ ${formatErrorKey(key)}: ${errorContext[key]}`;
11862
11854
  obj.cells = CellsReader.read(pbf, pbf.readVarint() + pbf.pos);
11863
11855
  }
11864
11856
  };
11865
- var SHIFT_LEFT_32 = BigInt((1 << 16) * (1 << 16));
11866
- function readPackedEnd(pbf) {
11867
- return pbf.type === 2 ? pbf.readVarint() + pbf.pos : pbf.pos + 1;
11868
- }
11869
- function readFixed64(pbf) {
11870
- const a = BigInt(pbf.readFixed32());
11871
- const b = BigInt(pbf.readFixed32());
11872
- return a + b * SHIFT_LEFT_32;
11873
- }
11874
- function readPackedFixed64(pbf, arr) {
11875
- if (pbf.type !== 2)
11876
- return arr.push(readFixed64(pbf));
11877
- const end = readPackedEnd(pbf);
11878
- arr = arr || [];
11879
- while (pbf.pos < end)
11880
- arr.push(readFixed64(pbf));
11881
- return arr;
11882
- }
11883
11857
 
11884
11858
  // ../../node_modules/quadbin/dist/esm/index.js
11885
11859
  var B = [
@@ -11993,10 +11967,7 @@ ${formatErrorKey(key)}: ${errorContext[key]}`;
11993
11967
  } = tile;
11994
11968
  const scheme = options?.cartoSpatialTile?.scheme;
11995
11969
  const data = {
11996
- cells: {
11997
- ...cells,
11998
- properties: unpackProperties(cells.properties)
11999
- },
11970
+ cells,
12000
11971
  scheme
12001
11972
  };
12002
11973
  return binaryToSpatialjson(data);
@@ -12092,11 +12063,28 @@ ${formatErrorKey(key)}: ${errorContext[key]}`;
12092
12063
  } = this.state;
12093
12064
  const data = tile.content;
12094
12065
  const isFeatureIdPresent = isFeatureIdDefined(hoveredFeatureId);
12095
- if (!isFeatureIdPresent || !Array.isArray(data)) {
12066
+ if (!isFeatureIdPresent || !Array.isArray(data) || !this._featureInTile(tile, hoveredFeatureId)) {
12096
12067
  return -1;
12097
12068
  }
12098
12069
  return data.findIndex((feature) => feature.id === hoveredFeatureId);
12099
12070
  }
12071
+ _featureInTile(tile, featureId) {
12072
+ const {
12073
+ getTileZoom,
12074
+ getParentIndex
12075
+ } = this.state.tileset;
12076
+ const tileZoom = getTileZoom(tile.index);
12077
+ const KEY = tile.index.q ? "q" : "i";
12078
+ let featureIndex = {
12079
+ [KEY]: featureId
12080
+ };
12081
+ let featureZoom = getTileZoom(featureIndex);
12082
+ while (!(featureZoom <= tileZoom)) {
12083
+ featureIndex = getParentIndex(featureIndex);
12084
+ featureZoom = getTileZoom(featureIndex);
12085
+ }
12086
+ return featureIndex[KEY] === tile.index[KEY];
12087
+ }
12100
12088
  };
12101
12089
  __publicField(SpatialIndexTileLayer, "layerName", "SpatialIndexTileLayer");
12102
12090
  __publicField(SpatialIndexTileLayer, "defaultProps", defaultProps2);
@@ -12448,7 +12436,7 @@ ${formatErrorKey(key)}: ${errorContext[key]}`;
12448
12436
  }
12449
12437
  function getLayer(type, config, dataset) {
12450
12438
  let basePropMap = sharedPropMap;
12451
- if (config.visConfig?.customMarkers && !config.textLabel) {
12439
+ if (config.visConfig?.customMarkers) {
12452
12440
  basePropMap = mergePropMaps(sharedPropMap, customMarkersPropsMap);
12453
12441
  }
12454
12442
  if (type === "mvt" || type === "tileset" || type === "h3" || type === "quadbin") {
@@ -12624,10 +12612,30 @@ ${formatErrorKey(key)}: ${errorContext[key]}`;
12624
12612
  }
12625
12613
  function normalizeAccessor(accessor, data) {
12626
12614
  if (data.features || data.tilestats) {
12627
- return ({
12628
- properties
12629
- }) => {
12630
- return accessor(properties);
12615
+ return (object, info) => {
12616
+ if (object) {
12617
+ return accessor(object.properties || object.__source.object.properties);
12618
+ }
12619
+ const {
12620
+ data: data2,
12621
+ index
12622
+ } = info;
12623
+ const {
12624
+ properties,
12625
+ numericProps
12626
+ } = data2;
12627
+ const proxy = new Proxy(properties[index] || {}, {
12628
+ get(target, property, receiver) {
12629
+ if (property in numericProps) {
12630
+ return numericProps[property].value[index];
12631
+ }
12632
+ return target[property];
12633
+ },
12634
+ has(target, property) {
12635
+ return property in numericProps || property in target;
12636
+ }
12637
+ });
12638
+ return accessor(proxy);
12631
12639
  };
12632
12640
  }
12633
12641
  return accessor;
@@ -12788,23 +12796,195 @@ ${formatErrorKey(key)}: ${errorContext[key]}`;
12788
12796
  };
12789
12797
  return normalizeAccessor(accessor, data);
12790
12798
  }
12791
- function getTextPixelOffsetAccessor({
12792
- alignment,
12793
- anchor,
12794
- size
12795
- }, radius) {
12796
- const padding = 20;
12797
- const signX = anchor === "middle" ? 0 : anchor === "start" ? 1 : -1;
12798
- const signY = alignment === "center" ? 0 : alignment === "bottom" ? 1 : -1;
12799
- const sizeOffset = alignment === "center" ? 0 : size;
12800
- const calculateOffset = (r) => [signX * (r + padding), signY * (r + padding + sizeOffset)];
12801
- return typeof radius === "function" ? (d) => {
12802
- return calculateOffset(radius(d));
12803
- } : calculateOffset(radius);
12804
- }
12805
12799
 
12806
- // src/api/parseMap.ts
12800
+ // src/layers/point-label-layer.ts
12807
12801
  var import_core6 = __toESM(require_core());
12802
+ var import_layers3 = __toESM(require_layers());
12803
+ var [LEFT, TOP, RIGHT, BOTTOM] = [0, 1, 2, 3];
12804
+ var EnhancedTextBackgroundLayer = class extends import_layers3._TextBackgroundLayer {
12805
+ getShaders() {
12806
+ const shaders = super.getShaders();
12807
+ let vs = shaders.vs;
12808
+ vs = vs.replaceAll("padding.", "_padding.");
12809
+ vs = vs.replace("void main(void) {", "void main(void) {\n vec4 _padding = padding + instancePixelOffsets.xyxy * vec4(1.0, 1.0, -1.0, -1.0);");
12810
+ return {
12811
+ ...shaders,
12812
+ vs
12813
+ };
12814
+ }
12815
+ };
12816
+ __publicField(EnhancedTextBackgroundLayer, "layerName", "EnhancedTextBackgroundLayer");
12817
+ var EnhancedTextLayer = class extends import_layers3.TextLayer {
12818
+ filterSubLayer({
12819
+ layer,
12820
+ renderPass
12821
+ }) {
12822
+ const background = layer.id.includes("primary-background");
12823
+ if (renderPass === "collision") {
12824
+ return background;
12825
+ }
12826
+ return !background;
12827
+ }
12828
+ };
12829
+ __publicField(EnhancedTextLayer, "layerName", "EnhancedTextLayer");
12830
+ var defaultProps7 = {
12831
+ ...import_layers3.TextLayer.defaultProps,
12832
+ getRadius: {
12833
+ type: "accessor",
12834
+ value: 1
12835
+ },
12836
+ radiusScale: {
12837
+ type: "number",
12838
+ min: 0,
12839
+ value: 1
12840
+ }
12841
+ };
12842
+ var PointLabelLayer = class extends import_core6.CompositeLayer {
12843
+ calculatePixelOffset(secondary) {
12844
+ const {
12845
+ getTextAnchor: anchor,
12846
+ getAlignmentBaseline: alignment,
12847
+ getRadius,
12848
+ getSecondaryText,
12849
+ radiusScale,
12850
+ secondarySizeScale,
12851
+ sizeScale
12852
+ } = this.props;
12853
+ const xMult = anchor === "middle" ? 0 : anchor === "start" ? 1 : -1;
12854
+ const yMult = alignment === "center" ? 0 : alignment === "bottom" ? 1 : -1;
12855
+ const xPadding = sizeScale / 4;
12856
+ const yPadding = sizeScale * (1 + 1 / 4);
12857
+ const secondaryOffset = 0.6 * (1 - yMult) * sizeScale;
12858
+ let yOffset = secondary ? secondaryOffset : 0;
12859
+ if (anchor === "middle" && alignment === "top" && getSecondaryText) {
12860
+ yOffset -= secondaryOffset;
12861
+ yOffset -= secondarySizeScale;
12862
+ yOffset += sizeScale;
12863
+ }
12864
+ const radiusPadding = 1 + 1 / 4;
12865
+ return typeof getRadius === "function" ? (d, info) => {
12866
+ const r = (info ? getRadius(d, info) : 1) * radiusScale * radiusPadding;
12867
+ return [xMult * (r + xPadding), yMult * (r + yPadding) + yOffset];
12868
+ } : [xMult * (getRadius * radiusScale * radiusPadding + xPadding), yMult * (getRadius * radiusScale * radiusPadding + yPadding) + yOffset];
12869
+ }
12870
+ calculateBackgroundPadding() {
12871
+ const {
12872
+ getTextAnchor: anchor,
12873
+ getAlignmentBaseline: alignment,
12874
+ sizeScale
12875
+ } = this.props;
12876
+ const paddingX = 12 * sizeScale;
12877
+ const paddingY = 3 * sizeScale;
12878
+ const backgroundPadding = [0, 0, 0, 0];
12879
+ if (alignment === "top") {
12880
+ backgroundPadding[TOP] = paddingY;
12881
+ } else if (alignment === "bottom") {
12882
+ backgroundPadding[BOTTOM] = paddingY;
12883
+ } else {
12884
+ backgroundPadding[TOP] = 0.5 * paddingY;
12885
+ backgroundPadding[BOTTOM] = 0.5 * paddingY;
12886
+ }
12887
+ if (anchor === "start") {
12888
+ backgroundPadding[LEFT] = paddingX;
12889
+ } else if (anchor === "end") {
12890
+ backgroundPadding[RIGHT] = paddingX;
12891
+ } else {
12892
+ backgroundPadding[LEFT] = 0.5 * paddingX;
12893
+ backgroundPadding[RIGHT] = 0.5 * paddingX;
12894
+ }
12895
+ return backgroundPadding;
12896
+ }
12897
+ renderTextLayer(id, {
12898
+ updateTriggers: updateTriggersOverride = {},
12899
+ ...props
12900
+ }) {
12901
+ const {
12902
+ data,
12903
+ characterSet,
12904
+ fontFamily,
12905
+ fontSettings,
12906
+ fontWeight,
12907
+ outlineColor,
12908
+ outlineWidth,
12909
+ sizeScale,
12910
+ radiusScale,
12911
+ getAlignmentBaseline,
12912
+ getColor,
12913
+ getPosition,
12914
+ getTextAnchor,
12915
+ updateTriggers
12916
+ } = this.props;
12917
+ return new EnhancedTextLayer(this.getSubLayerProps({
12918
+ id,
12919
+ data,
12920
+ characterSet,
12921
+ fontFamily,
12922
+ fontSettings,
12923
+ fontWeight,
12924
+ outlineColor,
12925
+ outlineWidth,
12926
+ sizeScale,
12927
+ getAlignmentBaseline,
12928
+ getColor,
12929
+ getPosition,
12930
+ getTextAnchor,
12931
+ updateTriggers: {
12932
+ ...updateTriggers,
12933
+ ...updateTriggersOverride,
12934
+ getPixelOffset: [updateTriggers.getRadius, updateTriggers.getTextAnchor, updateTriggers.getAlignmentBaseline, radiusScale, sizeScale]
12935
+ }
12936
+ }), {
12937
+ getSize: 1,
12938
+ _subLayerProps: {
12939
+ background: {
12940
+ type: EnhancedTextBackgroundLayer
12941
+ }
12942
+ }
12943
+ }, props);
12944
+ }
12945
+ renderLayers() {
12946
+ const {
12947
+ getText,
12948
+ getSecondaryColor,
12949
+ getSecondaryText,
12950
+ secondaryOutlineColor,
12951
+ secondarySizeScale,
12952
+ updateTriggers
12953
+ } = this.props;
12954
+ const getPixelOffset = this.calculatePixelOffset(false);
12955
+ const backgroundPadding = this.calculateBackgroundPadding();
12956
+ const out = [
12957
+ this.renderTextLayer(`${updateTriggers.getText}-primary`, {
12958
+ backgroundPadding,
12959
+ getText,
12960
+ getPixelOffset,
12961
+ background: true
12962
+ }),
12963
+ Boolean(getSecondaryText) && this.renderTextLayer(`${updateTriggers.getSecondaryText}-secondary`, {
12964
+ getText: getSecondaryText,
12965
+ getPixelOffset: this.calculatePixelOffset(true),
12966
+ getAlignmentBaseline: "top",
12967
+ ...getSecondaryColor && {
12968
+ getColor: getSecondaryColor
12969
+ },
12970
+ ...secondarySizeScale && {
12971
+ sizeScale: secondarySizeScale
12972
+ },
12973
+ ...secondaryOutlineColor && {
12974
+ outlineColor: secondaryOutlineColor
12975
+ }
12976
+ })
12977
+ ];
12978
+ return out;
12979
+ }
12980
+ };
12981
+ __publicField(PointLabelLayer, "layerName", "PointLabelLayer");
12982
+ __publicField(PointLabelLayer, "defaultProps", defaultProps7);
12983
+
12984
+ // src/api/parseMap.ts
12985
+ var import_core7 = __toESM(require_core());
12986
+ var import_extensions2 = __toESM(require_extensions());
12987
+ var collisionFilterExtension = new import_extensions2.CollisionFilterExtension();
12808
12988
  function parseMap(json) {
12809
12989
  const {
12810
12990
  keplerMapConfig,
@@ -12830,7 +13010,7 @@ ${formatErrorKey(key)}: ${errorContext[key]}`;
12830
13010
  initialViewState: mapState,
12831
13011
  mapStyle,
12832
13012
  token,
12833
- layers: extractTextLayers(layers.reverse()).map(({
13013
+ layers: layers.reverse().map(({
12834
13014
  id,
12835
13015
  type,
12836
13016
  config,
@@ -12849,60 +13029,26 @@ ${formatErrorKey(key)}: ${errorContext[key]}`;
12849
13029
  const {
12850
13030
  Layer,
12851
13031
  propMap,
12852
- defaultProps: defaultProps8
13032
+ defaultProps: defaultProps9
12853
13033
  } = getLayer(type, config, dataset);
12854
13034
  const styleProps = createStyleProps(config, propMap);
12855
13035
  return new Layer({
12856
13036
  id,
12857
13037
  data,
12858
- ...defaultProps8,
12859
- ...!config.textLabel && createInteractionProps(interactionConfig),
13038
+ ...defaultProps9,
13039
+ ...createInteractionProps(interactionConfig),
12860
13040
  ...styleProps,
12861
- ...createChannelProps(visualChannels, type, config, data),
13041
+ ...createChannelProps(id, type, config, visualChannels, data),
12862
13042
  ...createParametersProp(layerBlending, styleProps.parameters || {}),
12863
13043
  ...createLoadOptions(token)
12864
13044
  });
12865
13045
  } catch (e) {
12866
- import_core6.log.error(e.message)();
13046
+ import_core7.log.error(e.message)();
12867
13047
  return void 0;
12868
13048
  }
12869
13049
  })
12870
13050
  };
12871
13051
  }
12872
- function extractTextLayers(layers) {
12873
- return (0, import_core6._flatten)(layers.map(({
12874
- id,
12875
- config,
12876
- ...rest
12877
- }) => {
12878
- const {
12879
- textLabel,
12880
- ...configRest
12881
- } = config;
12882
- return [
12883
- {
12884
- id,
12885
- config: configRest,
12886
- ...rest
12887
- },
12888
- ...textLabel.filter((t) => t.field).map((t) => {
12889
- return {
12890
- id: `${id}-label-${t.field.name}`,
12891
- config: {
12892
- textLabel: t,
12893
- ...configRest,
12894
- label: `${config.label}-label-${t.field.name}`,
12895
- visConfig: {
12896
- ...configRest.visConfig,
12897
- opacity: 1
12898
- }
12899
- },
12900
- ...rest
12901
- };
12902
- })
12903
- ];
12904
- }));
12905
- }
12906
13052
  function createParametersProp(layerBlending, parameters) {
12907
13053
  if (layerBlending === "additive") {
12908
13054
  parameters.blendFunc = [esm_default.SRC_ALPHA, esm_default.DST_ALPHA];
@@ -12957,7 +13103,7 @@ ${formatErrorKey(key)}: ${errorContext[key]}`;
12957
13103
  result.highlightColor = config.visConfig.enable3d ? [255, 255, 255, 60] : [252, 242, 26, 255];
12958
13104
  return result;
12959
13105
  }
12960
- function createChannelProps(visualChannels, type, config, data) {
13106
+ function createChannelProps(id, type, config, visualChannels, data) {
12961
13107
  const {
12962
13108
  colorField,
12963
13109
  colorScale,
@@ -12981,7 +13127,6 @@ ${formatErrorKey(key)}: ${errorContext[key]}`;
12981
13127
  visConfig
12982
13128
  } = config;
12983
13129
  const result = {};
12984
- const textLabelField = textLabel && textLabel.field;
12985
13130
  if (type === "grid" || type === "hexagon") {
12986
13131
  result.colorScaleType = colorScale;
12987
13132
  if (colorField) {
@@ -13066,12 +13211,7 @@ ${formatErrorKey(key)}: ${errorContext[key]}`;
13066
13211
  data
13067
13212
  );
13068
13213
  }
13069
- if (textLabelField) {
13070
- result.getText = getTextAccessor(textLabelField, data);
13071
- result.pointType = "text";
13072
- const radius = result.getPointRadius || visConfig.radius;
13073
- result.getTextPixelOffset = getTextPixelOffsetAccessor(textLabel, radius);
13074
- } else if (visConfig.customMarkers) {
13214
+ if (visConfig.customMarkers) {
13075
13215
  const maxIconSize = getMaxMarkerSize(visConfig, visualChannels);
13076
13216
  const {
13077
13217
  getPointRadius,
@@ -13111,6 +13251,55 @@ ${formatErrorKey(key)}: ${errorContext[key]}`;
13111
13251
  if (visualChannels.rotationField) {
13112
13252
  result.getIconAngle = negateAccessor(getSizeAccessor(visualChannels.rotationField, void 0, null, void 0, data));
13113
13253
  }
13254
+ } else if (type === "point" || type === "tileset") {
13255
+ result.pointType = "circle";
13256
+ }
13257
+ if (textLabel && textLabel.length && textLabel[0].field) {
13258
+ const [mainLabel, secondaryLabel] = textLabel;
13259
+ const collisionGroup = id;
13260
+ ({
13261
+ alignment: result.getTextAlignmentBaseline,
13262
+ anchor: result.getTextAnchor,
13263
+ color: result.getTextColor,
13264
+ outlineColor: result.textOutlineColor,
13265
+ size: result.textSizeScale
13266
+ } = mainLabel);
13267
+ const {
13268
+ color: getSecondaryColor,
13269
+ field: secondaryField,
13270
+ outlineColor: secondaryOutlineColor,
13271
+ size: secondarySizeScale
13272
+ } = secondaryLabel || {};
13273
+ result.getText = mainLabel.field && getTextAccessor(mainLabel.field, data);
13274
+ const getSecondaryText = secondaryField && getTextAccessor(secondaryField, data);
13275
+ result.pointType = `${result.pointType}+text`;
13276
+ result.textCharacterSet = "auto";
13277
+ result.textFontFamily = "Inter, sans";
13278
+ result.textFontSettings = {
13279
+ sdf: true
13280
+ };
13281
+ result.textFontWeight = 600;
13282
+ result.textOutlineWidth = 3;
13283
+ result._subLayerProps = {
13284
+ ...result._subLayerProps,
13285
+ "points-text": {
13286
+ type: PointLabelLayer,
13287
+ extensions: [collisionFilterExtension],
13288
+ collisionEnabled: true,
13289
+ collisionGroup,
13290
+ ...result.getPointRadius ? {
13291
+ getRadius: result.getPointRadius
13292
+ } : {
13293
+ radiusScale: visConfig.radius
13294
+ },
13295
+ ...secondaryField && {
13296
+ getSecondaryText,
13297
+ getSecondaryColor,
13298
+ secondarySizeScale,
13299
+ secondaryOutlineColor
13300
+ }
13301
+ }
13302
+ };
13114
13303
  }
13115
13304
  return result;
13116
13305
  }
@@ -13127,7 +13316,7 @@ ${formatErrorKey(key)}: ${errorContext[key]}`;
13127
13316
  }
13128
13317
 
13129
13318
  // src/api/maps-v3-client.ts
13130
- var import_core7 = __toESM(require_core());
13319
+ var import_core8 = __toESM(require_core());
13131
13320
  var MAX_GET_LENGTH = 8192;
13132
13321
  var DEFAULT_CLIENT = "deck-gl-carto";
13133
13322
  var V3_MINOR_VERSION = "3.1";
@@ -13454,7 +13643,7 @@ ${formatErrorKey(key)}: ${errorContext[key]}`;
13454
13643
  assert2(url && mapFormat, "Unsupported data formats received from backend.");
13455
13644
  }
13456
13645
  if (format2 === FORMATS.TILEJSON && formatTiles) {
13457
- import_core7.log.assert(Object.values(TILE_FORMATS).includes(formatTiles), `Invalid value for formatTiles: ${formatTiles}. Use value from TILE_FORMATS`);
13646
+ import_core8.log.assert(Object.values(TILE_FORMATS).includes(formatTiles), `Invalid value for formatTiles: ${formatTiles}. Use value from TILE_FORMATS`);
13458
13647
  url += `&${encodeParameter("formatTiles", formatTiles)}`;
13459
13648
  }
13460
13649
  const {
@@ -13666,16 +13855,25 @@ ${formatErrorKey(key)}: ${errorContext[key]}`;
13666
13855
  });
13667
13856
  await fillInMapDatasets(map2, clientId, localCreds, headers);
13668
13857
  await fillInTileStats(map2, localCreds);
13669
- return {
13858
+ const out = {
13670
13859
  ...parseMap(map2),
13671
13860
  ...{
13672
13861
  stopAutoRefresh
13673
13862
  }
13674
13863
  };
13864
+ const textLayers = out.layers.filter((layer) => {
13865
+ const pointType = layer.props.pointType || "";
13866
+ return pointType.includes("text");
13867
+ });
13868
+ if (textLayers.length && window.FontFace && !document.fonts.check("12px Inter")) {
13869
+ const font = new FontFace("Inter", "url(https://fonts.gstatic.com/s/inter/v12/UcC73FwrK3iLTeHuS_fvQtMwCp50KnMa1ZL7W0Q5nw.woff2)");
13870
+ await font.load().then((f) => document.fonts.add(f));
13871
+ }
13872
+ return out;
13675
13873
  }
13676
13874
 
13677
13875
  // src/layers/carto-layer.ts
13678
- var defaultProps7 = {
13876
+ var defaultProps8 = {
13679
13877
  data: null,
13680
13878
  type: null,
13681
13879
  onDataLoad: {
@@ -13708,7 +13906,7 @@ ${formatErrorKey(key)}: ${errorContext[key]}`;
13708
13906
  aggregationResLevel: null,
13709
13907
  queryParameters: null
13710
13908
  };
13711
- var CartoLayer = class extends import_core8.CompositeLayer {
13909
+ var CartoLayer = class extends import_core9.CompositeLayer {
13712
13910
  initializeState() {
13713
13911
  this.state = {
13714
13912
  data: null,
@@ -13733,23 +13931,23 @@ ${formatErrorKey(key)}: ${errorContext[key]}`;
13733
13931
  const {
13734
13932
  apiVersion
13735
13933
  } = localCreds;
13736
- import_core8.log.assert(Object.values(API_VERSIONS).includes(apiVersion), `Invalid apiVersion ${apiVersion}. Use API_VERSIONS enum.`);
13934
+ import_core9.log.assert(Object.values(API_VERSIONS).includes(apiVersion), `Invalid apiVersion ${apiVersion}. Use API_VERSIONS enum.`);
13737
13935
  if (apiVersion === API_VERSIONS.V1 || apiVersion === API_VERSIONS.V2) {
13738
- import_core8.log.assert(type === MAP_TYPES.QUERY || type === MAP_TYPES.TILESET, `Invalid type ${type}. Use type MAP_TYPES.QUERY or MAP_TYPES.TILESET for apiVersion ${apiVersion}`);
13739
- import_core8.log.assert(!connection, `Connection prop is not supported for apiVersion ${apiVersion}`);
13740
- import_core8.log.assert(!geoColumn, `geoColumn prop is not supported for apiVersion ${apiVersion}`);
13741
- import_core8.log.assert(!columns, `columns prop is not supported for apiVersion ${apiVersion}`);
13936
+ import_core9.log.assert(type === MAP_TYPES.QUERY || type === MAP_TYPES.TILESET, `Invalid type ${type}. Use type MAP_TYPES.QUERY or MAP_TYPES.TILESET for apiVersion ${apiVersion}`);
13937
+ import_core9.log.assert(!connection, `Connection prop is not supported for apiVersion ${apiVersion}`);
13938
+ import_core9.log.assert(!geoColumn, `geoColumn prop is not supported for apiVersion ${apiVersion}`);
13939
+ import_core9.log.assert(!columns, `columns prop is not supported for apiVersion ${apiVersion}`);
13742
13940
  } else if (apiVersion === API_VERSIONS.V3) {
13743
- import_core8.log.assert(connection, "Missing mandatory connection parameter");
13744
- import_core8.log.assert(Object.values(MAP_TYPES).includes(type), `Invalid type ${type}. Use MAP_TYPES enum.`);
13941
+ import_core9.log.assert(connection, "Missing mandatory connection parameter");
13942
+ import_core9.log.assert(Object.values(MAP_TYPES).includes(type), `Invalid type ${type}. Use MAP_TYPES enum.`);
13745
13943
  if (!COLUMNS_SUPPORT.includes(type)) {
13746
- import_core8.log.assert(!columns, `columns prop is only supported for types: ${COLUMNS_SUPPORT.join()}`);
13944
+ import_core9.log.assert(!columns, `columns prop is only supported for types: ${COLUMNS_SUPPORT.join()}`);
13747
13945
  }
13748
13946
  if (!GEO_COLUMN_SUPPORT.includes(type)) {
13749
- import_core8.log.assert(!geoColumn, `geoColumn prop is only supported for types: ${GEO_COLUMN_SUPPORT.join()}`);
13947
+ import_core9.log.assert(!geoColumn, `geoColumn prop is only supported for types: ${GEO_COLUMN_SUPPORT.join()}`);
13750
13948
  }
13751
13949
  if (columns) {
13752
- import_core8.log.assert(Array.isArray(columns), "columns prop must be an Array");
13950
+ import_core9.log.assert(Array.isArray(columns), "columns prop must be an Array");
13753
13951
  }
13754
13952
  }
13755
13953
  }
@@ -13827,7 +14025,7 @@ ${formatErrorKey(key)}: ${errorContext[key]}`;
13827
14025
  } = this.state;
13828
14026
  const {
13829
14027
  uniqueIdProperty
13830
- } = defaultProps7;
14028
+ } = defaultProps8;
13831
14029
  const {
13832
14030
  data: _notUsed,
13833
14031
  ...propsNoData
@@ -13880,7 +14078,7 @@ ${formatErrorKey(key)}: ${errorContext[key]}`;
13880
14078
  }
13881
14079
  };
13882
14080
  __publicField(CartoLayer, "layerName", "CartoLayer");
13883
- __publicField(CartoLayer, "defaultProps", defaultProps7);
14081
+ __publicField(CartoLayer, "defaultProps", defaultProps8);
13884
14082
 
13885
14083
  // src/basemap.ts
13886
14084
  var baseUrl = "https://basemaps.cartocdn.com/gl/{basemap}-gl-style/style.json";
@@ -14006,9 +14204,9 @@ ${formatErrorKey(key)}: ${errorContext[key]}`;
14006
14204
 
14007
14205
  // ../layers/bundle/peer-dependency.ts
14008
14206
  var peer_dependency_exports = {};
14009
- var import_layers3 = __toESM(require_layers());
14207
+ var import_layers4 = __toESM(require_layers());
14010
14208
  __reExport(peer_dependency_exports, __toESM(require_layers()));
14011
- if (!import_layers3.GeoJsonLayer) {
14209
+ if (!import_layers4.GeoJsonLayer) {
14012
14210
  throw new Error("@deck.gl/layers is not found");
14013
14211
  }
14014
14212