@itwin/map-layers-formats 5.0.0-dev.72 → 5.0.0-dev.73

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 (66) hide show
  1. package/lib/cjs/ArcGisFeature/ArcGisFeatureFormat.js.map +1 -1
  2. package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.js.map +1 -1
  3. package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.js.map +1 -1
  4. package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.js.map +1 -1
  5. package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.js.map +1 -1
  6. package/lib/cjs/ArcGisFeature/ArcGisJsonFeatureReader.js.map +1 -1
  7. package/lib/cjs/ArcGisFeature/ArcGisPbfFeatureReader.js.map +1 -1
  8. package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.js.map +1 -1
  9. package/lib/cjs/ArcGisFeature/EsriSymbology.js.map +1 -1
  10. package/lib/cjs/ArcGisFeature/esriPBuffer.gen.js.map +1 -1
  11. package/lib/cjs/Feature/DefaultMarkerIcon.js +9 -9
  12. package/lib/cjs/Feature/DefaultMarkerIcon.js.map +1 -1
  13. package/lib/cjs/Feature/FeatureCanvasRenderer.js.map +1 -1
  14. package/lib/cjs/Feature/FeatureInfoReader.js.map +1 -1
  15. package/lib/cjs/Feature/FeatureSymbology.js.map +1 -1
  16. package/lib/cjs/Feature/RandomMapColor.js.map +1 -1
  17. package/lib/cjs/GeoJSON/GeoJSONGeometry.js.map +1 -1
  18. package/lib/cjs/GeoJSON/GeoJSONGeometryReader.js.map +1 -1
  19. package/lib/cjs/GoogleMaps/GoogleMapDecorator.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/Icons/MapInfoIcon.js.map +1 -1
  24. package/lib/cjs/OgcApiFeatures/OgcApiFeaturesFormat.js.map +1 -1
  25. package/lib/cjs/OgcApiFeatures/OgcApiFeaturesProvider.js.map +1 -1
  26. package/lib/cjs/OgcApiFeatures/OgcApiFeaturesReader.js.map +1 -1
  27. package/lib/cjs/Tools/GeometryTerrainDraper.js.map +1 -1
  28. package/lib/cjs/Tools/MapFeatureInfoDecorator.js.map +1 -1
  29. package/lib/cjs/Tools/MapFeatureInfoTool.js.map +1 -1
  30. package/lib/cjs/internal/GoogleMapsUtils.js.map +1 -1
  31. package/lib/cjs/map-layers-formats.js.map +1 -1
  32. package/lib/cjs/mapLayersFormats.js.map +1 -1
  33. package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.js.map +1 -1
  34. package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.js.map +1 -1
  35. package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.js.map +1 -1
  36. package/lib/esm/ArcGisFeature/ArcGisFeatureReader.js.map +1 -1
  37. package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.js.map +1 -1
  38. package/lib/esm/ArcGisFeature/ArcGisJsonFeatureReader.js.map +1 -1
  39. package/lib/esm/ArcGisFeature/ArcGisPbfFeatureReader.js.map +1 -1
  40. package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.js.map +1 -1
  41. package/lib/esm/ArcGisFeature/EsriSymbology.js.map +1 -1
  42. package/lib/esm/ArcGisFeature/esriPBuffer.gen.js.map +1 -1
  43. package/lib/esm/Feature/DefaultMarkerIcon.js +9 -9
  44. package/lib/esm/Feature/DefaultMarkerIcon.js.map +1 -1
  45. package/lib/esm/Feature/FeatureCanvasRenderer.js.map +1 -1
  46. package/lib/esm/Feature/FeatureInfoReader.js.map +1 -1
  47. package/lib/esm/Feature/FeatureSymbology.js.map +1 -1
  48. package/lib/esm/Feature/RandomMapColor.js.map +1 -1
  49. package/lib/esm/GeoJSON/GeoJSONGeometry.js.map +1 -1
  50. package/lib/esm/GeoJSON/GeoJSONGeometryReader.js.map +1 -1
  51. package/lib/esm/GoogleMaps/GoogleMapDecorator.js.map +1 -1
  52. package/lib/esm/GoogleMaps/GoogleMaps.js.map +1 -1
  53. package/lib/esm/GoogleMaps/GoogleMapsImageryFormat.js.map +1 -1
  54. package/lib/esm/GoogleMaps/GoogleMapsImageryProvider.js.map +1 -1
  55. package/lib/esm/Icons/MapInfoIcon.js.map +1 -1
  56. package/lib/esm/OgcApiFeatures/OgcApiFeaturesFormat.js.map +1 -1
  57. package/lib/esm/OgcApiFeatures/OgcApiFeaturesProvider.js.map +1 -1
  58. package/lib/esm/OgcApiFeatures/OgcApiFeaturesReader.js.map +1 -1
  59. package/lib/esm/Tools/GeometryTerrainDraper.js.map +1 -1
  60. package/lib/esm/Tools/MapFeatureInfoDecorator.js.map +1 -1
  61. package/lib/esm/Tools/MapFeatureInfoTool.js.map +1 -1
  62. package/lib/esm/internal/GoogleMapsUtils.js.map +1 -1
  63. package/lib/esm/map-layers-formats.js.map +1 -1
  64. package/lib/esm/mapLayersFormats.js.map +1 -1
  65. package/lib/public/locales/en/mapLayersFormats.json +18 -18
  66. package/package.json +12 -12
