@itwin/map-layers-formats 5.2.0 → 5.2.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.
Files changed (72) hide show
  1. package/CHANGELOG.md +11 -1
  2. package/lib/cjs/ArcGisFeature/ArcGisFeatureFormat.js.map +1 -1
  3. package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.js.map +1 -1
  4. package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.js.map +1 -1
  5. package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.js.map +1 -1
  6. package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.js.map +1 -1
  7. package/lib/cjs/ArcGisFeature/ArcGisJsonFeatureReader.js.map +1 -1
  8. package/lib/cjs/ArcGisFeature/ArcGisPbfFeatureReader.js.map +1 -1
  9. package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.js.map +1 -1
  10. package/lib/cjs/ArcGisFeature/EsriSymbology.js.map +1 -1
  11. package/lib/cjs/ArcGisFeature/esriPBuffer.gen.js.map +1 -1
  12. package/lib/cjs/Feature/DefaultMarkerIcon.js +9 -9
  13. package/lib/cjs/Feature/DefaultMarkerIcon.js.map +1 -1
  14. package/lib/cjs/Feature/FeatureCanvasRenderer.js.map +1 -1
  15. package/lib/cjs/Feature/FeatureInfoReader.js.map +1 -1
  16. package/lib/cjs/Feature/FeatureSymbology.js.map +1 -1
  17. package/lib/cjs/Feature/RandomMapColor.js.map +1 -1
  18. package/lib/cjs/GeoJSON/GeoJSONGeometry.js.map +1 -1
  19. package/lib/cjs/GeoJSON/GeoJSONGeometryReader.js.map +1 -1
  20. package/lib/cjs/GoogleMaps/GoogleMaps.js.map +1 -1
  21. package/lib/cjs/GoogleMaps/GoogleMapsImageryFormat.js.map +1 -1
  22. package/lib/cjs/GoogleMaps/GoogleMapsImageryProvider.js.map +1 -1
  23. package/lib/cjs/GoogleMaps/GoogleMapsSession.js.map +1 -1
  24. package/lib/cjs/Icons/MapInfoIcon.js.map +1 -1
  25. package/lib/cjs/OgcApiFeatures/OgcApiFeaturesFormat.js.map +1 -1
  26. package/lib/cjs/OgcApiFeatures/OgcApiFeaturesProvider.js.map +1 -1
  27. package/lib/cjs/OgcApiFeatures/OgcApiFeaturesReader.js.map +1 -1
  28. package/lib/cjs/Tools/GeometryTerrainDraper.js.map +1 -1
  29. package/lib/cjs/Tools/MapFeatureInfoDecorator.js.map +1 -1
  30. package/lib/cjs/Tools/MapFeatureInfoTool.js.map +1 -1
  31. package/lib/cjs/internal/GoogleMapsUtils.js.map +1 -1
  32. package/lib/cjs/internal/NativeGoogleMapsSession.js.map +1 -1
  33. package/lib/cjs/map-layers-formats.js.map +1 -1
  34. package/lib/cjs/mapLayersFormats.js.map +1 -1
  35. package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.js.map +1 -1
  36. package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.js.map +1 -1
  37. package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.js.map +1 -1
  38. package/lib/esm/ArcGisFeature/ArcGisFeatureReader.js.map +1 -1
  39. package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.js.map +1 -1
  40. package/lib/esm/ArcGisFeature/ArcGisJsonFeatureReader.js.map +1 -1
  41. package/lib/esm/ArcGisFeature/ArcGisPbfFeatureReader.js.map +1 -1
  42. package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.js.map +1 -1
  43. package/lib/esm/ArcGisFeature/EsriSymbology.js.map +1 -1
  44. package/lib/esm/ArcGisFeature/esriPBuffer.gen.js.map +1 -1
  45. package/lib/esm/Feature/DefaultMarkerIcon.js +9 -9
  46. package/lib/esm/Feature/DefaultMarkerIcon.js.map +1 -1
  47. package/lib/esm/Feature/FeatureCanvasRenderer.js.map +1 -1
  48. package/lib/esm/Feature/FeatureInfoReader.js.map +1 -1
  49. package/lib/esm/Feature/FeatureSymbology.js.map +1 -1
  50. package/lib/esm/Feature/RandomMapColor.js.map +1 -1
  51. package/lib/esm/GeoJSON/GeoJSONGeometry.js.map +1 -1
  52. package/lib/esm/GeoJSON/GeoJSONGeometryReader.js.map +1 -1
  53. package/lib/esm/GoogleMaps/GoogleMaps.js.map +1 -1
  54. package/lib/esm/GoogleMaps/GoogleMapsImageryFormat.js.map +1 -1
  55. package/lib/esm/GoogleMaps/GoogleMapsImageryProvider.js.map +1 -1
  56. package/lib/esm/GoogleMaps/GoogleMapsSession.js.map +1 -1
  57. package/lib/esm/Icons/MapInfoIcon.js.map +1 -1
  58. package/lib/esm/OgcApiFeatures/OgcApiFeaturesFormat.js.map +1 -1
  59. package/lib/esm/OgcApiFeatures/OgcApiFeaturesProvider.js.map +1 -1
  60. package/lib/esm/OgcApiFeatures/OgcApiFeaturesReader.js.map +1 -1
  61. package/lib/esm/Tools/GeometryTerrainDraper.js.map +1 -1
  62. package/lib/esm/Tools/MapFeatureInfoDecorator.js.map +1 -1
  63. package/lib/esm/Tools/MapFeatureInfoTool.js.map +1 -1
  64. package/lib/esm/internal/GoogleMapsUtils.js.map +1 -1
  65. package/lib/esm/internal/NativeGoogleMapsSession.js.map +1 -1
  66. package/lib/esm/map-layers-formats.js.map +1 -1
  67. package/lib/esm/mapLayersFormats.js.map +1 -1
  68. package/lib/public/images/GoogleMaps_Logo_Gray.svg +50 -50
  69. package/lib/public/images/GoogleMaps_Logo_WithDarkOutline.svg +78 -78
  70. package/lib/public/images/GoogleMaps_Logo_WithLightOutline.svg +78 -78
  71. package/lib/public/locales/en/mapLayersFormats.json +18 -18
  72. package/package.json +13 -13
@@ -9,15 +9,15 @@ const core_common_1 = require("@itwin/core-common");
9
9
  /** @internal */
