-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- upgraded yarn and other packages as needed to keep pace with the Web ecosystem. - removed existing sample viewer and added a new one that uses the same code from @vertigis/web-sdk to build and run as the samples themselves - linted - added simple tests for the sample viewer
- Loading branch information
1 parent
7788bab
commit fcdee2a
Showing
89 changed files
with
11,711 additions
and
17,840 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
.DS_Store | ||
node_modules | ||
build | ||
dist | ||
package-lock.json | ||
**/build/* | ||
!viewer/build/index.html | ||
!viewer/build/_* | ||
.yarn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
samples/*/build | ||
libraries/*/build | ||
viewer/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,5 +13,6 @@ | |
"unsync", | ||
"unsynced", | ||
"vertigis" | ||
] | ||
], | ||
"eslint.workingDirectories": [{ "pattern": "./libraries/*/" }] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
nodeLinker: node-modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
const getIframeDocument = () => { | ||
return cy | ||
.get(`iframe[name="viewer"]`) | ||
.its("0.contentDocument") | ||
.should("exist"); | ||
}; | ||
|
||
const getIframeBody = () => { | ||
return getIframeDocument() | ||
.its("body") | ||
.should("not.be.undefined") | ||
.then(cy.wrap); | ||
}; | ||
|
||
const getApplication = () => { | ||
return getIframeBody() | ||
.find("#gcx-app") | ||
.should("have.attr", "library-loaded") | ||
.then(cy.wrap); | ||
}; | ||
|
||
const getMap = (id?: string) => { | ||
const selector = id ? `[gcx-id="${id}"]` : ".gcx-map"; | ||
getApplication(); | ||
return getIframeBody() | ||
.find(selector) | ||
.and((el) => { | ||
const mapId = el[0].getAttribute("data-layout-id"); | ||
const win = el[0].ownerDocument?.defaultView as Window & any; | ||
const map = win.__maps?.[mapId!] || win.__scenes?.[mapId!]; | ||
|
||
// Wait for global map data to be available once initialized | ||
expect(!!map, "expect map to be created").to.be.true; | ||
expect(map.ready, "expect map to be ready").to.be.true; | ||
}) | ||
.then(cy.wrap); | ||
}; | ||
|
||
describe("sample-viewer", () => { | ||
it("loads the viewer frame", () => { | ||
cy.visit(`http://localhost:3001`); | ||
getIframeBody(); | ||
}); | ||
|
||
it("loads the viewer application", () => { | ||
cy.visit(`http://localhost:3001`); | ||
getApplication(); | ||
}); | ||
|
||
it("loads the correct sample", () => { | ||
cy.visit(`http://localhost:3001/#timeslider`); | ||
getIframeBody() | ||
.find(".gcx-readme") | ||
.should("contain.text", "Time Slider"); | ||
}); | ||
|
||
it("loads a map", () => { | ||
cy.visit(`http://localhost:3001/#timeslider`); | ||
getMap(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
module.exports = { | ||
extends: [require.resolve("@vertigis/web-sdk/config/.eslintrc")], | ||
parserOptions: { | ||
tsconfigRootDir: __dirname, | ||
tsConfigRootDir: __dirname, | ||
}, | ||
rules: {}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 9 additions & 7 deletions
16
libraries/3d-tools/src/components/AreaMeasurement/AreaMeasurement.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 7 additions & 7 deletions
14
libraries/3d-tools/src/components/ElevationProfile/ElevationProfile.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 10 additions & 9 deletions
19
libraries/3d-tools/src/components/ElevationProfile/designer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.