@itwin/map-layers-formats 4.1.0-dev.40 → 4.1.0-dev.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.rush/temp/operation/build/all.log +1 -3
- package/.rush/temp/operation/build/state.json +1 -1
- package/.rush/temp/operation/cover/all.log +12 -7
- package/.rush/temp/operation/cover/state.json +1 -1
- package/.rush/temp/operation/docs/all.log +2 -2
- package/.rush/temp/operation/docs/state.json +1 -1
- package/.rush/temp/package-deps_build.json +36 -0
- package/.rush/temp/package-deps_cover.json +7 -7
- package/.rush/temp/package-deps_docs.json +7 -7
- package/.rush/temp/shrinkwrap-deps.json +70 -80
- package/CHANGELOG.json +30 -0
- package/CHANGELOG.md +26 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureFormat.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureJSON.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeaturePBF.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.d.ts +3 -0
- package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.d.ts.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.js +49 -11
- package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureRenderer.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.js +3 -3
- package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.js.map +1 -1
- package/lib/cjs/ArcGisFeature/esriPBuffer.gen.js.map +1 -1
- package/lib/cjs/map-layers-formats.js.map +1 -1
- package/lib/cjs/mapLayersFormats.js.map +1 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.js.map +1 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureJSON.test.js.map +1 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeaturePBF.test.js.map +1 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.js +133 -6
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.js.map +1 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureQuery.test.js.map +1 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureRenderer.test.js.map +1 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureResponse.test.js.map +1 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisSymbologyRenderer.test.js.map +1 -1
- package/lib/cjs/test/ArcGisFeature/Mocks.js.map +1 -1
- package/lib/cjs/test/ArcGisFeature/NewYorkDataset.js.map +1 -1
- package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.js.map +1 -1
- package/lib/cjs/test/coverage/.nyc_output/49eeff8d-f0c9-43b5-9fa7-717e2ee4f36b.json +1 -0
- package/lib/cjs/test/coverage/.nyc_output/processinfo/49eeff8d-f0c9-43b5-9fa7-717e2ee4f36b.json +1 -0
- package/lib/cjs/test/coverage/.nyc_output/processinfo/b749190e-f7e9-4cdb-80df-74589d31e28d.json +1 -0
- package/lib/cjs/test/coverage/.nyc_output/processinfo/index.json +1 -1
- package/lib/cjs/test/coverage/cobertura-coverage.xml +291 -257
- package/lib/cjs/test/coverage/lcov-report/index.html +18 -18
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureFormat.ts.html +1 -1
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureJSON.ts.html +1 -1
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeaturePBF.ts.html +1 -1
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureProvider.ts.html +202 -76
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureQuery.ts.html +1 -1
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureReader.ts.html +1 -1
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureRenderer.ts.html +1 -1
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureResponse.ts.html +1 -1
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisSymbologyRenderer.ts.html +13 -13
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/index.html +18 -18
- package/lib/cjs/test/coverage/lcov-report/src/index.html +1 -1
- package/lib/cjs/test/coverage/lcov-report/src/map-layers-formats.ts.html +1 -1
- package/lib/cjs/test/coverage/lcov-report/src/mapLayersFormats.ts.html +1 -1
- package/lib/cjs/test/coverage/lcov.info +420 -384
- package/lib/cjs/tsconfig.tsbuildinfo +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureJSON.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeaturePBF.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.d.ts +3 -0
- package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.d.ts.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.js +49 -11
- package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureReader.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureRenderer.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.js +3 -3
- package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.js.map +1 -1
- package/lib/esm/ArcGisFeature/esriPBuffer.gen.js.map +1 -1
- package/lib/esm/map-layers-formats.js.map +1 -1
- package/lib/esm/mapLayersFormats.js.map +1 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.js.map +1 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureJSON.test.js.map +1 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeaturePBF.test.js.map +1 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.js +134 -7
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.js.map +1 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureQuery.test.js.map +1 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureRenderer.test.js.map +1 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.js.map +1 -1
- package/lib/esm/test/ArcGisFeature/ArcGisSymbologyRenderer.test.js.map +1 -1
- package/lib/esm/test/ArcGisFeature/Mocks.js.map +1 -1
- package/lib/esm/test/ArcGisFeature/NewYorkDataset.js.map +1 -1
- package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.js.map +1 -1
- package/lib/esm/tsconfig.tsbuildinfo +1 -1
- package/lib/test/junit_results.xml +49 -39
- package/map-layers-formats.build.cache.log +2 -0
- package/map-layers-formats.cover.log +103 -0
- package/{map-layers-formats.build.log → map-layers-formats.docs.log} +2 -2
- package/map-layers-formats.lint.error.log +1 -0
- package/map-layers-formats.lint.log +2 -0
- package/package.json +12 -12
- package/src/ArcGisFeature/ArcGisFeatureProvider.ts +53 -11
- package/src/ArcGisFeature/ArcGisSymbologyRenderer.ts +3 -3
- package/src/test/ArcGisFeature/ArcGisFeatureProvider.test.ts +173 -7
- package/.rush/temp/56b9a37b833db0202ea00aa252f5eaa1d19cf7bd.log +0 -10
- package/lib/cjs/test/coverage/.nyc_output/4dc5f60e-8ae8-48d3-b717-f77ecf525371.json +0 -1
- package/lib/cjs/test/coverage/.nyc_output/processinfo/4dc5f60e-8ae8-48d3-b717-f77ecf525371.json +0 -1
- package/lib/cjs/test/coverage/.nyc_output/processinfo/dac1e7eb-315e-4558-9250-262b6f23cf4a.json +0 -1
- /package/lib/cjs/test/coverage/.nyc_output/{dac1e7eb-315e-4558-9250-262b6f23cf4a.json → b749190e-f7e9-4cdb-80df-74589d31e28d.json} +0 -0
|
@@ -15,14 +15,14 @@ import { base64StringToUint8Array, ByteStream, Logger } from "@itwin/core-bentle
|
|
|
15
15
|
import { ArcGisExtent, ArcGisFeatureFormat, ArcGisGeometry } from "../../ArcGisFeature/ArcGisFeatureQuery";
|
|
16
16
|
import { PhillyLandmarksDataset } from "./PhillyLandmarksDataset";
|
|
17
17
|
import { ArcGisFeatureResponse } from "../../ArcGisFeature/ArcGisFeatureResponse";
|
|
18
|
-
import { Point3d, Transform } from "@itwin/core-geometry";
|
|
18
|
+
import { Angle, Point3d, Transform } from "@itwin/core-geometry";
|
|
19
19
|
import { ArcGisFeaturePBF } from "../../ArcGisFeature/ArcGisFeaturePBF";
|
|
20
20
|
import { ArcGisFeatureJSON } from "../../ArcGisFeature/ArcGisFeatureJSON";
|
|
21
21
|
|
|
22
22
|
const expect = chai.expect;
|
|
23
23
|
chai.use(chaiAsPromised);
|
|
24
24
|
|
|
25
|
-
const esriFeatureSampleSource = {name: "dummyFeatureLayer", url: "https://dummy.com", formatId: ArcGisFeatureMapLayerFormat.formatId};
|
|
25
|
+
const esriFeatureSampleSource = {name: "dummyFeatureLayer", url: "https://dummy.com/SomeGuid/ArcGIS/rest/services/SomeService/FeatureServer", formatId: ArcGisFeatureMapLayerFormat.formatId};
|
|
26
26
|
const pngTransparent1x1 = "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==";
|
|
27
27
|
|
|
28
28
|
describe("ArcGisFeatureProvider", () => {
|
|
@@ -38,7 +38,7 @@ describe("ArcGisFeatureProvider", () => {
|
|
|
38
38
|
sandbox.restore();
|
|
39
39
|
});
|
|
40
40
|
|
|
41
|
-
it("should initialize with valid
|
|
41
|
+
it("should initialize with valid service metadata", async () => {
|
|
42
42
|
|
|
43
43
|
sandbox.stub(ArcGisUtilities, "getServiceJson").callsFake(async function _(_url: string, _formatId: string, _userName?: string, _password?: string, _ignoreCache?: boolean, _requireToken?: boolean) {
|
|
44
44
|
return {accessTokenRequired: false, content:NewYorkDataset.serviceCapabilities};
|
|
@@ -56,6 +56,172 @@ describe("ArcGisFeatureProvider", () => {
|
|
|
56
56
|
expect((provider as any)._maxDepthFromLod).to.equals(22);
|
|
57
57
|
});
|
|
58
58
|
|
|
59
|
+
it("should initialize and set cartoRange without making extra extent request", async () => {
|
|
60
|
+
|
|
61
|
+
sandbox.stub(ArcGisUtilities, "getServiceJson").callsFake(async function _(_url: string, _formatId: string, _userName?: string, _password?: string, _ignoreCache?: boolean, _requireToken?: boolean) {
|
|
62
|
+
return {accessTokenRequired: false, content:NewYorkDataset.serviceCapabilities};
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
sandbox.stub(ArcGisFeatureProvider.prototype, "getLayerMetadata" as any).callsFake(async function _(_layerId: unknown) {
|
|
66
|
+
return NewYorkDataset.streetsLayerCapabilities;
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
const setCartoSpy = sandbox.spy(ArcGisFeatureProvider.prototype, "setCartoRangeFromExtentJson" as any);
|
|
70
|
+
const fetchLayerExtentSpy = sandbox.spy(ArcGisFeatureProvider.prototype, "fetchLayerExtent" as any);
|
|
71
|
+
|
|
72
|
+
const settings = ImageMapLayerSettings.fromJSON(esriFeatureSampleSource);
|
|
73
|
+
const provider = new ArcGisFeatureProvider(settings);
|
|
74
|
+
await provider.initialize();
|
|
75
|
+
|
|
76
|
+
expect(setCartoSpy.called).to.be.true;
|
|
77
|
+
|
|
78
|
+
expect(setCartoSpy.args[0][0]).to.be.equals(NewYorkDataset.streetsLayerCapabilities.extent);
|
|
79
|
+
expect(fetchLayerExtentSpy.called).to.be.false;
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
it("should make an extra extent request when none available in layer metadata", async () => {
|
|
83
|
+
|
|
84
|
+
sandbox.stub(ArcGisUtilities, "getServiceJson").callsFake(async function _(_url: string, _formatId: string, _userName?: string, _password?: string, _ignoreCache?: boolean, _requireToken?: boolean) {
|
|
85
|
+
return {accessTokenRequired: false, content:NewYorkDataset.serviceCapabilities};
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
const setCartoSpy = sandbox.spy(ArcGisFeatureProvider.prototype, "setCartoRangeFromExtentJson" as any);
|
|
89
|
+
|
|
90
|
+
const layerExtent = {...NewYorkDataset.streetsLayerCapabilities.extent};
|
|
91
|
+
const fetchLayerExtentStub = sandbox.stub(ArcGisFeatureProvider.prototype, "fetchLayerExtent" as any).callsFake(async function _(_layerId: unknown) {
|
|
92
|
+
return layerExtent;
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
const layerCapabilitiesNoExtent = {...NewYorkDataset.streetsLayerCapabilities, extent:null};
|
|
96
|
+
sandbox.stub(ArcGisFeatureProvider.prototype, "getLayerMetadata" as any).callsFake(async function _(_layerId: unknown) {
|
|
97
|
+
return layerCapabilitiesNoExtent;
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
const settings = ImageMapLayerSettings.fromJSON(esriFeatureSampleSource);
|
|
101
|
+
const provider = new ArcGisFeatureProvider(settings);
|
|
102
|
+
await provider.initialize();
|
|
103
|
+
|
|
104
|
+
expect(fetchLayerExtentStub.called).to.be.true;
|
|
105
|
+
expect(setCartoSpy.called).to.be.true;
|
|
106
|
+
expect(setCartoSpy.args[0][0]).to.be.equals(layerExtent);
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
it("should make an extra extent request when none available in layer metadata", async () => {
|
|
110
|
+
|
|
111
|
+
sandbox.stub(ArcGisUtilities, "getServiceJson").callsFake(async function _(_url: string, _formatId: string, _userName?: string, _password?: string, _ignoreCache?: boolean, _requireToken?: boolean) {
|
|
112
|
+
return {accessTokenRequired: false, content:NewYorkDataset.serviceCapabilities};
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
const setCartoSpy = sandbox.spy(ArcGisFeatureProvider.prototype, "setCartoRangeFromExtentJson" as any);
|
|
116
|
+
|
|
117
|
+
const layerExtent = {...NewYorkDataset.streetsLayerCapabilities.extent};
|
|
118
|
+
const fetchLayerExtentStub = sandbox.stub(ArcGisFeatureProvider.prototype, "fetchLayerExtent" as any).callsFake(async function _(_layerId: unknown) {
|
|
119
|
+
return layerExtent;
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
const layerExtentBadSrs = {...NewYorkDataset.streetsLayerCapabilities};
|
|
123
|
+
layerExtentBadSrs.extent.spatialReference.wkid = 1234;
|
|
124
|
+
layerExtentBadSrs.extent.spatialReference.latestWkid = 1234;
|
|
125
|
+
sandbox.stub(ArcGisFeatureProvider.prototype, "getLayerMetadata" as any).callsFake(async function _(_layerId: unknown) {
|
|
126
|
+
return layerExtentBadSrs;
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
const settings = ImageMapLayerSettings.fromJSON(esriFeatureSampleSource);
|
|
130
|
+
const provider = new ArcGisFeatureProvider(settings);
|
|
131
|
+
await provider.initialize();
|
|
132
|
+
|
|
133
|
+
expect(fetchLayerExtentStub.called).to.be.true;
|
|
134
|
+
expect(setCartoSpy.called).to.be.true;
|
|
135
|
+
expect(setCartoSpy.args[0][0]).to.be.equals(layerExtent);
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
it("should set cartoRange from Extent json", async () => {
|
|
139
|
+
|
|
140
|
+
const newYorkLayerExtent = NewYorkDataset.streetsLayerCapabilities.extent;
|
|
141
|
+
const settings = ImageMapLayerSettings.fromJSON(esriFeatureSampleSource);
|
|
142
|
+
const provider = new ArcGisFeatureProvider(settings);
|
|
143
|
+
|
|
144
|
+
const west = provider.getEPSG4326Lon(newYorkLayerExtent.xmin);
|
|
145
|
+
const south = provider.getEPSG4326Lat(newYorkLayerExtent.ymin);
|
|
146
|
+
const east = provider.getEPSG4326Lon(newYorkLayerExtent.xmax);
|
|
147
|
+
const north = provider.getEPSG4326Lat(newYorkLayerExtent.ymax);
|
|
148
|
+
|
|
149
|
+
(provider as any).setCartoRangeFromExtentJson(newYorkLayerExtent);
|
|
150
|
+
|
|
151
|
+
expect(provider.cartoRange).to.be.not.undefined;
|
|
152
|
+
const delta = 0.0000001;
|
|
153
|
+
expect(provider.cartoRange!.west * Angle.degreesPerRadian).to.approximately(west, delta);
|
|
154
|
+
expect(provider.cartoRange!.south * Angle.degreesPerRadian).to.approximately(south, delta);
|
|
155
|
+
expect(provider.cartoRange!.east * Angle.degreesPerRadian).to.approximately(east, delta);
|
|
156
|
+
expect(provider.cartoRange!.north * Angle.degreesPerRadian).to.approximately(north, delta);
|
|
157
|
+
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
it("should compose proper request to get extent", async () => {
|
|
161
|
+
|
|
162
|
+
fetchStub.restore(); // fetch is always stubbed by default, restore and provide our own stub
|
|
163
|
+
sandbox.stub(ArcGisUtilities, "getServiceJson").callsFake(async function _(_url: string, _formatId: string, _userName?: string, _password?: string, _ignoreCache?: boolean, _requireToken?: boolean) {
|
|
164
|
+
return {accessTokenRequired: false, content:NewYorkDataset.serviceCapabilities};
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
const layerCapabilitiesNoExtent = {...NewYorkDataset.streetsLayerCapabilities};
|
|
168
|
+
sandbox.stub(ArcGisFeatureProvider.prototype, "getLayerMetadata" as any).callsFake(async function _(_layerId: unknown) {
|
|
169
|
+
return layerCapabilitiesNoExtent;
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
const referenceExtent = {extent: NewYorkDataset.streetsLayerCapabilities.extent};
|
|
173
|
+
const stub = sandbox.stub((ArcGISImageryProvider.prototype as any), "fetch").callsFake(async function _(_url: unknown, _options?: unknown) {
|
|
174
|
+
const test = {
|
|
175
|
+
headers: { "content-type" : "json"},
|
|
176
|
+
json: async () => {
|
|
177
|
+
return referenceExtent;
|
|
178
|
+
},
|
|
179
|
+
status: 200,
|
|
180
|
+
} as unknown; // By using unknown type, I can define parts of Response I really need
|
|
181
|
+
return (test as Response );
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
let layerId = 0;
|
|
185
|
+
let expectedUrl = `https://dummy.com/SomeGuid/ArcGIS/rest/services/SomeService/FeatureServer/${layerId}/query?where=1%3D1&outSR=3857&returnExtentOnly=true&f=json`;
|
|
186
|
+
let cachedExtent = (ArcGisFeatureProvider as any)._extentCache.get(expectedUrl);
|
|
187
|
+
expect(cachedExtent).to.be.undefined;
|
|
188
|
+
|
|
189
|
+
const settings = ImageMapLayerSettings.fromJSON(esriFeatureSampleSource);
|
|
190
|
+
const provider = new ArcGisFeatureProvider(settings);
|
|
191
|
+
await provider.initialize();
|
|
192
|
+
|
|
193
|
+
let fetchExtent = await (provider as any).fetchLayerExtent();
|
|
194
|
+
expect(fetchExtent).to.equals(referenceExtent.extent);
|
|
195
|
+
expect(stub.getCalls().length).to.equals(1);
|
|
196
|
+
expect(stub.args[0][0].toString()).to.be.equals(expectedUrl);
|
|
197
|
+
|
|
198
|
+
// Check if entry has been created in cache
|
|
199
|
+
cachedExtent = (ArcGisFeatureProvider as any)._extentCache.get(expectedUrl);
|
|
200
|
+
expect(cachedExtent).to.be.not.undefined;
|
|
201
|
+
expect(cachedExtent).to.equals(referenceExtent);
|
|
202
|
+
|
|
203
|
+
// Make sure cache is used
|
|
204
|
+
await (provider as any).fetchLayerExtent();
|
|
205
|
+
expect(stub.getCalls().length).to.equals(1);
|
|
206
|
+
|
|
207
|
+
// Force a different layerId, and check a new request has been made
|
|
208
|
+
layerId = 2;
|
|
209
|
+
expectedUrl = `https://dummy.com/SomeGuid/ArcGIS/rest/services/SomeService/FeatureServer/${layerId}/query?where=1%3D1&outSR=3857&returnExtentOnly=true&f=json`;
|
|
210
|
+
cachedExtent = (ArcGisFeatureProvider as any)._extentCache.get(expectedUrl);
|
|
211
|
+
expect(cachedExtent).to.be.undefined;
|
|
212
|
+
(provider as any)._layerId = layerId;
|
|
213
|
+
fetchExtent = await (provider as any).fetchLayerExtent();
|
|
214
|
+
expect(fetchExtent).to.equals(referenceExtent.extent);
|
|
215
|
+
expect(stub.getCalls().length).to.equals(2);
|
|
216
|
+
expect(stub.args[1][0].toString()).to.be.equals(expectedUrl);
|
|
217
|
+
|
|
218
|
+
// check cache has been updated with a new entry
|
|
219
|
+
cachedExtent = (ArcGisFeatureProvider as any)._extentCache.get(expectedUrl);
|
|
220
|
+
expect(cachedExtent).to.be.not.undefined;
|
|
221
|
+
expect(cachedExtent).to.equals(referenceExtent);
|
|
222
|
+
|
|
223
|
+
});
|
|
224
|
+
|
|
59
225
|
it("should not initialize with no service metadata", async () => {
|
|
60
226
|
|
|
61
227
|
sandbox.stub(ArcGisUtilities, "getServiceJson").callsFake(async function _(_url: string, _formatId: string, _userName?: string, _password?: string, _ignoreCache?: boolean, _requireToken?: boolean) {
|
|
@@ -303,7 +469,7 @@ describe("ArcGisFeatureProvider", () => {
|
|
|
303
469
|
latestWkid: 3857,
|
|
304
470
|
},
|
|
305
471
|
};
|
|
306
|
-
expect(url?.url).to.equals(
|
|
472
|
+
expect(url?.url).to.equals("https://dummy.com/SomeGuid/ArcGIS/rest/services/SomeService/FeatureServer/0/query?f=PBF&resultType=tile&maxRecordCountFactor=3&returnExceededLimitFeatures=false&outSR=102100&geometryType=esriGeometryEnvelope&geometry=%7B%22xmin%22%3A-20037508.34%2C%22ymin%22%3A-20037508.339999996%2C%22xmax%22%3A20037508.34%2C%22ymax%22%3A20037508.340000004%2C%22spatialReference%22%3A%7B%22wkid%22%3A102100%2C%22latestWkid%22%3A3857%7D%7D&units=esriSRUnit_Meter&inSR=102100");
|
|
307
473
|
expect(url?.envelope?.xmin).to.be.closeTo(extent.xmin, 0.01);
|
|
308
474
|
expect(url?.envelope?.ymin).to.be.closeTo(extent.ymin, 0.01);
|
|
309
475
|
expect(url?.envelope?.xmax).to.be.closeTo(extent.xmax, 0.01);
|
|
@@ -324,7 +490,7 @@ describe("ArcGisFeatureProvider", () => {
|
|
|
324
490
|
const provider2 = new ArcGisFeatureProvider(settings);
|
|
325
491
|
await provider2.initialize();
|
|
326
492
|
url = provider2.constructFeatureUrl(0,0,0, "PBF");
|
|
327
|
-
expect(url?.url).to.equals(
|
|
493
|
+
expect(url?.url).to.equals("https://dummy.com/SomeGuid/ArcGIS/rest/services/SomeService/FeatureServer/0/query?f=PBF&resultType=tile&maxRecordCountFactor=3&returnExceededLimitFeatures=false&outSR=102100&geometryType=esriGeometryEnvelope&geometry=%7B%22xmin%22%3A-20037508.34%2C%22ymin%22%3A-20037508.339999996%2C%22xmax%22%3A20037508.34%2C%22ymax%22%3A20037508.340000004%2C%22spatialReference%22%3A%7B%22wkid%22%3A102100%2C%22latestWkid%22%3A3857%7D%7D&units=esriSRUnit_Meter&inSR=102100&quantizationParameters=%7B%22mode%22%3A%22view%22%2C%22originPosition%22%3A%22upperLeft%22%2C%22tolerance%22%3A78271.516953125%2C%22extent%22%3A%7B%22xmin%22%3A-20037508.34%2C%22ymin%22%3A-20037508.339999996%2C%22xmax%22%3A20037508.34%2C%22ymax%22%3A20037508.340000004%2C%22spatialReference%22%3A%7B%22wkid%22%3A102100%2C%22latestWkid%22%3A3857%7D%7D%7D");
|
|
328
494
|
expect(url?.envelope?.xmin).to.be.closeTo(extent.xmin, 0.01);
|
|
329
495
|
expect(url?.envelope?.ymin).to.be.closeTo(extent.ymin, 0.01);
|
|
330
496
|
expect(url?.envelope?.xmax).to.be.closeTo(extent.xmax, 0.01);
|
|
@@ -349,7 +515,7 @@ describe("ArcGisFeatureProvider", () => {
|
|
|
349
515
|
const provider3 = new ArcGisFeatureProvider(settings);
|
|
350
516
|
await provider3.initialize();
|
|
351
517
|
url = provider3.constructFeatureUrl(0,0,0, "PBF", overrideGeom);
|
|
352
|
-
expect(url?.url).to.equals(
|
|
518
|
+
expect(url?.url).to.equals("https://dummy.com/SomeGuid/ArcGIS/rest/services/SomeService/FeatureServer/0/query?f=PBF&resultType=tile&maxRecordCountFactor=3&returnExceededLimitFeatures=false&outSR=102100&geometryType=esriGeometryEnvelope&geometry=%7B%22xmin%22%3A-50%2C%22ymin%22%3A-50%2C%22xmax%22%3A50%2C%22ymax%22%3A50%2C%22spatialReference%22%3A%7B%22wkid%22%3A102100%2C%22latestWkid%22%3A3857%7D%7D&units=esriSRUnit_Meter&inSR=102100&quantizationParameters=%7B%22mode%22%3A%22view%22%2C%22originPosition%22%3A%22upperLeft%22%2C%22tolerance%22%3A78271.516953125%2C%22extent%22%3A%7B%22xmin%22%3A-20037508.34%2C%22ymin%22%3A-20037508.339999996%2C%22xmax%22%3A20037508.34%2C%22ymax%22%3A20037508.340000004%2C%22spatialReference%22%3A%7B%22wkid%22%3A102100%2C%22latestWkid%22%3A3857%7D%7D%7D");
|
|
353
519
|
expect(url?.envelope?.xmin).to.be.closeTo((overrideGeom.geom as ArcGisExtent).xmin, 0.01);
|
|
354
520
|
expect(url?.envelope?.ymin).to.be.closeTo((overrideGeom.geom as ArcGisExtent).ymin, 0.01);
|
|
355
521
|
expect(url?.envelope?.xmax).to.be.closeTo((overrideGeom.geom as ArcGisExtent).xmax, 0.01);
|
|
@@ -359,7 +525,7 @@ describe("ArcGisFeatureProvider", () => {
|
|
|
359
525
|
|
|
360
526
|
// Now test with a different tolerance value
|
|
361
527
|
url = provider3.constructFeatureUrl(0,0,0, "PBF", overrideGeom, undefined, 10);
|
|
362
|
-
expect(url?.url).to.equals(
|
|
528
|
+
expect(url?.url).to.equals("https://dummy.com/SomeGuid/ArcGIS/rest/services/SomeService/FeatureServer/0/query?f=PBF&resultType=tile&maxRecordCountFactor=3&returnExceededLimitFeatures=false&outSR=102100&geometryType=esriGeometryEnvelope&geometry=%7B%22xmin%22%3A-50%2C%22ymin%22%3A-50%2C%22xmax%22%3A50%2C%22ymax%22%3A50%2C%22spatialReference%22%3A%7B%22wkid%22%3A102100%2C%22latestWkid%22%3A3857%7D%7D&units=esriSRUnit_Meter&inSR=102100&quantizationParameters=%7B%22mode%22%3A%22view%22%2C%22originPosition%22%3A%22upperLeft%22%2C%22tolerance%22%3A78271.516953125%2C%22extent%22%3A%7B%22xmin%22%3A-20037508.34%2C%22ymin%22%3A-20037508.339999996%2C%22xmax%22%3A20037508.34%2C%22ymax%22%3A20037508.340000004%2C%22spatialReference%22%3A%7B%22wkid%22%3A102100%2C%22latestWkid%22%3A3857%7D%7D%7D&distance=782715.16953125");
|
|
363
529
|
expect(url?.envelope?.xmin).to.be.closeTo((overrideGeom.geom as ArcGisExtent).xmin, 0.01);
|
|
364
530
|
expect(url?.envelope?.ymin).to.be.closeTo((overrideGeom.geom as ArcGisExtent).ymin, 0.01);
|
|
365
531
|
expect(url?.envelope?.xmax).to.be.closeTo((overrideGeom.geom as ArcGisExtent).xmax, 0.01);
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
Start time: Tue Jun 20 2023 10:50:42 GMT-0400 (Eastern Daylight Time)
|
|
2
|
-
Invoking "C:\WINDOWS\system32\tar.exe -x -m -f D:\vsts_a\7\s\common\temp\build-cache\56b9a37b833db0202ea00aa252f5eaa1d19cf7bd"
|
|
3
|
-
|
|
4
|
-
======= BEGIN PROCESS INPUT ======
|
|
5
|
-
|
|
6
|
-
======== END PROCESS INPUT =======
|
|
7
|
-
======= BEGIN PROCESS OUTPUT =======
|
|
8
|
-
======== END PROCESS OUTPUT ========
|
|
9
|
-
|
|
10
|
-
Exited with code "0"
|