@@ -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;;;AAG/F,wDAAwH;AAGxH,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 { Transform } from \"@itwin/core-geometry\";\r\nimport { FeatureGeometryBaseRenderer, FeatureSymbolizedRenderer, FeatureSymbologyRenderer } from \"@itwin/core-frontend\";\r\nimport { ArcGisSymbologyCanvasRenderer } from \"../ArcGisFeature/ArcGisSymbologyRenderer\";\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;;;AAG/F,wDAAwH;AAGxH,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 { Transform } from \"@itwin/core-geometry\";\nimport { FeatureGeometryBaseRenderer, FeatureSymbolizedRenderer, FeatureSymbologyRenderer } from \"@itwin/core-frontend\";\nimport { ArcGisSymbologyCanvasRenderer } from \"../ArcGisFeature/ArcGisSymbologyRenderer\";\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 * as 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 * as 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/GeoJSONGeometryReader.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,sDAA6C;AAC7C,wDAAmF;AACnF,uDAAwG;AAGxG,MAAM,cAAc,GAAG,wCAAwC,CAAC;AAEhE,gBAAgB;AAChB,MAAa,qBAAqB;IACxB,SAAS,CAA0B;IAE3C,YAAmB,QAAiC;QAClD,IAAI,CAAC,SAAS,GAAG,QAAQ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EzG,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 { Coord, GeoJSONGeometryUtils, MultiPath, MultiRingCoords, RingCoords } from \"./GeoJSONGeometry\";\r\nimport * as GeoJson from \"geojson\";\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;AACnF,uDAAwG;AAGxG,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,sCAAoB,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE,CAAC;YAChD,MAAM,IAAI,CAAC,iBAAiB,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,EAAE,sCAAoB,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,mBAAmB,CAAC,CAAC;QAC7H,CAAC;aAAM,IAAI,sCAAoB,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;YAClD,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,EAAE,KAAK,CAAA,mBAAmB,CAAC,CAAC;QAC5E,CAAC;aAAM,CAAC;YACN,qBAAM,CAAC,QAAQ,CAAC,cAAc,EAAE,+DAA+D,QAAQ,CAAC,IAAI,GAAG,CAAC,CAAC;QACnH,CAAC;IACH,CAAC;IAEO,KAAK,CAAC,iBAAiB,CAAC,QAA0B,EAAE,QAAiC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AC;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 { Coord, GeoJSONGeometryUtils, MultiPath, MultiRingCoords, RingCoords } from \"./GeoJSONGeometry\";\nimport * as GeoJson from \"geojson\";\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":"GoogleMapDecorator.js","sourceRoot":"","sources":["../../../src/GoogleMaps/GoogleMapDecorator.ts"],"names":[],"mappings":";;;AAAA,wDAAoH;AACpH,wDAA+C;AAI/C;;GAEG;AACH,MAAa,cAAc;IACjB,OAAO,CAAU;IAEzB,4DAA4D;IAC5C,QAAQ,GAAG,IAAI,uBAAO,EAAE,CAAC;IAEjC,OAAO,CAAoB;IAEnC,IAAW,MAAM,CAAC,MAAyB;QACvC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAEH,0CAA0C;IAC1C,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,4DAA4D;IACrD,qBAAqB,CAAC,OAAwB;QACnD,IAAI,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ;YACzC,OAAO,KAAK,CAAC;QAEf,IAAI,CAA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mB;IACd,IAAI,GAAG,IAAI,cAAc,EAAE,CAAC;IAE5C,qDAAqD;IAC9C,KAAK,CAAC,QAAQ,CAAC,OAA2B;QAC/C,+DAA+D;QAC/D,MAAM,SAAS,GAAG,OAAO,KAAK,SAAS,CAAC,CAAC;YACzC,iBAAiB,CAAC,CAAC;YACnB,qBAAqB,CAAC;QAEtB,yDAAyD;QACzD,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,IAAI,uBAAO,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QAEvC,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,2BAAW,CAAC,gBAAgB,CAAC,GAAG,yBAAS,CAAC,UAAU,UAAU,SAAS,MAAM,CAAC,CAAC,CAAC;IAC5G,CAAC;IAAA,CAAC;IAEF,8BAA8B;IACvB,QAAQ,GAAG,CAAC,OAAwB,EAAE,EAAE;QAC7C,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ;YACrB,OAAO;QACT,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC;QACzC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IAC9B,CAAC,CAAC;CACH;AAvBD,kDAuBC","sourcesContent":["import { CanvasDecoration, DecorateContext, Decorator, IconSprites, IModelApp, Sprite } from \"@itwin/core-frontend\";\r\nimport { Point3d } from \"@itwin/core-geometry\";\r\nimport { GoogleMapsMapTypes } from \"./GoogleMaps\";\r\n\r\n\r\n/** A simple decorator that show logo at the a given screen position.\r\n * @internal\r\n */\r\nexport class LogoDecoration implements CanvasDecoration {\r\n private _sprite?: Sprite;\r\n\r\n /** The current position of the logo in view coordinates. */\r\n public readonly position = new Point3d();\r\n\r\n private _offset: Point3d|undefined;\r\n\r\n public set offset(offset: Point3d|undefined) {\r\n this._offset = offset;\r\n }\r\n\r\n /** The logo offset in view coordinates.*/\r\n public get offset() {\r\n return this._offset;\r\n }\r\n\r\n /** Move the logo to the lower left corner of the screen. */\r\n public moveToLowerLeftCorner(context: DecorateContext) : boolean{\r\n if (!this._sprite || !this._sprite.isLoaded)\r\n return false;\r\n\r\n this.position.x = this._offset?.x ?? 0;\r\n this.position.y = context.viewport.parentDiv.clientHeight - this._sprite.size.y;\r\n if (this._offset?.y)\r\n this.position.y -= this._offset.y;\r\n return true;\r\n }\r\n\r\n /* TODO: Add other move methods as needed */\r\n\r\n /** Indicate if the logo is loaded and ready to be drawn. */\r\n public get isLoaded() { return this._sprite?.isLoaded ?? false; }\r\n\r\n public async activate(sprite: Sprite): Promise<boolean> {\r\n this._sprite = sprite;\r\n return new Promise<boolean>((resolve, _reject) => {\r\n sprite.loadPromise.then(() => {\r\n resolve(true);\r\n }).catch(() => {\r\n resolve (false);\r\n });\r\n });\r\n }\r\n\r\n /** Draw this sprite onto the supplied canvas.\r\n * @see [[CanvasDecoration.drawDecoration]]\r\n */\r\n public drawDecoration(ctx: CanvasRenderingContext2D): void {\r\n if (this.isLoaded) {\r\n // Draw image with an origin at the top left corner\r\n ctx.drawImage(this._sprite!.image!, 0, 0);\r\n }\r\n }\r\n\r\n public decorate(context: DecorateContext) {\r\n context.addCanvasDecoration(this);\r\n }\r\n}\r\n\r\n/** A decorator that adds the Google Maps logo to the lower left corner of the screen.\r\n * @internal\r\n*/\r\nexport class GoogleMapsDecorator implements Decorator {\r\n public readonly logo = new LogoDecoration();\r\n\r\n /** Activate the logo based on the given map type. */\r\n public async activate(mapType: GoogleMapsMapTypes): Promise<boolean> {\r\n // Pick the logo that is the most visible on the background map\r\n const imageName = mapType === \"roadmap\" ?\r\n \"google_on_white\" :\r\n \"google_on_non_white\";\r\n\r\n // We need to move the logo right after the 'i.js' button\r\n this.logo.offset = new Point3d(45, 10);\r\n\r\n return this.logo.activate(IconSprites.getSpriteFromUrl(`${IModelApp.publicPath}images/${imageName}.png`));\r\n };\r\n\r\n /** Decorate implementation */\r\n public decorate = (context: DecorateContext) => {\r\n if (!this.logo.isLoaded)\r\n return;\r\n this.logo.moveToLowerLeftCorner(context);\r\n this.logo.decorate(context);\r\n };\r\n}\r\n"]}
1
+ {"version":3,"file":"GoogleMapDecorator.js","sourceRoot":"","sources":["../../../src/GoogleMaps/GoogleMapDecorator.ts"],"names":[],"mappings":";;;AAAA,wDAAoH;AACpH,wDAA+C;AAI/C;;GAEG;AACH,MAAa,cAAc;IACjB,OAAO,CAAU;IAEzB,4DAA4D;IAC5C,QAAQ,GAAG,IAAI,uBAAO,EAAE,CAAC;IAEjC,OAAO,CAAoB;IAEnC,IAAW,MAAM,CAAC,MAAyB;QACvC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAEH,0CAA0C;IAC1C,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,4DAA4D;IACrD,qBAAqB,CAAC,OAAwB;QACnD,IAAI,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ;YACzC,OAAO,KAAK,CAAC;QAEf,IAAI,CAAC,QAAQ,CAAC,CAAC,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,CAAC;QACvC,IAAI,CAAC,QAAQ,CAAC,CAAC,GAAI,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QACjF,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;QACpC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,4CAA4C;IAE5C,4DAA4D;IAC5D,IAAW,QAAQ,KAAK,OAAO,IAAI,CAAC,OAAO,EAAE,QAAQ,IAAI,KAAK,CAAC,CAAC,CAAC;IAE1D,KAAK,CAAC,QAAQ,CAAC,MAAc;QAClC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;Q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C,IAAI,CAAC,QAAQ;YACrB,OAAO;QACT,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC;QACzC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IAC9B,CAAC,CAAC;CACH;AAvBD,kDAuBC","sourcesContent":["import { CanvasDecoration, DecorateContext, Decorator, IconSprites, IModelApp, Sprite } from \"@itwin/core-frontend\";\nimport { Point3d } from \"@itwin/core-geometry\";\nimport { GoogleMapsMapTypes } from \"./GoogleMaps\";\n\n\n/** A simple decorator that show logo at the a given screen position.\n * @internal\n */\nexport class LogoDecoration implements CanvasDecoration {\n private _sprite?: Sprite;\n\n /** The current position of the logo in view coordinates. */\n public readonly position = new Point3d();\n\n private _offset: Point3d|undefined;\n\n public set offset(offset: Point3d|undefined) {\n this._offset = offset;\n }\n\n /** The logo offset in view coordinates.*/\n public get offset() {\n return this._offset;\n }\n\n /** Move the logo to the lower left corner of the screen. */\n public moveToLowerLeftCorner(context: DecorateContext) : boolean{\n if (!this._sprite || !this._sprite.isLoaded)\n return false;\n\n this.position.x = this._offset?.x ?? 0;\n this.position.y = context.viewport.parentDiv.clientHeight - this._sprite.size.y;\n if (this._offset?.y)\n this.position.y -= this._offset.y;\n return true;\n }\n\n /* TODO: Add other move methods as needed */\n\n /** Indicate if the logo is loaded and ready to be drawn. */\n public get isLoaded() { return this._sprite?.isLoaded ?? false; }\n\n public async activate(sprite: Sprite): Promise<boolean> {\n this._sprite = sprite;\n return new Promise<boolean>((resolve, _reject) => {\n sprite.loadPromise.then(() => {\n resolve(true);\n }).catch(() => {\n resolve (false);\n });\n });\n }\n\n /** Draw this sprite onto the supplied canvas.\n * @see [[CanvasDecoration.drawDecoration]]\n */\n public drawDecoration(ctx: CanvasRenderingContext2D): void {\n if (this.isLoaded) {\n // Draw image with an origin at the top left corner\n ctx.drawImage(this._sprite!.image!, 0, 0);\n }\n }\n\n public decorate(context: DecorateContext) {\n context.addCanvasDecoration(this);\n }\n}\n\n/** A decorator that adds the Google Maps logo to the lower left corner of the screen.\n * @internal\n*/\nexport class GoogleMapsDecorator implements Decorator {\n public readonly logo = new LogoDecoration();\n\n /** Activate the logo based on the given map type. */\n public async activate(mapType: GoogleMapsMapTypes): Promise<boolean> {\n // Pick the logo that is the most visible on the background map\n const imageName = mapType === \"roadmap\" ?\n \"google_on_white\" :\n \"google_on_non_white\";\n\n // We need to move the logo right after the 'i.js' button\n this.logo.offset = new Point3d(45, 10);\n\n return this.logo.activate(IconSprites.getSpriteFromUrl(`${IModelApp.publicPath}images/${imageName}.png`));\n };\n\n /** Decorate implementation */\n public decorate = (context: DecorateContext) => {\n if (!this.logo.isLoaded)\n return;\n this.logo.moveToLowerLeftCorner(context);\n this.logo.decorate(context);\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,iEAA8D;AAkF7D,CAAC;AAqBD,CAAC;AA4CF;;;EAGE;AACF,gEAAgE;AACnD,QAAA,UAAU,GAAG;IAC1B;;;;;;;;;;;;;MAaE;IACA,sBAAsB,EAAE,CAAC,IAAa,EAAE,IAAqC,EAAE,EAAE;QAC/E,OAAO,mCAAqB,CAAC,QAAQ,CAAC,iCAAe,CAAC,mBAAmB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;IACzF,CAAC;IAEH;;;;;;;;;;;;;MAaE;IACA,uBAAuB,EAAE,CAAC,IAAqC,EAAE,EAAE;QACjE,OAAO,kCAAoB,CAAC,QAAQ,CAAC,iCAAe,CAAC,mBAAmB,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC,CAAC;IAChG,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 { MapCartoRectangle } from \"@itwin/core-frontend\";\r\nimport { GoogleMapsUtils } from \"../internal/GoogleMapsUtils\";\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* Structure representing a Google Maps session.\r\n* @beta\r\n*/\r\nexport interface GoogleMapsSession {\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 * Represents the 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 * Request parameters for the getViewportInfo method.\r\n * @beta\r\n*/\r\nexport interface ViewportInfoRequestParams {\r\n /** Bounding rectangle */\r\n rectangle: MapCartoRectangle;\r\n\r\n /** Session token */\r\n session: string;\r\n\r\n /** The Google Cloud API key */\r\n key: string;\r\n\r\n /** Zoom level of the viewport */\r\n zoom: number;\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};"]}
1
+ {"version":3,"file":"GoogleMaps.js","sourceRoot":"","sources":["../../../src/GoogleMaps/GoogleMaps.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,oDAAiF;AAEjF,iEAA8D;AAkF7D,CAAC;AAqBD,CAAC;AA4CF;;;EAGE;AACF,gEAAgE;AACnD,QAAA,UAAU,GAAG;IAC1B;;;;;;;;;;;;;MAaE;IACA,sBAAsB,EAAE,CAAC,IAAa,EAAE,IAAqC,EAAE,EAAE;QAC/E,OAAO,mCAAqB,CAAC,QAAQ,CAAC,iCAAe,CAAC,mBAAmB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;IACzF,CAAC;IAEH;;;;;;;;;;;;;MAaE;IACA,uBAAuB,EAAE,CAAC,IAAqC,EAAE,EAAE;QACjE,OAAO,kCAAoB,CAAC,QAAQ,CAAC,iCAAe,CAAC,mBAAmB,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC,CAAC;IAChG,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 { MapCartoRectangle } from \"@itwin/core-frontend\";\nimport { GoogleMapsUtils } from \"../internal/GoogleMapsUtils\";\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* Structure representing a Google Maps session.\n* @beta\n*/\nexport interface GoogleMapsSession {\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 * Represents the 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 * Request parameters for the getViewportInfo method.\n * @beta\n*/\nexport interface ViewportInfoRequestParams {\n /** Bounding rectangle */\n rectangle: MapCartoRectangle;\n\n /** Session token */\n session: string;\n\n /** The Google Cloud API key */\n key: string;\n\n /** Zoom level of the viewport */\n zoom: number;\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};"]}
@@ -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,2EAAwE;AAExE,MAAa,wBAAyB,SAAQ,qCAAqB;IAC1D,MAAM,CAAU,QAAQ,GAAG,YAAY,CAAC;IACxC,MAAM,CAAU,qBAAqB,CAAC,QAA+B;QAC1E,OAAO,IAAI,qDAAyB,CAAC,QAAQ,CAAC,CAAC;IACjD,CAAC;;AAJH,4DAKC","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\";\r\n\r\nexport class GoogleMapsMapLayerFormat extends ImageryMapLayerFormat {\r\n public static override formatId = \"GoogleMaps\";\r\n public static override createImageryProvider(settings: ImageMapLayerSettings): MapLayerImageryProvider | undefined {\r\n return new GoogleMapsImageryProvider(settings);\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,2EAAwE;AAExE,MAAa,wBAAyB,SAAQ,qCAAqB;IAC1D,MAAM,CAAU,QAAQ,GAAG,YAAY,CAAC;IACxC,MAAM,CAAU,qBAAqB,CAAC,QAA+B;QAC1E,OAAO,IAAI,qDAAyB,CAAC,QAAQ,CAAC,CAAC;IACjD,CAAC;;AAJH,4DAKC","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\";\n\nexport class GoogleMapsMapLayerFormat extends ImageryMapLayerFormat {\n public static override formatId = \"GoogleMaps\";\n public static override createImageryProvider(settings: ImageMapLayerSettings): MapLayerImageryProvider | undefined {\n return new GoogleMapsImageryProvider(settings);\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;;;AAGH,wDAA6L;AAE7L,sDAA0E;AAC1E,6DAA2D;AAC3D,iEAA8D;AAC9D,MAAM,cAAc,GAAG,6BAA6B,CAAC;AACrD,MAAM,UAAU,GAAG,SAAS,CAAC;AAC7B,MAAM,QAAQ,GAAG,OAAO,CAAC;AACzB,MAAM,WAAW,GAAG,UAAU,CAAC;AAE/B,MAAM,WAAW,GAAG,0CAA0C,UAAU,IAAI,WAAW,IAAI,QAAQ,EAAE,CAAC;AAEtG;;;EAGE;AACF,MAAa,yBAA0B,SAAQ,uCAAuB;IAE5D,UAAU,CAAsB;IAChC,sBAAsB,GAAG,KAAK,CAAC;IAC/B,SAAS,GAAG,GAAG,CAAA;IACvB,YAAY,QAA+B;QACzC,KAAK,CAAC,Q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AAE,CAAC;YACV,IAAI,CAAC;gBACH,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;gBACrD,KAAK,MAAM,IAAI,IAAI,QAAQ,EAAE,CAAC;oBAC5B,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;wBAC/B,YAAY,IAAI,GAAG,YAAY,CAAC,MAAM,KAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA,CAAC,CAAC,KAAK,GAAG,IAAI,EAAE,CAAC;oBACpE,CAAC,CAAC,CAAC;gBACH,CAAC;YACH,CAAC;YACD,OAAO,KAAU,EAAE,CAAC;gBAClB,qBAAM,CAAC,QAAQ,CAAC,cAAc,EAAE,qCAAqC,KAAK,EAAE,OAAO,IAAE,eAAe,EAAE,CAAC,CAAC;YAC1G,CAAC;QACH,CAAC;QAED,KAAK,CAAC,WAAW,CAAC,yBAAS,CAAC,YAAY,CAAC;YACvC,OAAO,EAAE,GAAG,yBAAS,CAAC,UAAU,iCAAiC;YACjE,OAAO,EAAE,aAAa;YACtB,MAAM,EAAE,YAAY;SAAE,CAAC,CAAC,CAAC;IAC7B,CAAC;CAEF;AA7ND,8DA6NC","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, ImageSource } from \"@itwin/core-common\";\r\nimport { DecorateContext, IModelApp, MapCartoRectangle, MapLayerImageryProvider, MapLayerSourceStatus, MapLayerSourceValidation, MapTile, ScreenViewport, Tile } from \"@itwin/core-frontend\";\r\nimport { GoogleMapsCreateSessionOptions, GoogleMapsLayerTypes, GoogleMapsMapTypes, GoogleMapsScaleFactors, GoogleMapsSession } from \"./GoogleMaps\";\r\nimport { BentleyError, BentleyStatus, Logger } from \"@itwin/core-bentley\";\r\nimport { GoogleMapsDecorator } from \"./GoogleMapDecorator\";\r\nimport { GoogleMapsUtils } from \"../internal/GoogleMapsUtils\";\r\nconst loggerCategory = \"MapLayersFormats.GoogleMaps\";\r\nconst levelToken = \"{level}\";\r\nconst rowToken = \"{row}\";\r\nconst columnToken = \"{column}\";\r\n\r\nconst urlTemplate = `https://tile.googleapis.com/v1/2dtiles/${levelToken}/${columnToken}/${rowToken}`;\r\n\r\n/*\r\n* Google Maps imagery provider\r\n* @internal\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 constructor(settings: ImageMapLayerSettings) {\r\n super(settings, true);\r\n this._decorator = new GoogleMapsDecorator();\r\n }\r\n public static validateUrlTemplate(template: string): MapLayerSourceValidation {\r\n return { status: (template.indexOf(levelToken) > 0 && template.indexOf(columnToken) > 0 && template.indexOf(rowToken) > 0) ? MapLayerSourceStatus.Valid : MapLayerSourceStatus.InvalidUrl };\r\n }\r\n\r\n protected async createSession() : Promise<GoogleMapsSession|undefined> {\r\n const sessionOptions = this.createCreateSessionOptions();\r\n if (this._settings.accessKey ) {\r\n // Create session and store in query parameters\r\n const sessionObj = await GoogleMapsUtils.createSession(this._settings.accessKey.value, sessionOptions);\r\n this._settings.unsavedQueryParams = {session: sessionObj.session};\r\n return sessionObj;\r\n } else {\r\n Logger.logError(loggerCategory, `Missing GoogleMaps api key`);\r\n return undefined;\r\n }\r\n }\r\n public override get tileSize(): number { return this._tileSize; }\r\n\r\n public override async initialize(): Promise<void> {\r\n\r\n const layerPropertyKeys = this._settings.properties ? Object.keys(this._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 session = await this.createSession();\r\n if (!session) {\r\n const msg = `Failed to create session`;\r\n Logger.logError(loggerCategory, msg);\r\n throw new BentleyError(BentleyStatus.ERROR, msg);\r\n }\r\n this._tileSize = session.tileWidth; // assuming here tiles are square\r\n\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 private createCreateSessionOptions(): GoogleMapsCreateSessionOptions {\r\n const layerPropertyKeys = this._settings.properties ? Object.keys(this._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: this._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 (this._settings.properties?.layerTypes !== undefined) {\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 // construct the Url from the desired Tile\r\n public async constructUrl(row: number, column: number, level: number): Promise<string> {\r\n const tmpUrl = urlTemplate.replace(levelToken, level.toString()).replace(columnToken, column.toString()).replace(rowToken, row.toString());\r\n const obj = new URL(tmpUrl);\r\n if (this._settings.accessKey ) {\r\n obj.searchParams.append(\"key\", this._settings.accessKey.value);\r\n }\r\n\r\n // We assume the 'session' param to be already part of the query parameters (checked in initialize)\r\n return this.appendCustomParams(obj.toString());\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) {\r\n try {\r\n const viewportInfo = await GoogleMapsUtils.getViewportInfo({\r\n rectangle: cartoRect,\r\n session: this._settings.collectQueryParams().session,\r\n key: this._settings.accessKey!.value,\r\n 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 if (this._hadUnrecoverableError)\r\n return undefined;\r\n\r\n try {\r\n let tileUrl: string = await this.constructUrl(row, column, zoomLevel);\r\n let tileResponse: Response = await this.makeTileRequest(tileUrl);\r\n if (!tileResponse.ok) {\r\n if (tileResponse.headers.get(\"content-type\")?.includes(\"application/json\")) {\r\n // Session might have expired, lets try to re-new it.\r\n const isSessionCreated = await this.createSession();\r\n if (isSessionCreated) {\r\n tileUrl = await this.constructUrl(row, column, zoomLevel);\r\n tileResponse = await this.makeTileRequest(tileUrl);\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 } else {\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 copyrightMsg += `${copyrightMsg.length===0 ? \"\": \"<br\"}${line}`;\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 cards.appendChild(IModelApp.makeLogoCard({\r\n iconSrc: `${IModelApp.publicPath}images/google_on_white_hdpi.png`,\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;;;AAGH,wDAA6L;AAE7L,sDAA0E;AAC1E,6DAA2D;AAC3D,iEAA8D;AAC9D,MAAM,cAAc,GAAG,6BAA6B,CAAC;AACrD,MAAM,UAAU,GAAG,SAAS,CAAC;AAC7B,MAAM,QAAQ,GAAG,OAAO,CAAC;AACzB,MAAM,WAAW,GAAG,UAAU,CAAC;AAE/B,MAAM,WAAW,GAAG,0CAA0C,UAAU,IAAI,WAAW,IAAI,QAAQ,EAAE,CAAC;AAEtG;;;EAGE;AACF,MAAa,yBAA0B,SAAQ,uCAAuB;IAE5D,UAAU,CAAsB;IAChC,sBAAsB,GAAG,KAAK,CAAC;IAC/B,SAAS,GAAG,GAAG,CAAA;IACvB,YAAY,QAA+B;QACzC,KAAK,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QACtB,IAAI,CAAC,UAAU,GAAG,IAAI,wCAAmB,EAAE,CAAC;IAC9C,CAAC;IACM,MAAM,CAAC,mBAAmB,CAAC,QAAgB;QAChD,OAAO,EAAE,MAAM,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,GAA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CAAC,CAAC,KAAK,GAAG,IAAI,EAAE,CAAC;oBACpE,CAAC,CAAC,CAAC;gBACH,CAAC;YACH,CAAC;YACD,OAAO,KAAU,EAAE,CAAC;gBAClB,qBAAM,CAAC,QAAQ,CAAC,cAAc,EAAE,qCAAqC,KAAK,EAAE,OAAO,IAAE,eAAe,EAAE,CAAC,CAAC;YAC1G,CAAC;QACH,CAAC;QAED,KAAK,CAAC,WAAW,CAAC,yBAAS,CAAC,YAAY,CAAC;YACvC,OAAO,EAAE,GAAG,yBAAS,CAAC,UAAU,iCAAiC;YACjE,OAAO,EAAE,aAAa;YACtB,MAAM,EAAE,YAAY;SAAE,CAAC,CAAC,CAAC;IAC7B,CAAC;CAEF;AA7ND,8DA6NC","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, ImageSource } from \"@itwin/core-common\";\nimport { DecorateContext, IModelApp, MapCartoRectangle, MapLayerImageryProvider, MapLayerSourceStatus, MapLayerSourceValidation, MapTile, ScreenViewport, Tile } from \"@itwin/core-frontend\";\nimport { GoogleMapsCreateSessionOptions, GoogleMapsLayerTypes, GoogleMapsMapTypes, GoogleMapsScaleFactors, GoogleMapsSession } from \"./GoogleMaps\";\nimport { BentleyError, BentleyStatus, Logger } from \"@itwin/core-bentley\";\nimport { GoogleMapsDecorator } from \"./GoogleMapDecorator\";\nimport { GoogleMapsUtils } from \"../internal/GoogleMapsUtils\";\nconst loggerCategory = \"MapLayersFormats.GoogleMaps\";\nconst levelToken = \"{level}\";\nconst rowToken = \"{row}\";\nconst columnToken = \"{column}\";\n\nconst urlTemplate = `https://tile.googleapis.com/v1/2dtiles/${levelToken}/${columnToken}/${rowToken}`;\n\n/*\n* Google Maps imagery provider\n* @internal\n*/\nexport class GoogleMapsImageryProvider extends MapLayerImageryProvider {\n\n private _decorator: GoogleMapsDecorator;\n private _hadUnrecoverableError = false;\n private _tileSize = 256\n constructor(settings: ImageMapLayerSettings) {\n super(settings, true);\n this._decorator = new GoogleMapsDecorator();\n }\n public static validateUrlTemplate(template: string): MapLayerSourceValidation {\n return { status: (template.indexOf(levelToken) > 0 && template.indexOf(columnToken) > 0 && template.indexOf(rowToken) > 0) ? MapLayerSourceStatus.Valid : MapLayerSourceStatus.InvalidUrl };\n }\n\n protected async createSession() : Promise<GoogleMapsSession|undefined> {\n const sessionOptions = this.createCreateSessionOptions();\n if (this._settings.accessKey ) {\n // Create session and store in query parameters\n const sessionObj = await GoogleMapsUtils.createSession(this._settings.accessKey.value, sessionOptions);\n this._settings.unsavedQueryParams = {session: sessionObj.session};\n return sessionObj;\n } else {\n Logger.logError(loggerCategory, `Missing GoogleMaps api key`);\n return undefined;\n }\n }\n public override get tileSize(): number { return this._tileSize; }\n\n public override async initialize(): Promise<void> {\n\n const layerPropertyKeys = this._settings.properties ? Object.keys(this._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 session = await this.createSession();\n if (!session) {\n const msg = `Failed to create session`;\n Logger.logError(loggerCategory, msg);\n throw new BentleyError(BentleyStatus.ERROR, msg);\n }\n this._tileSize = session.tileWidth; // assuming here tiles are square\n\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 private createCreateSessionOptions(): GoogleMapsCreateSessionOptions {\n const layerPropertyKeys = this._settings.properties ? Object.keys(this._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: this._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 (this._settings.properties?.layerTypes !== undefined) {\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 // construct the Url from the desired Tile\n public async constructUrl(row: number, column: number, level: number): Promise<string> {\n const tmpUrl = urlTemplate.replace(levelToken, level.toString()).replace(columnToken, column.toString()).replace(rowToken, row.toString());\n const obj = new URL(tmpUrl);\n if (this._settings.accessKey ) {\n obj.searchParams.append(\"key\", this._settings.accessKey.value);\n }\n\n // We assume the 'session' param to be already part of the query parameters (checked in initialize)\n return this.appendCustomParams(obj.toString());\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) {\n try {\n const viewportInfo = await GoogleMapsUtils.getViewportInfo({\n rectangle: cartoRect,\n session: this._settings.collectQueryParams().session,\n key: this._settings.accessKey!.value,\n 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 if (this._hadUnrecoverableError)\n return undefined;\n\n try {\n let tileUrl: string = await this.constructUrl(row, column, zoomLevel);\n let tileResponse: Response = await this.makeTileRequest(tileUrl);\n if (!tileResponse.ok) {\n if (tileResponse.headers.get(\"content-type\")?.includes(\"application/json\")) {\n // Session might have expired, lets try to re-new it.\n const isSessionCreated = await this.createSession();\n if (isSessionCreated) {\n tileUrl = await this.constructUrl(row, column, zoomLevel);\n tileResponse = await this.makeTileRequest(tileUrl);\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 } else {\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 copyrightMsg += `${copyrightMsg.length===0 ? \"\": \"<br\"}${line}`;\n });\n }\n }\n catch (error: any) {\n Logger.logError(loggerCategory, `Error while loading attributions: ${error?.message??\"Unknown error\"}`);\n }\n }\n\n cards.appendChild(IModelApp.makeLogoCard({\n iconSrc: `${IModelApp.publicPath}images/google_on_white_hdpi.png`,\n heading: \"Google Maps\",\n notice: copyrightMsg }));\n }\n\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+PHBhdGggZD0iTTUuODYyIDUuMTYyYTEuNDg4IDEuNDg4IDAgMSAxLTIuOTc1IDAgMS40ODggMS40ODggMCAwIDEgMi45NzUgMFpNMTIgN2MuNzEy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;;;AAE/F,gBAAgB;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+PHBhdGggZD0iTTUuODYyIDUuMTYyYTEuNDg4IDEuNDg4IDAgMSAxLTIuOTc1IDAgMS40ODggMS40ODggMCAwIDEgMi45NzUgMFpNMTIgN2MuNzEyIDAgMS4zODcuMTU0IDIgLjQyMlYwaC0xLjA1bC0yLjI3OCA3LjIwMUE0Ljk1IDQuOTUgMCAwIDEgMTIgN1ptLTQuNzkyIDYuMzQ5TDcgMTRIMFYwaDExLjQ2M0w4Ljg3MiA4LjEyOUM3LjczOSA5LjA0NSA3IDEwLjQyOSA3IDEyYzAgLjQ3LjA4Ni45MTcuMjA4IDEuMzQ5Wm0tLjAzMy04LjE4N1Y1LjA5YTIuNzY0IDIuNzY0IDAgMCAwLTIuODcyLTIuNzI4IDIuNzY0IDIuNzY0IDAgMCAwLTIuNzI4IDIuOEE2LjkwMyA2LjkwMyAwIDAgMCAyLjggOC4zMTJjLjQ3NC44NzcgMSAxLjcyNCAxLjU3NSAyLjUzOCAwIDAgLjk2My0xLjQ4OCAxLjU3NS0yLjUzN2E2LjkwMyA2LjkwMyAwIDAgMCAxLjIyNS0zLjE1Wk0xNiAxMmE0IDQgMCAxIDEtOCAwIDQgNCAwIDAgMSA4IDBabS00LjA1LTEuODVhLjQ2OS40NjkgMCAwIDAgLjUuNS42NTUuNjU1IDAgMCAwIC42NS0uNmwtLjAwMi0uMDMyQS40Ni40NiAwIDAgMCAxMi42IDkuNmEuNjE1Lj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,SAAS,EAAE,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\";\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
+ {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","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 { ImageMapLayerSettings, MapSubLayerProps } from \"@itwin/core-common\";\nimport { appendQueryParams, ImageryMapLayerFormat, MapLayerImageryProvider, MapLayerSourceStatus, MapLayerSourceValidation, setBasicAuthorization, ValidateSourceArgs } from \"@itwin/core-frontend\";\nimport { OgcApiFeaturesProvider } from \"./OgcApiFeaturesProvider\";\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"]}