10
10
  class DefaultMarkerIcon {
11
11
  static getSvgContent(color = core_common_1.ColorDef.fromString("#00AEEF")) {
12
- return `<?xml version="1.0" encoding="utf-8"?>
13
- <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
14
- <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
15
- viewBox="0 0 365 560" enable-background="new 0 0 365 560" xml:space="preserve">
16
- <g>
17
- <path fill="${color.toHexString()}" d="M182.9,551.7c0,0.1,0.2,0.3,0.2,0.3S358.3,283,358.3,194.6c0-130.1-88.8-186.7-175.4-186.9
18
- C96.3,7.9,7.5,64.5,7.5,194.6c0,88.4,175.3,357.4,175.3,357.4S182.9,551.7,182.9,551.7z M122.2,187.2c0-33.6,27.2-60.8,60.8-60.8
19
- c33.6,0,60.8,27.2,60.8,60.8S216.5,248,182.9,248C149.4,248,122.2,220.8,122.2,187.2z"/>
20
- </g>
12
+ return `<?xml version="1.0" encoding="utf-8"?>
13
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
14
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
15
+ viewBox="0 0 365 560" enable-background="new 0 0 365 560" xml:space="preserve">
16
+ <g>
17
+ <path fill="${color.toHexString()}" d="M182.9,551.7c0,0.1,0.2,0.3,0.2,0.3S358.3,283,358.3,194.6c0-130.1-88.8-186.7-175.4-186.9
18
+ C96.3,7.9,7.5,64.5,7.5,194.6c0,88.4,175.3,357.4,175.3,357.4S182.9,551.7,182.9,551.7z M122.2,187.2c0-33.6,27.2-60.8,60.8-60.8
19
+ c33.6,0,60.8,27.2,60.8,60.8S216.5,248,182.9,248C149.4,248,122.2,220.8,122.2,187.2z"/>
20
+ </g>
21
21
  </svg>`;
22
22
  }
23
23
  static getContent(color) {
@@ -1 +1 @@
1
- {"version":3,"file":"DefaultMarkerIcon.js","sourceRoot":"","sources":["../../../src/Feature/DefaultMarkerIcon.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,oDAAmE;AAEnE,gBAAgB;AAChB,MAAa,iBAAiB;IACpB,MAAM,CAAC,aAAa,CAAC,QAAkB,sBAAQ,CAAC,UAAU,CAAC,SAAS,CAAC;QAC3E,OAAO;;;;;oBAKS,KAAK,CAAC,WAAW,EAAE;;;;WAI5B,CAAC;IACV,CAAC;IAEM,MAAM,CAAC,UAAU,CAAC,KAAgB;QACvC,OAAO;YACL,WAAW,EAAE,eAAe;YAC5B,SAAS,EAAE,iCAAmB,CAAC,MAAM,CAAC,iBAAiB,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;SAC9E,CAAC;IACJ,CAAC;CACF;AApBD,8CAoBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nimport { Base64EncodedString, ColorDef } from \"@itwin/core-common\";\r\n\r\n/** @internal */\r\nexport class DefaultMarkerIcon {\r\n private static getSvgContent(color: ColorDef = ColorDef.fromString(\"#00AEEF\")) {\r\n return `<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n <!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\r\n <svg version=\"1.1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\r\n viewBox=\"0 0 365 560\" enable-background=\"new 0 0 365 560\" xml:space=\"preserve\">\r\n <g>\r\n <path fill=\"${color.toHexString()}\" d=\"M182.9,551.7c0,0.1,0.2,0.3,0.2,0.3S358.3,283,358.3,194.6c0-130.1-88.8-186.7-175.4-186.9\r\n C96.3,7.9,7.5,64.5,7.5,194.6c0,88.4,175.3,357.4,175.3,357.4S182.9,551.7,182.9,551.7z M122.2,187.2c0-33.6,27.2-60.8,60.8-60.8\r\n c33.6,0,60.8,27.2,60.8,60.8S216.5,248,182.9,248C149.4,248,122.2,220.8,122.2,187.2z\"/>\r\n </g>\r\n </svg>`;\r\n }\r\n\r\n public static getContent(color?: ColorDef) {\r\n return {\r\n contentType: \"image/svg+xml\",\r\n imageData: Base64EncodedString.encode(DefaultMarkerIcon.getSvgContent(color)),\r\n };\r\n }\r\n}\r\n\r\n"]}
1
+ {"version":3,"file":"DefaultMarkerIcon.js","sourceRoot":"","sources":["../../../src/Feature/DefaultMarkerIcon.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,oDAAmE;AAEnE,gBAAgB;AAChB,MAAa,iBAAiB;IACpB,MAAM,CAAC,aAAa,CAAC,QAAkB,sBAAQ,CAAC,UAAU,CAAC,SAAS,CAAC;QAC3E,OAAO;;;;;oBAKS,KAAK,CAAC,WAAW,EAAE;;;;WAI5B,CAAC;IACV,CAAC;IAEM,MAAM,CAAC,UAAU,CAAC,KAAgB;QACvC,OAAO;YACL,WAAW,EAAE,eAAe;YAC5B,SAAS,EAAE,iCAAmB,CAAC,MAAM,CAAC,iBAAiB,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;SAC9E,CAAC;IACJ,CAAC;CACF;AApBD,8CAoBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\nimport { Base64EncodedString, ColorDef } from \"@itwin/core-common\";\n\n/** @internal */\nexport class DefaultMarkerIcon {\n private static getSvgContent(color: ColorDef = ColorDef.fromString(\"#00AEEF\")) {\n return `<?xml version=\"1.0\" encoding=\"utf-8\"?>\n <!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n <svg version=\"1.1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 365 560\" enable-background=\"new 0 0 365 560\" xml:space=\"preserve\">\n <g>\n <path fill=\"${color.toHexString()}\" d=\"M182.9,551.7c0,0.1,0.2,0.3,0.2,0.3S358.3,283,358.3,194.6c0-130.1-88.8-186.7-175.4-186.9\n C96.3,7.9,7.5,64.5,7.5,194.6c0,88.4,175.3,357.4,175.3,357.4S182.9,551.7,182.9,551.7z M122.2,187.2c0-33.6,27.2-60.8,60.8-60.8\n c33.6,0,60.8,27.2,60.8,60.8S216.5,248,182.9,248C149.4,248,122.2,220.8,122.2,187.2z\"/>\n </g>\n </svg>`;\n }\n\n public static getContent(color?: ColorDef) {\n return {\n contentType: \"image/svg+xml\",\n imageData: Base64EncodedString.encode(DefaultMarkerIcon.getSvgContent(color)),\n };\n }\n}\n\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"FeatureCanvasRenderer.js","sourceRoot":"","sources":["../../../src/Feature/FeatureCanvasRenderer.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,wDAAwH;AAIxH,gBAAgB;AAChB,MAAa,qBAAsB,SAAQ,2CAA2B;IAC5D,QAAQ,CAA2B;IACnC,OAAO,CAAgC;IAE/C,IAAY,cAAc;QACxB,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IACe,oBAAoB,KAAuC,OAAO,IAAI,CAAC,CAAA,CAAC;IAExF,YAAY,OAAiC,EAAE,MAAqC,EAAE,oBAAgC;QACpH,KAAK,CAAC,oBAAoB,CAAC,CAAC;QAC5B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IAC1B,CAAC;IAES,SAAS;QACjB,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC;IAC5B,CAAC;IAES,SAAS;QACjB,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC;IAC5B,CAAC;IAES,MAAM,CAAC,CAAS,EAAE,CAAS;QACnC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC7B,CAAC;IAES,MAAM,CAAC,CAAS,EAAE,CAAS;QACnC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC7B,CAAC;IAES,KAAK,CAAC,IAAI;QAClB,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC3C,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;IACvB,CAAC;IAES,KAAK,CAAC,MAAM;QACpB,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC7C,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;IACzB,CAAC;IAES,KAAK,CAAC,YAAY;IAC5B,CAAC;IAES,KAAK,CAAC,SAAS,CAAC,CAAS,EAAE,CAAS;QAC5C,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAC9C,CAAC;CACF;AA/CD,sDA+CC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nimport { FeatureGeometryBaseRenderer, FeatureSymbolizedRenderer, FeatureSymbologyRenderer } from \"@itwin/core-frontend\";\r\nimport { Transform } from \"@itwin/core-geometry\";\r\nimport { ArcGisSymbologyCanvasRenderer } from \"../ArcGisFeature/ArcGisSymbologyRenderer.js\";\r\n\r\n/** @internal */\r\nexport class FeatureCanvasRenderer extends FeatureGeometryBaseRenderer implements FeatureSymbolizedRenderer {\r\n private _context: CanvasRenderingContext2D;\r\n private _symbol: ArcGisSymbologyCanvasRenderer;\r\n\r\n public get symbolRenderer(): FeatureSymbologyRenderer {\r\n return this._symbol;\r\n }\r\n public override hasSymbologyRenderer(): this is FeatureSymbolizedRenderer {return true;}\r\n\r\n constructor(context: CanvasRenderingContext2D, symbol: ArcGisSymbologyCanvasRenderer, world2PixelTransform?: Transform) {\r\n super(world2PixelTransform);\r\n this._symbol = symbol;\r\n this._context = context;\r\n }\r\n\r\n protected beginPath() {\r\n this._context.beginPath();\r\n }\r\n\r\n protected closePath() {\r\n this._context.closePath();\r\n }\r\n\r\n protected lineTo(x: number, y: number) {\r\n this._context.lineTo(x, y);\r\n }\r\n\r\n protected moveTo(x: number, y: number) {\r\n this._context.moveTo(x, y);\r\n }\r\n\r\n protected async fill() {\r\n this._symbol.applyFillStyle(this._context);\r\n this._context.fill();\r\n }\r\n\r\n protected async stroke() {\r\n this._symbol.applyStrokeStyle(this._context);\r\n this._context.stroke();\r\n }\r\n\r\n protected async finishPoints() {\r\n }\r\n\r\n protected async drawPoint(x: number, y: number) {\r\n this._symbol.drawPoint(this._context, x, y);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"FeatureCanvasRenderer.js","sourceRoot":"","sources":["../../../src/Feature/FeatureCanvasRenderer.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,wDAAwH;AAIxH,gBAAgB;AAChB,MAAa,qBAAsB,SAAQ,2CAA2B;IAC5D,QAAQ,CAA2B;IACnC,OAAO,CAAgC;IAE/C,IAAY,cAAc;QACxB,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IACe,oBAAoB,KAAuC,OAAO,IAAI,CAAC,CAAA,CAAC;IAExF,YAAY,OAAiC,EAAE,MAAqC,EAAE,oBAAgC;QACpH,KAAK,CAAC,oBAAoB,CAAC,CAAC;QAC5B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IAC1B,CAAC;IAES,SAAS;QACjB,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC;IAC5B,CAAC;IAES,SAAS;QACjB,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC;IAC5B,CAAC;IAES,MAAM,CAAC,CAAS,EAAE,CAAS;QACnC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC7B,CAAC;IAES,MAAM,CAAC,CAAS,EAAE,CAAS;QACnC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC7B,CAAC;IAES,KAAK,CAAC,IAAI;QAClB,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC3C,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;IACvB,CAAC;IAES,KAAK,CAAC,MAAM;QACpB,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC7C,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;IACzB,CAAC;IAES,KAAK,CAAC,YAAY;IAC5B,CAAC;IAES,KAAK,CAAC,SAAS,CAAC,CAAS,EAAE,CAAS;QAC5C,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAC9C,CAAC;CACF;AA/CD,sDA+CC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\nimport { FeatureGeometryBaseRenderer, FeatureSymbolizedRenderer, FeatureSymbologyRenderer } from \"@itwin/core-frontend\";\nimport { Transform } from \"@itwin/core-geometry\";\nimport { ArcGisSymbologyCanvasRenderer } from \"../ArcGisFeature/ArcGisSymbologyRenderer.js\";\n\n/** @internal */\nexport class FeatureCanvasRenderer extends FeatureGeometryBaseRenderer implements FeatureSymbolizedRenderer {\n private _context: CanvasRenderingContext2D;\n private _symbol: ArcGisSymbologyCanvasRenderer;\n\n public get symbolRenderer(): FeatureSymbologyRenderer {\n return this._symbol;\n }\n public override hasSymbologyRenderer(): this is FeatureSymbolizedRenderer {return true;}\n\n constructor(context: CanvasRenderingContext2D, symbol: ArcGisSymbologyCanvasRenderer, world2PixelTransform?: Transform) {\n super(world2PixelTransform);\n this._symbol = symbol;\n this._context = context;\n }\n\n protected beginPath() {\n this._context.beginPath();\n }\n\n protected closePath() {\n this._context.closePath();\n }\n\n protected lineTo(x: number, y: number) {\n this._context.lineTo(x, y);\n }\n\n protected moveTo(x: number, y: number) {\n this._context.moveTo(x, y);\n }\n\n protected async fill() {\n this._symbol.applyFillStyle(this._context);\n this._context.fill();\n }\n\n protected async stroke() {\n this._symbol.applyStrokeStyle(this._context);\n this._context.stroke();\n }\n\n protected async finishPoints() {\n }\n\n protected async drawPoint(x: number, y: number) {\n this._symbol.drawPoint(this._context, x, y);\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"FeatureInfoReader.js","sourceRoot":"","sources":["../../../src/Feature/FeatureInfoReader.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,0DAAsE;AAEtE;;GAEG;AACH,MAAsB,iBAAiB;IAErC,gDAAgD;IACzC,cAAc,CAAmB;IAExC,kDAAkD;IAClD,mEAAmE;IAC5D,0BAA0B,GAAG,KAAK,CAAC;IAEhC,qBAAqB,GAAG,CAAC,KAAa,EAAE,EAAE;QAClD,OAAO,CAAC,IAAI,CAAC,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;IACtG,CAAC,CAAC;IAEQ,eAAe,GAAG,CAAC,QAA2B,EAAE,KAAiC,EAAE,EAAE;QAC7F,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,OAAQ,EAAE,CAAC;QACb,CAAC;aAAM,IAAK,QAAQ,KAAK,kCAAiB,CAAC,QAAQ,IAAI,IAAI,CAAC,0BAA0B,EAAE,CAAC;YACvF,OAAQ,KAAc,CAAC,WAAW,EAAE,CAAC;QACvC,CAAC;aAAM,CAAC;YACN,gEAAgE;YAChE,OAAO,GAAG,KAAK,EAAE,CAAC;QACpB,CAAC;IACH,CAAC,CAAC;CAEH;AAxBD,8CAwBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nimport { Primitives, StandardTypeNames } from \"@itwin/appui-abstract\";\r\n\r\n/** Base feature infos reader\r\n * @internal\r\n */\r\nexport abstract class FeatureInfoReader {\r\n\r\n // Optionally you can set the floating precision\r\n public floatPrecision: number|undefined;\r\n\r\n // Force display value of date to ISO 8601 format.\r\n // Turning this ON, will disable display value in end-user's locale\r\n public forceDateDisplayValueToIso = false;\r\n\r\n protected toFixedWithoutPadding = (value: number) => {\r\n return (this.floatPrecision === undefined ? value : parseFloat(value.toFixed(this.floatPrecision)));\r\n };\r\n\r\n protected getDisplayValue = (typename: StandardTypeNames, value: Primitives.Value|undefined) => {\r\n if (value === undefined) {\r\n return \"\";\r\n } else if ( typename === StandardTypeNames.DateTime && this.forceDateDisplayValueToIso) {\r\n return (value as Date).toISOString();\r\n } else {\r\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\r\n return `${value}`;\r\n }\r\n };\r\n\r\n}\r\n"]}
1
+ {"version":3,"file":"FeatureInfoReader.js","sourceRoot":"","sources":["../../../src/Feature/FeatureInfoReader.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,0DAAsE;AAEtE;;GAEG;AACH,MAAsB,iBAAiB;IAErC,gDAAgD;IACzC,cAAc,CAAmB;IAExC,kDAAkD;IAClD,mEAAmE;IAC5D,0BAA0B,GAAG,KAAK,CAAC;IAEhC,qBAAqB,GAAG,CAAC,KAAa,EAAE,EAAE;QAClD,OAAO,CAAC,IAAI,CAAC,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;IACtG,CAAC,CAAC;IAEQ,eAAe,GAAG,CAAC,QAA2B,EAAE,KAAiC,EAAE,EAAE;QAC7F,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,OAAQ,EAAE,CAAC;QACb,CAAC;aAAM,IAAK,QAAQ,KAAK,kCAAiB,CAAC,QAAQ,IAAI,IAAI,CAAC,0BAA0B,EAAE,CAAC;YACvF,OAAQ,KAAc,CAAC,WAAW,EAAE,CAAC;QACvC,CAAC;aAAM,CAAC;YACN,gEAAgE;YAChE,OAAO,GAAG,KAAK,EAAE,CAAC;QACpB,CAAC;IACH,CAAC,CAAC;CAEH;AAxBD,8CAwBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\nimport { Primitives, StandardTypeNames } from \"@itwin/appui-abstract\";\n\n/** Base feature infos reader\n * @internal\n */\nexport abstract class FeatureInfoReader {\n\n // Optionally you can set the floating precision\n public floatPrecision: number|undefined;\n\n // Force display value of date to ISO 8601 format.\n // Turning this ON, will disable display value in end-user's locale\n public forceDateDisplayValueToIso = false;\n\n protected toFixedWithoutPadding = (value: number) => {\n return (this.floatPrecision === undefined ? value : parseFloat(value.toFixed(this.floatPrecision)));\n };\n\n protected getDisplayValue = (typename: StandardTypeNames, value: Primitives.Value|undefined) => {\n if (value === undefined) {\n return \"\";\n } else if ( typename === StandardTypeNames.DateTime && this.forceDateDisplayValueToIso) {\n return (value as Date).toISOString();\n } else {\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\n return `${value}`;\n }\n };\n\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"FeatureSymbology.js","sourceRoot":"","sources":["../../../src/Feature/FeatureSymbology.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,gBAAgB;AAChB,MAAsB,gBAAgB;CAErC;AAFD,4CAEC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @internal */\r\nexport abstract class FeatureSymbology {\r\n\r\n}\r\n\r\n/** @internal */\r\nexport interface FeatureDefaultSymbology {\r\n getSymbology: (geometryType: string) => FeatureSymbology;\r\n}\r\n"]}
1
+ {"version":3,"file":"FeatureSymbology.js","sourceRoot":"","sources":["../../../src/Feature/FeatureSymbology.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,gBAAgB;AAChB,MAAsB,gBAAgB;CAErC;AAFD,4CAEC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @internal */\nexport abstract class FeatureSymbology {\n\n}\n\n/** @internal */\nexport interface FeatureDefaultSymbology {\n getSymbology: (geometryType: string) => FeatureSymbology;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"RandomMapColor.js","sourceRoot":"","sources":["../../../src/Feature/RandomMapColor.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,oDAA8C;AAE9C,gBAAgB;AAChB,MAAa,cAAc;IACjB,MAAM,CAAU,kBAAkB,GAAG;QAC3C,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;QACjG,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;QACjG,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;QACjG,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;QACjG,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;QACjG,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;QACjG,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;QACjG,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;KAClG,CAAC;IAEK,QAAQ;QACb,OAAO,cAAc,CAAC,kBAAkB,CAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,cAAc,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC;IAClH,CAAC;IAEM,WAAW;QAChB,OAAO,sBAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC9C,CAAC;;AAlBH,wCAmBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nimport { ColorDef } from \"@itwin/core-common\";\r\n\r\n/** @internal */\r\nexport class RandomMapColor {\r\n private static readonly randomColorPalette = [\r\n \"#8c510a\", \"#bf812d\", \"#dfc27d\", \"#f6e8c3\", \"#f5f5f5\", \"#c7eae5\", \"#80cdc1\", \"#35978f\", \"#01665e\",\r\n \"#b2182b\", \"#d6604d\", \"#f4a582\", \"#fddbc7\", \"#f7f7f7\", \"#d1e5f0\", \"#92c5de\", \"#4393c3\", \"#2166ac\",\r\n \"#d73027\", \"#f46d43\", \"#fdae61\", \"#fee090\", \"#ffffbf\", \"#e0f3f8\", \"#abd9e9\", \"#74add1\", \"#4575b4\",\r\n \"#a6cee3\", \"#1f78b4\", \"#b2df8a\", \"#33a02c\", \"#fb9a99\", \"#e31c2c\", \"#fdbf6f\", \"#ff7f00\", \"#cab2d6\",\r\n \"#fbb4ae\", \"#e41a1c\", \"#377eb8\", \"#4daf4a\", \"#984ea3\", \"#ff2000\", \"#ffff33\", \"#a65628\", \"#999999\",\r\n \"#8dd3c7\", \"#ffffb3\", \"#bebada\", \"#fb8072\", \"#80b1d3\", \"#fdb462\", \"#b3de69\", \"#fccde5\", \"#ffa07a\",\r\n \"#b15928\", \"#6a3d9a\", \"#ffed6f\", \"#9e0142\", \"#5e4fa2\", \"#999900\", \"#1a9850\", \"#4d4d4d\", \"#6baed6\",\r\n \"#71c671\", \"#388e8e\", \"#7d9ec0\", \"#7171c6\", \"#8e388e\", \"#8e8e38\", \"#00c957\", \"#cc3333\", \"#d1dbdd\",\r\n ];\r\n\r\n public getColor() {\r\n return RandomMapColor.randomColorPalette[ Math.floor(Math.random() * RandomMapColor.randomColorPalette.length)];\r\n }\r\n\r\n public getColorDef() {\r\n return ColorDef.fromString(this.getColor());\r\n }\r\n}\r\n\r\n"]}
1
+ {"version":3,"file":"RandomMapColor.js","sourceRoot":"","sources":["../../../src/Feature/RandomMapColor.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,oDAA8C;AAE9C,gBAAgB;AAChB,MAAa,cAAc;IACjB,MAAM,CAAU,kBAAkB,GAAG;QAC3C,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;QACjG,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;QACjG,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;QACjG,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;QACjG,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;QACjG,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;QACjG,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;QACjG,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;KAClG,CAAC;IAEK,QAAQ;QACb,OAAO,cAAc,CAAC,kBAAkB,CAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,cAAc,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC;IAClH,CAAC;IAEM,WAAW;QAChB,OAAO,sBAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC9C,CAAC;;AAlBH,wCAmBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\nimport { ColorDef } from \"@itwin/core-common\";\n\n/** @internal */\nexport class RandomMapColor {\n private static readonly randomColorPalette = [\n \"#8c510a\", \"#bf812d\", \"#dfc27d\", \"#f6e8c3\", \"#f5f5f5\", \"#c7eae5\", \"#80cdc1\", \"#35978f\", \"#01665e\",\n \"#b2182b\", \"#d6604d\", \"#f4a582\", \"#fddbc7\", \"#f7f7f7\", \"#d1e5f0\", \"#92c5de\", \"#4393c3\", \"#2166ac\",\n \"#d73027\", \"#f46d43\", \"#fdae61\", \"#fee090\", \"#ffffbf\", \"#e0f3f8\", \"#abd9e9\", \"#74add1\", \"#4575b4\",\n \"#a6cee3\", \"#1f78b4\", \"#b2df8a\", \"#33a02c\", \"#fb9a99\", \"#e31c2c\", \"#fdbf6f\", \"#ff7f00\", \"#cab2d6\",\n \"#fbb4ae\", \"#e41a1c\", \"#377eb8\", \"#4daf4a\", \"#984ea3\", \"#ff2000\", \"#ffff33\", \"#a65628\", \"#999999\",\n \"#8dd3c7\", \"#ffffb3\", \"#bebada\", \"#fb8072\", \"#80b1d3\", \"#fdb462\", \"#b3de69\", \"#fccde5\", \"#ffa07a\",\n \"#b15928\", \"#6a3d9a\", \"#ffed6f\", \"#9e0142\", \"#5e4fa2\", \"#999900\", \"#1a9850\", \"#4d4d4d\", \"#6baed6\",\n \"#71c671\", \"#388e8e\", \"#7d9ec0\", \"#7171c6\", \"#8e388e\", \"#8e8e38\", \"#00c957\", \"#cc3333\", \"#d1dbdd\",\n ];\n\n public getColor() {\n return RandomMapColor.randomColorPalette[ Math.floor(Math.random() * RandomMapColor.randomColorPalette.length)];\n }\n\n public getColorDef() {\n return ColorDef.fromString(this.getColor());\n }\n}\n\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"GeoJSONGeometry.js","sourceRoot":"","sources":["../../../src/GeoJSON/GeoJSONGeometry.ts"],"names":[],"mappings":";;;AAqBA,gBAAgB;AAChB,MAAa,oBAAoB;IACxB,MAAM,CAAC,YAAY,CAAC,IAAsB,IAAG,OAAO,IAAI,CAAC,IAAI,KAAK,YAAY,IAAI,IAAI,CAAC,IAAI,KAAK,iBAAiB,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,IAAI,KAAK,cAAc,CAAC,CAAA,CAAC;IAC9K,MAAM,CAAC,QAAQ,CAAC,IAAsB,IAAG,OAAQ,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,IAAI,KAAK,cAAc,CAAC,CAAA,CAAC;IAC1G,MAAM,CAAC,OAAO,CAAC,IAAsB,IAAG,OAAO,IAAI,CAAC,IAAI,KAAK,OAAO,IAAI,IAAI,CAAC,IAAI,KAAK,YAAY,CAAC,CAAA,CAAC;CAC5G;AAJD,oDAIC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\nimport GeoJson from \"geojson\";\r\n\r\n/** @internal */\r\nexport type Coord = number[];\r\n\r\n/** @internal */ // Array of 2 or 3 numbers\r\nexport type RingCoords = Coord[];\r\n\r\n/** @internal */\r\nexport type MultiRingCoords = RingCoords[];\r\n\r\n/** @internal */\r\nexport interface MultiPath {\r\n lengths: number[];\r\n coords: number[];\r\n}\r\n\r\n/** @internal */\r\nexport class GeoJSONGeometryUtils {\r\n public static isRingOrPath(geom: GeoJson.Geometry) {return geom.type === \"LineString\" || geom.type === \"MultiLineString\" || geom.type === \"Polygon\" || geom.type === \"MultiPolygon\";}\r\n public static isFilled(geom: GeoJson.Geometry) {return geom.type === \"Polygon\" || geom.type === \"MultiPolygon\";}\r\n public static isPoint(geom: GeoJson.Geometry) {return geom.type === \"Point\" || geom.type === \"MultiPoint\";}\r\n}\r\n"]}
1
+ {"version":3,"file":"GeoJSONGeometry.js","sourceRoot":"","sources":["../../../src/GeoJSON/GeoJSONGeometry.ts"],"names":[],"mappings":";;;AAqBA,gBAAgB;AAChB,MAAa,oBAAoB;IACxB,MAAM,CAAC,YAAY,CAAC,IAAsB,IAAG,OAAO,IAAI,CAAC,IAAI,KAAK,YAAY,IAAI,IAAI,CAAC,IAAI,KAAK,iBAAiB,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,IAAI,KAAK,cAAc,CAAC,CAAA,CAAC;IAC9K,MAAM,CAAC,QAAQ,CAAC,IAAsB,IAAG,OAAQ,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,IAAI,KAAK,cAAc,CAAC,CAAA,CAAC;IAC1G,MAAM,CAAC,OAAO,CAAC,IAAsB,IAAG,OAAO,IAAI,CAAC,IAAI,KAAK,OAAO,IAAI,IAAI,CAAC,IAAI,KAAK,YAAY,CAAC,CAAA,CAAC;CAC5G;AAJD,oDAIC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport GeoJson from \"geojson\";\n\n/** @internal */\nexport type Coord = number[];\n\n/** @internal */ // Array of 2 or 3 numbers\nexport type RingCoords = Coord[];\n\n/** @internal */\nexport type MultiRingCoords = RingCoords[];\n\n/** @internal */\nexport interface MultiPath {\n lengths: number[];\n coords: number[];\n}\n\n/** @internal */\nexport class GeoJSONGeometryUtils {\n public static isRingOrPath(geom: GeoJson.Geometry) {return geom.type === \"LineString\" || geom.type === \"MultiLineString\" || geom.type === \"Polygon\" || geom.type === \"MultiPolygon\";}\n public static isFilled(geom: GeoJson.Geometry) {return geom.type === \"Polygon\" || geom.type === \"MultiPolygon\";}\n public static isPoint(geom: GeoJson.Geometry) {return geom.type === \"Point\" || geom.type === \"MultiPoint\";}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"GeoJSONGeometryReader.js","sourceRoot":"","sources":["../../../src/GeoJSON/GeoJSONGeometryRe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ACH,CAAC;aAAM,CAAC;YACN,MAAM,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,OAAO,EAAE,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,cAAc,CAAC,CAAC;QAC1F,CAAC;IAEH,CAAC;IAEO,KAAK,CAAC,UAAU,CAAC,IAAsB,EAAE,QAAiC,EAAE,cAAuB;QAEzG,MAAM,OAAO,GAAU,EAAE,CAAC;QAC1B,MAAM,MAAM,GAAU,EAAE,CAAC;QACzB,MAAM,SAAS,GAAG,CAAC,KAAY,EAAE,EAAE;YACjC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAChB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YACtB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QACxB,CAAC,CAAC;QAEF,IAAI,IAAI,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;YAC/B,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QACtC,CAAC;aAAM,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;YACjC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAC9B,CAAC;QAED,MAAM,QAAQ,CAAC,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,cAAc,CAAC,CAAC;IACjE,CAAC;CACF;AA5ED,sDA4EC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nimport { Logger } from \"@itwin/core-bentley\";\r\nimport { deflateCoordinates, FeatureGeometryRenderer } from \"@itwin/core-frontend\";\r\nimport GeoJson from \"geojson\";\r\nimport { Coord, GeoJSONGeometryUtils, MultiPath, MultiRingCoords, RingCoords } from \"./GeoJSONGeometry.js\";\r\n\r\nconst loggerCategory = \"MapLayersFormats.GeoJSONGeometryReader\";\r\n\r\n/** @internal */\r\nexport class GeoJSONGeometryReader {\r\n private _renderer: FeatureGeometryRenderer;\r\n\r\n public constructor(renderer: FeatureGeometryRenderer) {\r\n this._renderer = renderer;\r\n }\r\n\r\n public async readGeometry(geometry: GeoJson.Geometry) {\r\n\r\n if (GeoJSONGeometryUtils.isRingOrPath(geometry)) {\r\n await this.readRingsAndPaths(geometry, this._renderer, GeoJSONGeometryUtils.isFilled(geometry), false /* relativeCoords*/);\r\n } else if (GeoJSONGeometryUtils.isPoint(geometry)) {\r\n await this.readPoints(geometry, this._renderer, false/* relativeCoords*/);\r\n } else {\r\n Logger.logError(loggerCategory, `GeoJSONGeometryReader:readGeometry - Unknown geometry type '${geometry.type}'`);\r\n }\r\n }\r\n\r\n private async readRingsAndPaths(geometry: GeoJson.Geometry, renderer: FeatureGeometryRenderer, fill: boolean, relativeCoords: boolean) {\r\n const multiPath: MultiPath = {coords: [], lengths: []};\r\n let polys: MultiPath[] | undefined;\r\n\r\n const readPath = (ring: RingCoords, offset: number, result: MultiPath) => {\r\n const newOffset = deflateCoordinates(ring, result.coords, 2, offset);\r\n result.lengths.push(ring.length);\r\n return newOffset;\r\n };\r\n\r\n const readMultiPath = (multiRings: MultiRingCoords, result: MultiPath) => {\r\n let offset = 0;\r\n for (const ring of multiRings) {\r\n offset = readPath(ring, offset, result);\r\n }\r\n };\r\n\r\n if (geometry.type === \"LineString\") {\r\n readPath(geometry.coordinates, 0, multiPath);\r\n } else if (geometry.type === \"MultiLineString\" || geometry.type === \"Polygon\") {\r\n readMultiPath(geometry.coordinates, multiPath);\r\n } else if (geometry.type === \"MultiPolygon\") {\r\n polys = [];\r\n for (const poly of geometry.coordinates) {\r\n const tmpMultiPath: MultiPath = {coords: [], lengths: [] };\r\n readMultiPath(poly, tmpMultiPath);\r\n polys.push(tmpMultiPath);\r\n }\r\n }\r\n\r\n if (polys) {\r\n for (const poly of polys) {\r\n await renderer.renderPath(poly.lengths, poly.coords, fill, 2, relativeCoords);\r\n }\r\n } else {\r\n await renderer.renderPath(multiPath.lengths, multiPath.coords, fill, 2, relativeCoords);\r\n }\r\n\r\n }\r\n\r\n private async readPoints(geom: GeoJson.Geometry, renderer: FeatureGeometryRenderer, relativeCoords: boolean) {\r\n\r\n const lengths: Coord = [];\r\n const coords: Coord = [];\r\n const readPoint = (coord: Coord) => {\r\n lengths.push(1);\r\n coords.push(coord[0]);\r\n coords.push(coord[1]);\r\n };\r\n\r\n if (geom.type === \"MultiPoint\") {\r\n geom.coordinates.forEach(readPoint);\r\n } else if (geom.type === \"Point\") {\r\n readPoint(geom.coordinates);\r\n }\r\n\r\n await renderer.renderPoint(lengths, coords, 2, relativeCoords);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"GeoJSONGeometryReader.js","sourceRoot":"","sources":["../../../src/GeoJSON/GeoJSONGeometryReader.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,sDAA6C;AAC7C,wDAAmF;AAEnF,6DAA2G;AAE3G,MAAM,cAAc,GAAG,wCAAwC,CAAC;AAEhE,gBAAgB;AAChB,MAAa,qBAAqB;IACxB,SAAS,CAA0B;IAE3C,YAAmB,QAAiC;QAClD,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;IAC5B,CAAC;IAEM,KAAK,CAAC,YAAY,CAAC,QAA0B;QAElD,IAAI,yCAAoB,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE,CAAC;YAChD,MAAM,IAAI,CAAC,iBAAiB,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,EAAE,yCAAoB,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,mBAAmB,CAAC,CAAC;QAC7H,CAAC;aAAM,IAAI,yCAAoB,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;YAClD,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,IAAI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O,CAAC,SAAS,CAAC,CAAC;QACtC,CAAC;aAAM,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;YACjC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAC9B,CAAC;QAED,MAAM,QAAQ,CAAC,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,cAAc,CAAC,CAAC;IACjE,CAAC;CACF;AA5ED,sDA4EC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\nimport { Logger } from \"@itwin/core-bentley\";\nimport { deflateCoordinates, FeatureGeometryRenderer } from \"@itwin/core-frontend\";\nimport GeoJson from \"geojson\";\nimport { Coord, GeoJSONGeometryUtils, MultiPath, MultiRingCoords, RingCoords } from \"./GeoJSONGeometry.js\";\n\nconst loggerCategory = \"MapLayersFormats.GeoJSONGeometryReader\";\n\n/** @internal */\nexport class GeoJSONGeometryReader {\n private _renderer: FeatureGeometryRenderer;\n\n public constructor(renderer: FeatureGeometryRenderer) {\n this._renderer = renderer;\n }\n\n public async readGeometry(geometry: GeoJson.Geometry) {\n\n if (GeoJSONGeometryUtils.isRingOrPath(geometry)) {\n await this.readRingsAndPaths(geometry, this._renderer, GeoJSONGeometryUtils.isFilled(geometry), false /* relativeCoords*/);\n } else if (GeoJSONGeometryUtils.isPoint(geometry)) {\n await this.readPoints(geometry, this._renderer, false/* relativeCoords*/);\n } else {\n Logger.logError(loggerCategory, `GeoJSONGeometryReader:readGeometry - Unknown geometry type '${geometry.type}'`);\n }\n }\n\n private async readRingsAndPaths(geometry: GeoJson.Geometry, renderer: FeatureGeometryRenderer, fill: boolean, relativeCoords: boolean) {\n const multiPath: MultiPath = {coords: [], lengths: []};\n let polys: MultiPath[] | undefined;\n\n const readPath = (ring: RingCoords, offset: number, result: MultiPath) => {\n const newOffset = deflateCoordinates(ring, result.coords, 2, offset);\n result.lengths.push(ring.length);\n return newOffset;\n };\n\n const readMultiPath = (multiRings: MultiRingCoords, result: MultiPath) => {\n let offset = 0;\n for (const ring of multiRings) {\n offset = readPath(ring, offset, result);\n }\n };\n\n if (geometry.type === \"LineString\") {\n readPath(geometry.coordinates, 0, multiPath);\n } else if (geometry.type === \"MultiLineString\" || geometry.type === \"Polygon\") {\n readMultiPath(geometry.coordinates, multiPath);\n } else if (geometry.type === \"MultiPolygon\") {\n polys = [];\n for (const poly of geometry.coordinates) {\n const tmpMultiPath: MultiPath = {coords: [], lengths: [] };\n readMultiPath(poly, tmpMultiPath);\n polys.push(tmpMultiPath);\n }\n }\n\n if (polys) {\n for (const poly of polys) {\n await renderer.renderPath(poly.lengths, poly.coords, fill, 2, relativeCoords);\n }\n } else {\n await renderer.renderPath(multiPath.lengths, multiPath.coords, fill, 2, relativeCoords);\n }\n\n }\n\n private async readPoints(geom: GeoJson.Geometry, renderer: FeatureGeometryRenderer, relativeCoords: boolean) {\n\n const lengths: Coord = [];\n const coords: Coord = [];\n const readPoint = (coord: Coord) => {\n lengths.push(1);\n coords.push(coord[0]);\n coords.push(coord[1]);\n };\n\n if (geom.type === \"MultiPoint\") {\n geom.coordinates.forEach(readPoint);\n } else if (geom.type === \"Point\") {\n readPoint(geom.coordinates);\n }\n\n await renderer.renderPoint(lengths, coords, 2, relativeCoords);\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"GoogleMaps.js","sourceRoot":"","sources":["../../../src/GoogleMaps/GoogleMaps.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,oDAAiF;AAEjF,uEAAiE;AAGjE;;;EAGE;AACF,gEAAgE;AACnD,QAAA,UAAU,GAAG;IACxB;;;;;;;;;;;;;MAaE;IACF,sBAAsB,EAAE,CAAC,IAAa,EAAE,IAAqC,EAAE,EAAE;QAC/E,OAAO,mCAAqB,CAAC,QAAQ,CAAC,oCAAe,CAAC,mBAAmB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;IACzF,CAAC;IAED;;;;;;;;;;;;;MAaE;IACF,uBAAuB,EAAE,CAAC,IAAqC,EAAE,EAAE;QACjE,OAAO,kCAAoB,CAAC,QAAQ,CAAC,oCAAe,CAAC,mBAAmB,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC,CAAC;IAChG,CAAC;IAED;;;;;MAKE;IACF,yBAAyB,EAAE,CAAC,QAA+B,EAAE,EAAE;QAC7D,OAAO,oCAAe,CAAC,6BAA6B,CAAC,QAAQ,CAAC,CAAC;IACjE,CAAC;CACF,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module MapLayersFormats\r\n */\r\n\r\nimport { BaseMapLayerSettings, ImageMapLayerSettings } from \"@itwin/core-common\";\r\nimport { GoogleMapsCreateSessionOptions } from \"./GoogleMapsSession.js\";\r\nimport { GoogleMapsUtils } from \"../internal/GoogleMapsUtils.js\";\r\n\r\n\r\n/**\r\n * Google Maps API\r\n * @beta\r\n*/\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport const GoogleMaps = {\r\n /**\r\n * Creates Google Maps map-layer settings.\r\n * @param name Name of the layer (Defaults to \"GoogleMaps\")\r\n * @param opts Options to create the session (Defaults to satellite map type, English language, US region, and roadmap layer type)\r\n *\r\n * The following examples illustrates how a Googles Map layer can be attached to a viewport:\r\n * ```ts\r\n * [[include:GoogleMaps_AttachMapLayerSimple]]\r\n * ```\r\n * ```ts\r\n * [[include:GoogleMaps_AttachMapLayerOpts]]\r\n * ```\r\n * @beta\r\n */\r\n createMapLayerSettings: (name?: string, opts?: GoogleMapsCreateSessionOptions) => {\r\n return ImageMapLayerSettings.fromJSON(GoogleMapsUtils.createMapLayerProps(name, opts));\r\n },\r\n\r\n /**\r\n * Creates Google Maps base layer settings.\r\n * @param name Name of the layer (Defaults to \"GoogleMaps\")\r\n * @param opts Options to create the session (Defaults to satellite map type, English language, US region, and roadmap layer type)\r\n *\r\n * The following examples illustrates how a Google Maps base layer can be set on a viewport:\r\n * ```ts\r\n * [[include:GoogleMaps_BaseMapSimple]]\r\n * ```\r\n * ```ts\r\n * [[include:GoogleMaps_BaseMapOpts]]\r\n * ```\r\n * @beta\r\n */\r\n createBaseLayerSettings: (opts?: GoogleMapsCreateSessionOptions) => {\r\n return BaseMapLayerSettings.fromJSON(GoogleMapsUtils.createMapLayerProps(\"GoogleMaps\", opts));\r\n },\r\n\r\n /**\r\n * Read the session options from the map layer settings.\r\n * @param settings Map layer settings\r\n * ```\r\n * @beta\r\n */\r\n getMapLayerSessionOptions: (settings: ImageMapLayerSettings) => {\r\n return GoogleMapsUtils.getSessionOptionsFromMapLayer(settings);\r\n },\r\n};\r\n"]}
1
+ {"version":3,"file":"GoogleMaps.js","sourceRoot":"","sources":["../../../src/GoogleMaps/GoogleMaps.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,oDAAiF;AAEjF,uEAAiE;AAGjE;;;EAGE;AACF,gEAAgE;AACnD,QAAA,UAAU,GAAG;IACxB;;;;;;;;;;;;;MAaE;IACF,sBAAsB,EAAE,CAAC,IAAa,EAAE,IAAqC,EAAE,EAAE;QAC/E,OAAO,mCAAqB,CAAC,QAAQ,CAAC,oCAAe,CAAC,mBAAmB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;IACzF,CAAC;IAED;;;;;;;;;;;;;MAaE;IACF,uBAAuB,EAAE,CAAC,IAAqC,EAAE,EAAE;QACjE,OAAO,kCAAoB,CAAC,QAAQ,CAAC,oCAAe,CAAC,mBAAmB,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC,CAAC;IAChG,CAAC;IAED;;;;;MAKE;IACF,yBAAyB,EAAE,CAAC,QAA+B,EAAE,EAAE;QAC7D,OAAO,oCAAe,CAAC,6BAA6B,CAAC,QAAQ,CAAC,CAAC;IACjE,CAAC;CACF,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module MapLayersFormats\n */\n\nimport { BaseMapLayerSettings, ImageMapLayerSettings } from \"@itwin/core-common\";\nimport { GoogleMapsCreateSessionOptions } from \"./GoogleMapsSession.js\";\nimport { GoogleMapsUtils } from \"../internal/GoogleMapsUtils.js\";\n\n\n/**\n * Google Maps API\n * @beta\n*/\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const GoogleMaps = {\n /**\n * Creates Google Maps map-layer settings.\n * @param name Name of the layer (Defaults to \"GoogleMaps\")\n * @param opts Options to create the session (Defaults to satellite map type, English language, US region, and roadmap layer type)\n *\n * The following examples illustrates how a Googles Map layer can be attached to a viewport:\n * ```ts\n * [[include:GoogleMaps_AttachMapLayerSimple]]\n * ```\n * ```ts\n * [[include:GoogleMaps_AttachMapLayerOpts]]\n * ```\n * @beta\n */\n createMapLayerSettings: (name?: string, opts?: GoogleMapsCreateSessionOptions) => {\n return ImageMapLayerSettings.fromJSON(GoogleMapsUtils.createMapLayerProps(name, opts));\n },\n\n /**\n * Creates Google Maps base layer settings.\n * @param name Name of the layer (Defaults to \"GoogleMaps\")\n * @param opts Options to create the session (Defaults to satellite map type, English language, US region, and roadmap layer type)\n *\n * The following examples illustrates how a Google Maps base layer can be set on a viewport:\n * ```ts\n * [[include:GoogleMaps_BaseMapSimple]]\n * ```\n * ```ts\n * [[include:GoogleMaps_BaseMapOpts]]\n * ```\n * @beta\n */\n createBaseLayerSettings: (opts?: GoogleMapsCreateSessionOptions) => {\n return BaseMapLayerSettings.fromJSON(GoogleMapsUtils.createMapLayerProps(\"GoogleMaps\", opts));\n },\n\n /**\n * Read the session options from the map layer settings.\n * @param settings Map layer settings\n * ```\n * @beta\n */\n getMapLayerSessionOptions: (settings: ImageMapLayerSettings) => {\n return GoogleMapsUtils.getSessionOptionsFromMapLayer(settings);\n },\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"GoogleMapsImageryFormat.js","sourceRoot":"","sources":["../../../src/GoogleMaps/GoogleMapsImageryFormat.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,wDAAsF;AACtF,iFAA2E;AAC3E,gEAA0D;AAE1D;;;GAGG;AACH,MAAa,wBAAyB,SAAQ,qCAAqB;IACjE;;OAEG;IACI,MAAM,CAAU,QAAQ,GAAG,YAAY,CAAC;IAE/C,gBAAgB;IACT,MAAM,CAAU,qBAAqB,CAAC,QAA+B;QAC1E,OAAO,IAAI,wDAAyB,CAAC,QAAQ,EAAE,sCAAgB,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC;IAClG,CAAC;;AATH,4DAUC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module MapLayersFormats\r\n */\r\n\r\nimport { ImageMapLayerSettings } from \"@itwin/core-common\";\r\nimport { ImageryMapLayerFormat, MapLayerImageryProvider } from \"@itwin/core-frontend\";\r\nimport { GoogleMapsImageryProvider } from \"./GoogleMapsImageryProvider.js\";\r\nimport { MapLayersFormats } from \"../mapLayersFormats.js\";\r\n\r\n/**\r\n * Google Maps imagery layer format.\r\n * @public\r\n */\r\nexport class GoogleMapsMapLayerFormat extends ImageryMapLayerFormat {\r\n /** Google Maps imagery layer format.\r\n * @public\r\n */\r\n public static override formatId = \"GoogleMaps\";\r\n\r\n /** @internal */\r\n public static override createImageryProvider(settings: ImageMapLayerSettings): MapLayerImageryProvider | undefined {\r\n return new GoogleMapsImageryProvider(settings, MapLayersFormats.googleMapsOpts?.sessionManager);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"GoogleMapsImageryFormat.js","sourceRoot":"","sources":["../../../src/GoogleMaps/GoogleMapsImageryFormat.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,wDAAsF;AACtF,iFAA2E;AAC3E,gEAA0D;AAE1D;;;GAGG;AACH,MAAa,wBAAyB,SAAQ,qCAAqB;IACjE;;OAEG;IACI,MAAM,CAAU,QAAQ,GAAG,YAAY,CAAC;IAE/C,gBAAgB;IACT,MAAM,CAAU,qBAAqB,CAAC,QAA+B;QAC1E,OAAO,IAAI,wDAAyB,CAAC,QAAQ,EAAE,sCAAgB,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC;IAClG,CAAC;;AATH,4DAUC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module MapLayersFormats\n */\n\nimport { ImageMapLayerSettings } from \"@itwin/core-common\";\nimport { ImageryMapLayerFormat, MapLayerImageryProvider } from \"@itwin/core-frontend\";\nimport { GoogleMapsImageryProvider } from \"./GoogleMapsImageryProvider.js\";\nimport { MapLayersFormats } from \"../mapLayersFormats.js\";\n\n/**\n * Google Maps imagery layer format.\n * @public\n */\nexport class GoogleMapsMapLayerFormat extends ImageryMapLayerFormat {\n /** Google Maps imagery layer format.\n * @public\n */\n public static override formatId = \"GoogleMaps\";\n\n /** @internal */\n public static override createImageryProvider(settings: ImageMapLayerSettings): MapLayerImageryProvider | undefined {\n return new GoogleMapsImageryProvider(settings, MapLayersFormats.googleMapsOpts?.sessionManager);\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"GoogleMapsImageryProvider.js","sourceRoot":"","sources":["../../../src/GoogleMaps/GoogleMapsImageryProvider.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;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AE,YAAY;SACrB,CAAC,CAAC,CAAC;IACN,CAAC;CACF;AAtOD,8DAsOC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module MapLayersFormats\r\n */\r\n\r\nimport { BentleyError, BentleyStatus, Logger } from \"@itwin/core-bentley\";\r\nimport { ImageMapLayerSettings, ImageSource } from \"@itwin/core-common\";\r\nimport { DecorateContext, GoogleMapsDecorator, IModelApp, MapCartoRectangle, MapLayerImageryProvider, MapTile, QuadIdProps, ScreenViewport, Tile } from \"@itwin/core-frontend\";\r\nimport { GoogleMapsCreateSessionOptions, GoogleMapsLayerTypes, GoogleMapsMapTypes, GoogleMapsScaleFactors, GoogleMapsSession, GoogleMapsSessionManager, ViewportInfo } from \"./GoogleMapsSession.js\";\r\nimport { NativeGoogleMapsSessionManager } from \"../internal/NativeGoogleMapsSession.js\";\r\nimport { GoogleMapsUtils } from \"../internal/GoogleMapsUtils.js\";\r\n\r\nconst loggerCategory = \"MapLayersFormats.GoogleMaps\";\r\n\r\n/*\r\n* Google Maps imagery provider\r\n* @beta\r\n*/\r\nexport class GoogleMapsImageryProvider extends MapLayerImageryProvider {\r\n\r\n private _decorator: GoogleMapsDecorator;\r\n private _hadUnrecoverableError = false;\r\n private _tileSize = 256;\r\n private _sessionManager?: GoogleMapsSessionManager;\r\n private _sessionOptions: GoogleMapsCreateSessionOptions|undefined;\r\n private _activeSession?: GoogleMapsSession;\r\n constructor(settings: ImageMapLayerSettings, sessionManager?: GoogleMapsSessionManager) {\r\n super(settings, true);\r\n this._decorator = new GoogleMapsDecorator();\r\n this._sessionManager = sessionManager;\r\n }\r\n public override get tileSize(): number { return this._tileSize; }\r\n\r\n public override async initialize(): Promise<void> {\r\n this._sessionOptions = GoogleMapsUtils.getSessionOptionsFromMapLayer(this._settings);\r\n this._sessionManager = await this.getSessionManager();\r\n this._activeSession = await this._sessionManager.createSession(this._sessionOptions);;\r\n this._tileSize = this._activeSession.getTileSize();\r\n const isActivated = await this._decorator.activate(this._settings.properties!.mapType as GoogleMapsMapTypes);\r\n if (!isActivated) {\r\n const msg = `Failed to activate decorator`;\r\n Logger.logError(loggerCategory, msg);\r\n throw new BentleyError(BentleyStatus.ERROR, msg);\r\n }\r\n }\r\n\r\n protected async getSessionManager(): Promise<GoogleMapsSessionManager> {\r\n if (this._sessionManager)\r\n return this._sessionManager;\r\n\r\n if (this._settings.accessKey?.value) {\r\n return new NativeGoogleMapsSessionManager(this._settings.accessKey.value);\r\n } else {\r\n const msg = `Missing GoogleMaps api key`;\r\n Logger.logError(loggerCategory, msg);\r\n throw new BentleyError(BentleyStatus.ERROR, msg);\r\n }\r\n }\r\n\r\n protected createCreateSessionOptions(settings: ImageMapLayerSettings): GoogleMapsCreateSessionOptions {\r\n const layerPropertyKeys = settings.properties ? Object.keys(settings.properties) : undefined;\r\n if (layerPropertyKeys === undefined ||\r\n !layerPropertyKeys.includes(\"mapType\") ||\r\n !layerPropertyKeys.includes(\"language\") ||\r\n !layerPropertyKeys.includes(\"region\")) {\r\n const msg = \"Missing session options\";\r\n Logger.logError(loggerCategory, msg);\r\n throw new BentleyError(BentleyStatus.ERROR, msg);\r\n }\r\n\r\n const createSessionOptions: GoogleMapsCreateSessionOptions = {\r\n mapType: settings.properties!.mapType as GoogleMapsMapTypes,\r\n region: this._settings.properties!.region as string,\r\n language: this._settings.properties!.language as string,\r\n }\r\n\r\n if (Array.isArray(this._settings.properties?.layerTypes) && this._settings.properties.layerTypes.length > 0) {\r\n createSessionOptions.layerTypes = this._settings.properties.layerTypes as GoogleMapsLayerTypes[];\r\n }\r\n\r\n if (this._settings.properties?.scale !== undefined) {\r\n createSessionOptions.scale = this._settings.properties.scale as GoogleMapsScaleFactors;\r\n }\r\n\r\n if (this._settings.properties?.overlay !== undefined) {\r\n createSessionOptions.overlay = this._settings.properties.overlay as boolean;\r\n }\r\n\r\n if (this._settings.properties?.apiOptions !== undefined) {\r\n createSessionOptions.apiOptions = this._settings.properties.apiOptions as string[];\r\n }\r\n return createSessionOptions;\r\n }\r\n\r\n // not used, see loadTile\r\n public async constructUrl(_row: number, _column: number, _level: number): Promise<string> {\r\n return \"\";\r\n }\r\n\r\n public async fetchViewportInfo(rectangle: MapCartoRectangle, zoomLevel: number): Promise<ViewportInfo> {\r\n if (!this._activeSession) {\r\n Logger.logError(loggerCategory, `Session is not initialized`);\r\n throw new BentleyError(BentleyStatus.ERROR, \"Session is not initialized\");\r\n }\r\n\r\n const req = this._activeSession.getViewportInfoRequest(rectangle, zoomLevel);\r\n const request = new Request(req.url, {method: \"GET\"});\r\n if (req.authorization) {\r\n request.headers.set(\"Authorization\", req.authorization);\r\n }\r\n // Add the session token to the request\r\n const response = await fetch(request);\r\n if (!response.ok) {\r\n Logger.logError(loggerCategory, `Error while loading viewport info: ${response.statusText}`);\r\n throw new BentleyError(BentleyStatus.ERROR, `Error while loading viewport info: ${response.statusText}`);\r\n }\r\n return response.json() as Promise<ViewportInfo>;\r\n }\r\n\r\n private async fetchAttributions(tiles: Set<Tile>): Promise<string[]> {\r\n const zooms = new Set<number>();\r\n const matchingAttributions: string[] = [];\r\n\r\n // Viewport info requests must be made for a specific zoom level\r\n tiles.forEach((tile) => zooms.add(tile.depth));\r\n\r\n for (const zoom of zooms) {\r\n let cartoRect: MapCartoRectangle|undefined;\r\n for (const tile of tiles) {\r\n if (tile.depth === zoom && tile instanceof MapTile) {\r\n const extent = this.getEPSG4326Extent(tile.quadId.row, tile.quadId.column, tile.depth);\r\n const rect = MapCartoRectangle.fromDegrees(extent.longitudeLeft, extent.latitudeBottom, extent.longitudeRight, extent.latitudeTop)\r\n if (cartoRect)\r\n cartoRect.union(rect);\r\n else\r\n cartoRect = rect;\r\n }\r\n }\r\n if (cartoRect && this._activeSession) {\r\n try {\r\n const viewportInfo = await this.fetchViewportInfo(cartoRect, zoom);\r\n if (viewportInfo?.copyright) {\r\n matchingAttributions.push(viewportInfo.copyright);\r\n }\r\n } catch (error:any) {\r\n Logger.logError(loggerCategory, `Error while loading viewport info: ${error?.message??\"Unknown error\"}`);\r\n }\r\n }\r\n }\r\n\r\n return matchingAttributions;\r\n }\r\n private async logJsonError(tileResponse: Response) {\r\n try {\r\n const error = await tileResponse.json();\r\n Logger.logError(loggerCategory, `Error while loading tile: ${error?.message}`);\r\n } catch {\r\n Logger.logError(loggerCategory, `Error while loading tile: ${tileResponse.statusText}`);\r\n }\r\n }\r\n\r\n public override async loadTile(row: number, column: number, zoomLevel: number): Promise<ImageSource | undefined> {\r\n const tilePos: QuadIdProps = {row, column, level: zoomLevel};\r\n if (this._hadUnrecoverableError)\r\n return undefined;\r\n\r\n if (this._activeSession === undefined || this._sessionOptions === undefined) {\r\n Logger.logError(loggerCategory, `Session manager is not initialized`);\r\n return undefined;\r\n }\r\n\r\n try {\r\n let tileRequest = this._activeSession.getTileRequest(tilePos);\r\n let tileResponse: Response = await this.makeTileRequest(tileRequest.url.toString(), undefined, tileRequest.authorization);\r\n if (!tileResponse.ok) {\r\n if (tileResponse.headers.get(\"content-type\")?.includes(\"application/json\") && this._sessionManager) {\r\n try {\r\n // Session might have expired, lets try to refresh it\r\n this._activeSession = await this._sessionManager.createSession(this._sessionOptions);\r\n tileRequest = this._activeSession.getTileRequest(tilePos);\r\n tileResponse = await this.makeTileRequest(tileRequest.url.toString(), undefined, tileRequest.authorization);\r\n if (!tileResponse.ok) {\r\n if (tileResponse.headers.get(\"content-type\")?.includes(\"application/json\")) {\r\n await this.logJsonError(tileResponse);\r\n } else {\r\n Logger.logError(loggerCategory, `Error while loading tile: ${tileResponse.statusText}`);\r\n }\r\n this._hadUnrecoverableError = true; // Prevent from doing more invalid requests\r\n return undefined;\r\n }\r\n }\r\n catch {\r\n await this.logJsonError(tileResponse);\r\n }\r\n } else {\r\n Logger.logError(loggerCategory, `Error while loading tile: ${tileResponse.statusText}`);\r\n return undefined;\r\n }\r\n }\r\n return await this.getImageFromTileResponse(tileResponse, zoomLevel);\r\n } catch (error: any) {\r\n if (error?.code === 401) {\r\n Logger.logError(loggerCategory, `Authorize to load tile: ${error.message}`);\r\n } else {\r\n Logger.logError(loggerCategory, `Error while loading tile: ${error.message}`);\r\n }\r\n return undefined;\r\n }\r\n }\r\n\r\n public override decorate(context: DecorateContext): void {\r\n this._decorator.decorate(context);\r\n }\r\n\r\n private getSelectedTiles(vp: ScreenViewport) {\r\n return IModelApp.tileAdmin.getTilesForUser(vp)?.selected;\r\n }\r\n\r\n public override async addAttributions(cards: HTMLTableElement, vp: ScreenViewport): Promise<void> {\r\n let copyrightMsg = \"\";\r\n const tiles = this.getSelectedTiles(vp);\r\n if (tiles) {\r\n try {\r\n const attrList = await this.fetchAttributions(tiles);\r\n for (const attr of attrList) {\r\n attr.split(\",\").forEach((line) => {\r\n // Attempt to reduce duplicates, since if there are multiple zoom levels sometimes the same info is returned\r\n if (!copyrightMsg.includes(line)) {\r\n copyrightMsg += `${copyrightMsg.length === 0 ? \"\": \"<br>\"}${line}`;\r\n }\r\n });\r\n }\r\n }\r\n catch (error: any) {\r\n Logger.logError(loggerCategory, `Error while loading attributions: ${error?.message??\"Unknown error\"}`);\r\n }\r\n }\r\n\r\n const iconSrc = document.createElement(\"img\");\r\n iconSrc.src = `${IModelApp.publicPath}images/GoogleMaps_Logo_Gray.svg`;\r\n iconSrc.style.padding = \"10px 10px 5px 10px\";\r\n\r\n cards.appendChild(IModelApp.makeLogoCard({\r\n iconSrc,\r\n heading: \"Google Maps\",\r\n notice: copyrightMsg\r\n }));\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"GoogleMapsImageryProvider.js","sourceRoot":"","sources":["../../../src/GoogleMaps/GoogleMapsImageryProvider.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA0E;AAE1E,wDAA+K;AAE/K,uFAAwF;AACxF,uEAAiE;AAEjE,MAAM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["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module MapLayersFormats\n */\n\nimport { BentleyError, BentleyStatus, Logger } from \"@itwin/core-bentley\";\nimport { ImageMapLayerSettings, ImageSource } from \"@itwin/core-common\";\nimport { DecorateContext, GoogleMapsDecorator, IModelApp, MapCartoRectangle, MapLayerImageryProvider, MapTile, QuadIdProps, ScreenViewport, Tile } from \"@itwin/core-frontend\";\nimport { GoogleMapsCreateSessionOptions, GoogleMapsLayerTypes, GoogleMapsMapTypes, GoogleMapsScaleFactors, GoogleMapsSession, GoogleMapsSessionManager, ViewportInfo } from \"./GoogleMapsSession.js\";\nimport { NativeGoogleMapsSessionManager } from \"../internal/NativeGoogleMapsSession.js\";\nimport { GoogleMapsUtils } from \"../internal/GoogleMapsUtils.js\";\n\nconst loggerCategory = \"MapLayersFormats.GoogleMaps\";\n\n/*\n* Google Maps imagery provider\n* @beta\n*/\nexport class GoogleMapsImageryProvider extends MapLayerImageryProvider {\n\n private _decorator: GoogleMapsDecorator;\n private _hadUnrecoverableError = false;\n private _tileSize = 256;\n private _sessionManager?: GoogleMapsSessionManager;\n private _sessionOptions: GoogleMapsCreateSessionOptions|undefined;\n private _activeSession?: GoogleMapsSession;\n constructor(settings: ImageMapLayerSettings, sessionManager?: GoogleMapsSessionManager) {\n super(settings, true);\n this._decorator = new GoogleMapsDecorator();\n this._sessionManager = sessionManager;\n }\n public override get tileSize(): number { return this._tileSize; }\n\n public override async initialize(): Promise<void> {\n this._sessionOptions = GoogleMapsUtils.getSessionOptionsFromMapLayer(this._settings);\n this._sessionManager = await this.getSessionManager();\n this._activeSession = await this._sessionManager.createSession(this._sessionOptions);;\n this._tileSize = this._activeSession.getTileSize();\n const isActivated = await this._decorator.activate(this._settings.properties!.mapType as GoogleMapsMapTypes);\n if (!isActivated) {\n const msg = `Failed to activate decorator`;\n Logger.logError(loggerCategory, msg);\n throw new BentleyError(BentleyStatus.ERROR, msg);\n }\n }\n\n protected async getSessionManager(): Promise<GoogleMapsSessionManager> {\n if (this._sessionManager)\n return this._sessionManager;\n\n if (this._settings.accessKey?.value) {\n return new NativeGoogleMapsSessionManager(this._settings.accessKey.value);\n } else {\n const msg = `Missing GoogleMaps api key`;\n Logger.logError(loggerCategory, msg);\n throw new BentleyError(BentleyStatus.ERROR, msg);\n }\n }\n\n protected createCreateSessionOptions(settings: ImageMapLayerSettings): GoogleMapsCreateSessionOptions {\n const layerPropertyKeys = settings.properties ? Object.keys(settings.properties) : undefined;\n if (layerPropertyKeys === undefined ||\n !layerPropertyKeys.includes(\"mapType\") ||\n !layerPropertyKeys.includes(\"language\") ||\n !layerPropertyKeys.includes(\"region\")) {\n const msg = \"Missing session options\";\n Logger.logError(loggerCategory, msg);\n throw new BentleyError(BentleyStatus.ERROR, msg);\n }\n\n const createSessionOptions: GoogleMapsCreateSessionOptions = {\n mapType: settings.properties!.mapType as GoogleMapsMapTypes,\n region: this._settings.properties!.region as string,\n language: this._settings.properties!.language as string,\n }\n\n if (Array.isArray(this._settings.properties?.layerTypes) && this._settings.properties.layerTypes.length > 0) {\n createSessionOptions.layerTypes = this._settings.properties.layerTypes as GoogleMapsLayerTypes[];\n }\n\n if (this._settings.properties?.scale !== undefined) {\n createSessionOptions.scale = this._settings.properties.scale as GoogleMapsScaleFactors;\n }\n\n if (this._settings.properties?.overlay !== undefined) {\n createSessionOptions.overlay = this._settings.properties.overlay as boolean;\n }\n\n if (this._settings.properties?.apiOptions !== undefined) {\n createSessionOptions.apiOptions = this._settings.properties.apiOptions as string[];\n }\n return createSessionOptions;\n }\n\n // not used, see loadTile\n public async constructUrl(_row: number, _column: number, _level: number): Promise<string> {\n return \"\";\n }\n\n public async fetchViewportInfo(rectangle: MapCartoRectangle, zoomLevel: number): Promise<ViewportInfo> {\n if (!this._activeSession) {\n Logger.logError(loggerCategory, `Session is not initialized`);\n throw new BentleyError(BentleyStatus.ERROR, \"Session is not initialized\");\n }\n\n const req = this._activeSession.getViewportInfoRequest(rectangle, zoomLevel);\n const request = new Request(req.url, {method: \"GET\"});\n if (req.authorization) {\n request.headers.set(\"Authorization\", req.authorization);\n }\n // Add the session token to the request\n const response = await fetch(request);\n if (!response.ok) {\n Logger.logError(loggerCategory, `Error while loading viewport info: ${response.statusText}`);\n throw new BentleyError(BentleyStatus.ERROR, `Error while loading viewport info: ${response.statusText}`);\n }\n return response.json() as Promise<ViewportInfo>;\n }\n\n private async fetchAttributions(tiles: Set<Tile>): Promise<string[]> {\n const zooms = new Set<number>();\n const matchingAttributions: string[] = [];\n\n // Viewport info requests must be made for a specific zoom level\n tiles.forEach((tile) => zooms.add(tile.depth));\n\n for (const zoom of zooms) {\n let cartoRect: MapCartoRectangle|undefined;\n for (const tile of tiles) {\n if (tile.depth === zoom && tile instanceof MapTile) {\n const extent = this.getEPSG4326Extent(tile.quadId.row, tile.quadId.column, tile.depth);\n const rect = MapCartoRectangle.fromDegrees(extent.longitudeLeft, extent.latitudeBottom, extent.longitudeRight, extent.latitudeTop)\n if (cartoRect)\n cartoRect.union(rect);\n else\n cartoRect = rect;\n }\n }\n if (cartoRect && this._activeSession) {\n try {\n const viewportInfo = await this.fetchViewportInfo(cartoRect, zoom);\n if (viewportInfo?.copyright) {\n matchingAttributions.push(viewportInfo.copyright);\n }\n } catch (error:any) {\n Logger.logError(loggerCategory, `Error while loading viewport info: ${error?.message??\"Unknown error\"}`);\n }\n }\n }\n\n return matchingAttributions;\n }\n private async logJsonError(tileResponse: Response) {\n try {\n const error = await tileResponse.json();\n Logger.logError(loggerCategory, `Error while loading tile: ${error?.message}`);\n } catch {\n Logger.logError(loggerCategory, `Error while loading tile: ${tileResponse.statusText}`);\n }\n }\n\n public override async loadTile(row: number, column: number, zoomLevel: number): Promise<ImageSource | undefined> {\n const tilePos: QuadIdProps = {row, column, level: zoomLevel};\n if (this._hadUnrecoverableError)\n return undefined;\n\n if (this._activeSession === undefined || this._sessionOptions === undefined) {\n Logger.logError(loggerCategory, `Session manager is not initialized`);\n return undefined;\n }\n\n try {\n let tileRequest = this._activeSession.getTileRequest(tilePos);\n let tileResponse: Response = await this.makeTileRequest(tileRequest.url.toString(), undefined, tileRequest.authorization);\n if (!tileResponse.ok) {\n if (tileResponse.headers.get(\"content-type\")?.includes(\"application/json\") && this._sessionManager) {\n try {\n // Session might have expired, lets try to refresh it\n this._activeSession = await this._sessionManager.createSession(this._sessionOptions);\n tileRequest = this._activeSession.getTileRequest(tilePos);\n tileResponse = await this.makeTileRequest(tileRequest.url.toString(), undefined, tileRequest.authorization);\n if (!tileResponse.ok) {\n if (tileResponse.headers.get(\"content-type\")?.includes(\"application/json\")) {\n await this.logJsonError(tileResponse);\n } else {\n Logger.logError(loggerCategory, `Error while loading tile: ${tileResponse.statusText}`);\n }\n this._hadUnrecoverableError = true; // Prevent from doing more invalid requests\n return undefined;\n }\n }\n catch {\n await this.logJsonError(tileResponse);\n }\n } else {\n Logger.logError(loggerCategory, `Error while loading tile: ${tileResponse.statusText}`);\n return undefined;\n }\n }\n return await this.getImageFromTileResponse(tileResponse, zoomLevel);\n } catch (error: any) {\n if (error?.code === 401) {\n Logger.logError(loggerCategory, `Authorize to load tile: ${error.message}`);\n } else {\n Logger.logError(loggerCategory, `Error while loading tile: ${error.message}`);\n }\n return undefined;\n }\n }\n\n public override decorate(context: DecorateContext): void {\n this._decorator.decorate(context);\n }\n\n private getSelectedTiles(vp: ScreenViewport) {\n return IModelApp.tileAdmin.getTilesForUser(vp)?.selected;\n }\n\n public override async addAttributions(cards: HTMLTableElement, vp: ScreenViewport): Promise<void> {\n let copyrightMsg = \"\";\n const tiles = this.getSelectedTiles(vp);\n if (tiles) {\n try {\n const attrList = await this.fetchAttributions(tiles);\n for (const attr of attrList) {\n attr.split(\",\").forEach((line) => {\n // Attempt to reduce duplicates, since if there are multiple zoom levels sometimes the same info is returned\n if (!copyrightMsg.includes(line)) {\n copyrightMsg += `${copyrightMsg.length === 0 ? \"\": \"<br>\"}${line}`;\n }\n });\n }\n }\n catch (error: any) {\n Logger.logError(loggerCategory, `Error while loading attributions: ${error?.message??\"Unknown error\"}`);\n }\n }\n\n const iconSrc = document.createElement(\"img\");\n iconSrc.src = `${IModelApp.publicPath}images/GoogleMaps_Logo_Gray.svg`;\n iconSrc.style.padding = \"10px 10px 5px 10px\";\n\n cards.appendChild(IModelApp.makeLogoCard({\n iconSrc,\n heading: \"Google Maps\",\n notice: copyrightMsg\n }));\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"GoogleMapsSession.js","sourceRoot":"","sources":["../../../src/GoogleMaps/GoogleMapsSession.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAoFF,CAAC;AAsBD,CAAC;AAsDF;;;EAGE;AACF,MAAsB,qBAAqB;IAG/B,kBAAkB,CAAC,QAAqB;QAChD,MAAM,OAAO,GAAG,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACzC,MAAM,MAAM,GAAG,GAAG,OAAO,IAAI,QAAQ,CAAC,KAAK,IAAI,QAAQ,CAAC,MAAM,IAAI,QAAQ,CAAC,GAAG,EAAE,CAAC;QACjF,OAAO,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC;IACzB,CAAC;CAKF;AAZD,sDAYC;AAED;;;EAGE;AACF,MAAsB,wBAAwB;IAC5B,IAAI,GAAG,0BAA0B,CAAC;CAEnD;AAHD,4DAGC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module MapLayersFormats\r\n */\r\n\r\nimport { MapCartoRectangle, QuadIdProps} from \"@itwin/core-frontend\";\r\n\r\n\r\n/**\r\n * The type of base map .\r\n * @beta*/\r\nexport type GoogleMapsLayerTypes = \"layerRoadmap\" | \"layerStreetview\";\r\n\r\n/**\r\n * Layer types that can be added to the map.\r\n * @beta\r\n * */\r\nexport type GoogleMapsMapTypes = \"roadmap\"|\"satellite\"|\"terrain\";\r\n\r\n/**\r\n * Scale factors that can be applied to labels and objects in the map.\r\n * @beta\r\n * */\r\nexport type GoogleMapsScaleFactors = \"scaleFactor1x\" | \"scaleFactor2x\" | \"scaleFactor4x\";\r\n\r\n/**\r\n* Represents the options to create a Google Maps session.\r\n* @beta\r\n*/\r\nexport interface GoogleMapsCreateSessionOptions {\r\n /**\r\n * The type of base map.\r\n *\r\n * `roadmap`: The standard Google Maps painted map tiles.\r\n *\r\n * `satellite`: Satellite imagery.\r\n *\r\n * `terrain`: Terrain imagery. When selecting `terrain` as the map type, you must also include the `layerRoadmap` layer type.\r\n * @beta\r\n * */\r\n mapType: GoogleMapsMapTypes,\r\n /**\r\n * An {@link https://en.wikipedia.org/wiki/IETF_language_tag | IETF language tag} that specifies the language used to display information on the tiles. For example, `en-US` specifies the English language as spoken in the United States.\r\n */\r\n language: string;\r\n /**\r\n * A {@link https://cldr.unicode.org/ | Common Locale Data Repository} region identifier (two uppercase letters) that represents the physical location of the user. For example, `US`.\r\n */\r\n region: string;\r\n\r\n /**\r\n * An array of values that specifies the layer types added to the map.\r\n *\r\n * `layerRoadmap`: Required if you specify terrain as the map type. Can also be optionally overlaid on the satellite map type. Has no effect on roadmap tiles.\r\n *\r\n * `layerStreetview`: Shows Street View-enabled streets and locations using blue outlines on the map.\r\n *\r\n * @beta\r\n * */\r\n layerTypes?: GoogleMapsLayerTypes[];\r\n\r\n /**\r\n * Scales-up the size of map elements (such as road labels), while retaining the tile size and coverage area of the default tile.\r\n * Increasing the scale also reduces the number of labels on the map, which reduces clutter.\r\n *\r\n * `scaleFactor1x`: The default.\r\n *\r\n * `scaleFactor2x`: Doubles label size and removes minor feature labels.\r\n *\r\n * `scaleFactor4x`: Quadruples label size and removes minor feature labels.\r\n * @beta\r\n * */\r\n scale?: GoogleMapsScaleFactors\r\n\r\n /**\r\n * A boolean value that specifies whether layerTypes should be rendered as a separate overlay, or combined with the base imagery.\r\n * When true, the base map isn't displayed. If you haven't defined any layerTypes, then this value is ignored.\r\n * Default is false.\r\n * @beta\r\n * */\r\n overlay? : boolean;\r\n\r\n /**\r\n * An array of values specifying additional options to apply.\r\n * @beta\r\n * */\r\n apiOptions?: string[];\r\n};\r\n\r\n\r\n/**\r\n* Session data returned by the Google Maps API.\r\n* @beta\r\n*/\r\nexport interface GoogleMapsSessionData {\r\n /** A session token value that you must include in all of your Map Tiles API requests. */\r\n session: string;\r\n\r\n /** string that contains the time (in seconds since the epoch) at which the token expires. A session token is valid for two weeks from its creation time, but this policy might change without notice. */\r\n expiry: number;\r\n\r\n /** The width of the tiles measured in pixels. */\r\n tileWidth: number;\r\n\r\n /** he height of the tiles measured in pixels. */\r\n tileHeight: number;\r\n\r\n /** The image format, which can be either `png` or `jpeg`. */\r\n imageFormat: string;\r\n};\r\n\r\n/**\r\n * Maximum zoom level available within a bounding rectangle.\r\n* @beta\r\n*/\r\nexport interface MaxZoomRectangle {\r\n maxZoom: number;\r\n north: number;\r\n south: number;\r\n east: number;\r\n west: number;\r\n}\r\n\r\n/**\r\n * Indicate which areas of given viewport have imagery, and at which zoom levels.\r\n * @beta\r\n*/\r\nexport interface ViewportInfo {\r\n /** Attribution string that you must display on your map when you display roadmap and satellite tiles. */\r\n copyright: string;\r\n\r\n /** Array of bounding rectangles that overlap with the current viewport. Also contains the maximum zoom level available within each rectangle.. */\r\n maxZoomRects: MaxZoomRectangle[];\r\n}\r\n\r\n\r\n/**\r\n* Google Maps Request\r\n* @beta\r\n*/\r\nexport interface GoogleMapsRequest {\r\n /** The URL of the request */\r\n url: URL;\r\n\r\n /* Authorization header for the request */\r\n authorization?: string;\r\n}\r\n\r\n/**\r\n* Google Maps session.\r\n* @beta\r\n*/\r\nexport interface GoogleMapsSession {\r\n /* Tile size in pixels */\r\n getTileSize: () => number;\r\n\r\n /* Tile URL for the given tile position */\r\n getTileRequest: (position: QuadIdProps) => GoogleMapsRequest;\r\n\r\n /* Viewport information request */\r\n getViewportInfoRequest (rectangle: MapCartoRectangle, zoomLevel: number): GoogleMapsRequest\r\n}\r\n\r\n/**\r\n* Base implementation of Google Maps session.\r\n* @beta\r\n*/\r\nexport abstract class BaseGoogleMapsSession implements GoogleMapsSession {\r\n protected abstract getTileApiBaseUrl(): string;\r\n\r\n protected getTilePositionUrl(position: QuadIdProps) {\r\n const baseUrl = this.getTileApiBaseUrl();\r\n const tmpUrl = `${baseUrl}/${position.level}/${position.column}/${position.row}`;\r\n return new URL(tmpUrl);\r\n }\r\n\r\n public abstract getTileSize(): number;\r\n public abstract getTileRequest(position: QuadIdProps): GoogleMapsRequest;\r\n public abstract getViewportInfoRequest (rectangle: MapCartoRectangle, zoomLevel: number): GoogleMapsRequest\r\n}\r\n\r\n/**\r\n* Google Maps session manager interface.\r\n* @beta\r\n*/\r\nexport abstract class GoogleMapsSessionManager {\r\n public readonly type = \"GoogleMapsSessionManager\";\r\n public abstract createSession (sessionOptions: GoogleMapsCreateSessionOptions): Promise<GoogleMapsSession>;\r\n}\r\n"]}
1
+ {"version":3,"file":"GoogleMapsSession.js","sourceRoot":"","sources":["../../../src/GoogleMaps/GoogleMapsSession.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAoFF,CAAC;AAsBD,CAAC;AAsDF;;;EAGE;AACF,MAAsB,qBAAqB;IAG/B,kBAAkB,CAAC,QAAqB;QAChD,MAAM,OAAO,GAAG,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACzC,MAAM,MAAM,GAAG,GAAG,OAAO,IAAI,QAAQ,CAAC,KAAK,IAAI,QAAQ,CAAC,MAAM,IAAI,QAAQ,CAAC,GAAG,EAAE,CAAC;QACjF,OAAO,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC;IACzB,CAAC;CAKF;AAZD,sDAYC;AAED;;;EAGE;AACF,MAAsB,wBAAwB;IAC5B,IAAI,GAAG,0BAA0B,CAAC;CAEnD;AAHD,4DAGC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module MapLayersFormats\n */\n\nimport { MapCartoRectangle, QuadIdProps} from \"@itwin/core-frontend\";\n\n\n/**\n * The type of base map .\n * @beta*/\nexport type GoogleMapsLayerTypes = \"layerRoadmap\" | \"layerStreetview\";\n\n/**\n * Layer types that can be added to the map.\n * @beta\n * */\nexport type GoogleMapsMapTypes = \"roadmap\"|\"satellite\"|\"terrain\";\n\n/**\n * Scale factors that can be applied to labels and objects in the map.\n * @beta\n * */\nexport type GoogleMapsScaleFactors = \"scaleFactor1x\" | \"scaleFactor2x\" | \"scaleFactor4x\";\n\n/**\n* Represents the options to create a Google Maps session.\n* @beta\n*/\nexport interface GoogleMapsCreateSessionOptions {\n /**\n * The type of base map.\n *\n * `roadmap`: The standard Google Maps painted map tiles.\n *\n * `satellite`: Satellite imagery.\n *\n * `terrain`: Terrain imagery. When selecting `terrain` as the map type, you must also include the `layerRoadmap` layer type.\n * @beta\n * */\n mapType: GoogleMapsMapTypes,\n /**\n * An {@link https://en.wikipedia.org/wiki/IETF_language_tag | IETF language tag} that specifies the language used to display information on the tiles. For example, `en-US` specifies the English language as spoken in the United States.\n */\n language: string;\n /**\n * A {@link https://cldr.unicode.org/ | Common Locale Data Repository} region identifier (two uppercase letters) that represents the physical location of the user. For example, `US`.\n */\n region: string;\n\n /**\n * An array of values that specifies the layer types added to the map.\n *\n * `layerRoadmap`: Required if you specify terrain as the map type. Can also be optionally overlaid on the satellite map type. Has no effect on roadmap tiles.\n *\n * `layerStreetview`: Shows Street View-enabled streets and locations using blue outlines on the map.\n *\n * @beta\n * */\n layerTypes?: GoogleMapsLayerTypes[];\n\n /**\n * Scales-up the size of map elements (such as road labels), while retaining the tile size and coverage area of the default tile.\n * Increasing the scale also reduces the number of labels on the map, which reduces clutter.\n *\n * `scaleFactor1x`: The default.\n *\n * `scaleFactor2x`: Doubles label size and removes minor feature labels.\n *\n * `scaleFactor4x`: Quadruples label size and removes minor feature labels.\n * @beta\n * */\n scale?: GoogleMapsScaleFactors\n\n /**\n * A boolean value that specifies whether layerTypes should be rendered as a separate overlay, or combined with the base imagery.\n * When true, the base map isn't displayed. If you haven't defined any layerTypes, then this value is ignored.\n * Default is false.\n * @beta\n * */\n overlay? : boolean;\n\n /**\n * An array of values specifying additional options to apply.\n * @beta\n * */\n apiOptions?: string[];\n};\n\n\n/**\n* Session data returned by the Google Maps API.\n* @beta\n*/\nexport interface GoogleMapsSessionData {\n /** A session token value that you must include in all of your Map Tiles API requests. */\n session: string;\n\n /** string that contains the time (in seconds since the epoch) at which the token expires. A session token is valid for two weeks from its creation time, but this policy might change without notice. */\n expiry: number;\n\n /** The width of the tiles measured in pixels. */\n tileWidth: number;\n\n /** he height of the tiles measured in pixels. */\n tileHeight: number;\n\n /** The image format, which can be either `png` or `jpeg`. */\n imageFormat: string;\n};\n\n/**\n * Maximum zoom level available within a bounding rectangle.\n* @beta\n*/\nexport interface MaxZoomRectangle {\n maxZoom: number;\n north: number;\n south: number;\n east: number;\n west: number;\n}\n\n/**\n * Indicate which areas of given viewport have imagery, and at which zoom levels.\n * @beta\n*/\nexport interface ViewportInfo {\n /** Attribution string that you must display on your map when you display roadmap and satellite tiles. */\n copyright: string;\n\n /** Array of bounding rectangles that overlap with the current viewport. Also contains the maximum zoom level available within each rectangle.. */\n maxZoomRects: MaxZoomRectangle[];\n}\n\n\n/**\n* Google Maps Request\n* @beta\n*/\nexport interface GoogleMapsRequest {\n /** The URL of the request */\n url: URL;\n\n /* Authorization header for the request */\n authorization?: string;\n}\n\n/**\n* Google Maps session.\n* @beta\n*/\nexport interface GoogleMapsSession {\n /* Tile size in pixels */\n getTileSize: () => number;\n\n /* Tile URL for the given tile position */\n getTileRequest: (position: QuadIdProps) => GoogleMapsRequest;\n\n /* Viewport information request */\n getViewportInfoRequest (rectangle: MapCartoRectangle, zoomLevel: number): GoogleMapsRequest\n}\n\n/**\n* Base implementation of Google Maps session.\n* @beta\n*/\nexport abstract class BaseGoogleMapsSession implements GoogleMapsSession {\n protected abstract getTileApiBaseUrl(): string;\n\n protected getTilePositionUrl(position: QuadIdProps) {\n const baseUrl = this.getTileApiBaseUrl();\n const tmpUrl = `${baseUrl}/${position.level}/${position.column}/${position.row}`;\n return new URL(tmpUrl);\n }\n\n public abstract getTileSize(): number;\n public abstract getTileRequest(position: QuadIdProps): GoogleMapsRequest;\n public abstract getViewportInfoRequest (rectangle: MapCartoRectangle, zoomLevel: number): GoogleMapsRequest\n}\n\n/**\n* Google Maps session manager interface.\n* @beta\n*/\nexport abstract class GoogleMapsSessionManager {\n public readonly type = \"GoogleMapsSessionManager\";\n public abstract createSession (sessionOptions: GoogleMapsCreateSessionOptions): Promise<GoogleMapsSession>;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"MapInfoIcon.js","sourceRoot":"","sources":["../../../src/Icons/MapInfoIcon.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,gBAAgB;AACH,QAAA,WAAW,GAAG;IACzB,OAAO,EAAE,goCAAgoC;CACjoC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @internal */\r\nexport const mapInfoIcon = {\r\n dataUri: \"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTUuODYyIDUuMTYyYTEuNDg4IDEuNDg4IDAgMSAxLTIuOTc1IDAgMS40ODggMS40ODggMCAwIDEgMi45NzUgMFpNMTIgN2MuNzEyIDAgMS4zODc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BAAgB;AACH,QAAA,WAAW,GAAG;IACzB,OAAO,EAAE,goCAAgoC;CACjoC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @internal */\nexport const mapInfoIcon = {\n dataUri: \"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTUuODYyIDUuMTYyYTEuNDg4IDEuNDg4IDAgMSAxLTIuOTc1IDAgMS40ODggMS40ODggMCAwIDEgMi45NzUgMFpNMTIgN2MuNzEyIDAgMS4zODcuMTU0IDIgLjQyMlYwaC0xLjA1bC0yLjI3OCA3LjIwMUE0Ljk1IDQuOTUgMCAwIDEgMTIgN1ptLTQuNzkyIDYuMzQ5TDcgMTRIMFYwaDExLjQ2M0w4Ljg3MiA4LjEyOUM3LjczOSA5LjA0NSA3IDEwLjQyOSA3IDEyYzAgLjQ3LjA4Ni45MTcuMjA4IDEuMzQ5Wm0tLjAzMy04LjE4N1Y1LjA5YTIuNzY0IDIuNzY0IDAgMCAwLTIuODcyLTIuNzI4IDIuNzY0IDIuNzY0IDAgMCAwLTIuNzI4IDIuOEE2LjkwMyA2LjkwMyAwIDAgMCAyLjggOC4zMTJjLjQ3NC44NzcgMSAxLjcyNCAxLjU3NSAyLjUzOCAwIDAgLjk2My0xLjQ4OCAxLjU3NS0yLjUzN2E2LjkwMyA2LjkwMyAwIDAgMCAxLjIyNS0zLjE1Wk0xNiAxMmE0IDQgMCAxIDEtOCAwIDQgNCAwIDAgMSA4IDBabS00LjA1LTEuODVhLjQ2OS40NjkgMCAwIDAgLjUuNS42NTUuNjU1IDAgMCAwIC42NS0uNmwtLjAwMi0uMDMyQS40Ni40NiAwIDAgMCAxMi42IDkuNmEuNjE1LjYxNSAwIDAg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,CAAC;QAE/B,CAAC;QAAC,OAAO,GAAQ,EAAE,CAAC;YAClB,MAAM,GAAG,oCAAoB,CAAC,UAAU,CAAC;YACzC,IAAI,GAAG,EAAE,MAAM,KAAK,GAAG,EAAE,CAAC;gBACxB,MAAM,GAAG,CAAC,CAAC,QAAQ,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC,oCAAoB,CAAC,kBAAkB,CAAC,CAAC,CAAC,oCAAoB,CAAC,WAAW,CAAC,CAAC;YACjH,CAAC;YACD,OAAO,EAAE,MAAM,EAAC,CAAC;QACnB,CAAC;IACH,CAAC;;AA1FH,oEA2FC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\nimport { ImageMapLayerSettings, MapSubLayerProps } from \"@itwin/core-common\";\r\nimport { appendQueryParams, ImageryMapLayerFormat, MapLayerImageryProvider, MapLayerSourceStatus, MapLayerSourceValidation, setBasicAuthorization, ValidateSourceArgs } from \"@itwin/core-frontend\";\r\nimport { OgcApiFeaturesProvider } from \"./OgcApiFeaturesProvider.js\";\r\n\r\n/** @internal */\r\nexport class OgcApiFeaturesMapLayerFormat extends ImageryMapLayerFormat {\r\n public static override formatId = \"OgcApiFeatures\";\r\n public static override createImageryProvider(settings: ImageMapLayerSettings): MapLayerImageryProvider | undefined { return new OgcApiFeaturesProvider(settings); }\r\n\r\n public static override async validate(args: ValidateSourceArgs): Promise<MapLayerSourceValidation> {\r\n\r\n const {source} = args;\r\n const { userName, password } = source;\r\n let status = MapLayerSourceStatus.InvalidUrl;\r\n try {\r\n\r\n let headers: Headers | undefined;\r\n if (userName && password) {\r\n headers = new Headers();\r\n setBasicAuthorization(headers, userName, password);\r\n }\r\n const opts: RequestInit = {\r\n method: \"GET\",\r\n headers,\r\n };\r\n\r\n let url = appendQueryParams(source.url, source.savedQueryParams);\r\n url = appendQueryParams(url, source.unsavedQueryParams);\r\n let response = await fetch(url, opts);\r\n let json = await response.json();\r\n if (!json) {\r\n return { status };\r\n }\r\n\r\n const createCollectionsList = (data: any) => {\r\n let array: MapSubLayerProps[] | undefined;\r\n for (const collection of data.collections) {\r\n if (collection.itemType === \"feature\") {\r\n const subLayerProps = {\r\n id: collection.id,\r\n name: collection.id,\r\n title: collection.title,\r\n visible: true,\r\n parent: undefined,\r\n children: undefined,\r\n };\r\n if (array)\r\n array.push(subLayerProps);\r\n else\r\n array = [subLayerProps];\r\n }\r\n }\r\n return array;\r\n };\r\n\r\n let subLayers: MapSubLayerProps[] | undefined;\r\n if (Array.isArray(json.collections)) {\r\n subLayers = createCollectionsList(json);\r\n status = MapLayerSourceStatus.Valid;\r\n } else if (json.itemType === \"feature\" || json.type === \"FeatureCollection\") {\r\n // We expect one of the following URL:\r\n // http://server/collections/<collectionName>\r\n // http://server/collections/<collectionName>/items\r\n subLayers = [{\r\n id: json.id,\r\n name: json.id,\r\n title: json.title,\r\n visible: true,\r\n parent: undefined,\r\n children: undefined,\r\n }];\r\n status = MapLayerSourceStatus.Valid;\r\n } else if (Array.isArray(json.links)) {\r\n // This might be the main landing page\r\n const collectionsLink = json.links.find((link: any)=> link.rel.includes(\"data\") && link.type === \"application/json\");\r\n let collectionsUrl = appendQueryParams(collectionsLink.href, source.savedQueryParams);\r\n collectionsUrl = appendQueryParams(collectionsUrl, source.unsavedQueryParams);\r\n response = await fetch(collectionsUrl, opts);\r\n json = await response.json();\r\n if (Array.isArray(json.collections)) {\r\n subLayers = createCollectionsList(json);\r\n status = MapLayerSourceStatus.Valid;\r\n }\r\n\r\n }\r\n\r\n return { status, subLayers };\r\n\r\n } catch (err: any) {\r\n status = MapLayerSourceStatus.InvalidUrl;\r\n if (err?.status === 401) {\r\n status = ((userName && password) ? MapLayerSourceStatus.InvalidCredentials : MapLayerSourceStatus.RequireAuth);\r\n }\r\n return { status};\r\n }\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":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["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport { ImageMapLayerSettings, MapSubLayerProps } from \"@itwin/core-common\";\nimport { appendQueryParams, ImageryMapLayerFormat, MapLayerImageryProvider, MapLayerSourceStatus, MapLayerSourceValidation, setBasicAuthorization, ValidateSourceArgs } from \"@itwin/core-frontend\";\nimport { OgcApiFeaturesProvider } from \"./OgcApiFeaturesProvider.js\";\n\n/** @internal */\nexport class OgcApiFeaturesMapLayerFormat extends ImageryMapLayerFormat {\n public static override formatId = \"OgcApiFeatures\";\n public static override createImageryProvider(settings: ImageMapLayerSettings): MapLayerImageryProvider | undefined { return new OgcApiFeaturesProvider(settings); }\n\n public static override async validate(args: ValidateSourceArgs): Promise<MapLayerSourceValidation> {\n\n const {source} = args;\n const { userName, password } = source;\n let status = MapLayerSourceStatus.InvalidUrl;\n try {\n\n let headers: Headers | undefined;\n if (userName && password) {\n headers = new Headers();\n setBasicAuthorization(headers, userName, password);\n }\n const opts: RequestInit = {\n method: \"GET\",\n headers,\n };\n\n let url = appendQueryParams(source.url, source.savedQueryParams);\n url = appendQueryParams(url, source.unsavedQueryParams);\n let response = await fetch(url, opts);\n let json = await response.json();\n if (!json) {\n return { status };\n }\n\n const createCollectionsList = (data: any) => {\n let array: MapSubLayerProps[] | undefined;\n for (const collection of data.collections) {\n if (collection.itemType === \"feature\") {\n const subLayerProps = {\n id: collection.id,\n name: collection.id,\n title: collection.title,\n visible: true,\n parent: undefined,\n children: undefined,\n };\n if (array)\n array.push(subLayerProps);\n else\n array = [subLayerProps];\n }\n }\n return array;\n };\n\n let subLayers: MapSubLayerProps[] | undefined;\n if (Array.isArray(json.collections)) {\n subLayers = createCollectionsList(json);\n status = MapLayerSourceStatus.Valid;\n } else if (json.itemType === \"feature\" || json.type === \"FeatureCollection\") {\n // We expect one of the following URL:\n // http://server/collections/<collectionName>\n // http://server/collections/<collectionName>/items\n subLayers = [{\n id: json.id,\n name: json.id,\n title: json.title,\n visible: true,\n parent: undefined,\n children: undefined,\n }];\n status = MapLayerSourceStatus.Valid;\n } else if (Array.isArray(json.links)) {\n // This might be the main landing page\n const collectionsLink = json.links.find((link: any)=> link.rel.includes(\"data\") && link.type === \"application/json\");\n let collectionsUrl = appendQueryParams(collectionsLink.href, source.savedQueryParams);\n collectionsUrl = appendQueryParams(collectionsUrl, source.unsavedQueryParams);\n response = await fetch(collectionsUrl, opts);\n json = await response.json();\n if (Array.isArray(json.collections)) {\n subLayers = createCollectionsList(json);\n status = MapLayerSourceStatus.Valid;\n }\n\n }\n\n return { status, subLayers };\n\n } catch (err: any) {\n status = MapLayerSourceStatus.InvalidUrl;\n if (err?.status === 401) {\n status = ((userName && password) ? MapLayerSourceStatus.InvalidCredentials : MapLayerSourceStatus.RequireAuth);\n }\n return { status};\n }\n }\n}\n"]}