-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gslux 755 location info #175
Merged
Merged
Changes from all commits
Commits
Show all changes
52 commits
Select commit
Hold shift + click to select a range
920eda7
setup click location
mki-c2c 290edc7
query and compute location infos
mki-c2c fc24e3b
setup basic UI for streetview component
mki-c2c cd09bfd
implement OL feature for displaying streetview on map canvas
mki-c2c 28ff7de
missing commit of fixed linting
mki-c2c 2eaf56f
fix typing
mki-c2c dac271c
import streetview icons as static asssets for correct bundling
mki-c2c 767784d
remove useless tailwind style imports for streetview icons
mki-c2c 8bd90ea
add missing static asset import file
mki-c2c cb6c7a3
- make streetview-div persistant in DOM (v-show instead of v-if)
mki-c2c 533558a
- wait for DOM update before setting streetview position, otherwise, …
mki-c2c 2390270
add feature interactions for streetview navigation
mki-c2c ef6213a
fix regex in tests
mki-c2c d4e400c
remove yellow pointer when streetview is active
mki-c2c 1169a8b
refactoring:
mki-c2c 2cff725
- fix tests
mki-c2c 2483f57
compute links to cyclomedia and oblique view
mki-c2c 18ec59a
review fixes
mki-c2c ea26222
use env constants
mki-c2c a4d39a5
update viewport center in permalink on location info click
mki-c2c 6ab0f26
fix short URL in migration
mki-c2c b9b9dd2
move composables into components
mki-c2c c5d4fd6
fix directives
mki-c2c e44218f
fix length formatter
mki-c2c fb58f35
use new elevation formatter
mki-c2c b24dba3
fix yellow click point watcher
mki-c2c ee61068
refactor formatting functions
mki-c2c 28b75b0
add correct logics for buttons
mki-c2c 9f4f92a
provide support for routing in info panel
mki-c2c a66c0dc
deactivate location info when the info panel is closed
mki-c2c 84cd76b
export necessary vars for info integration in v3
mki-c2c 4355e2f
integrate v4 location info component
mki-c2c 748df56
fix typing
mki-c2c cc13f23
fix unit tests
mki-c2c 8bf36ff
add e2e test
mki-c2c 984ac02
review comments, import typing for google maps API
mki-c2c a857a73
add docstring
mki-c2c f3ec572
refactoring of url download and constants for CRS
mki-c2c 1c6354f
improve DOM
mki-c2c 2dbe417
use fixed API responses to have predictable test results
mki-c2c e943a0b
synchronize postrender for streetview tests
mki-c2c e5ec30d
integrate location info and feature info
mki-c2c d5c8ad1
tune assertions to fix timing in order to make location info tests re…
mki-c2c a814426
fix permalink
mki-c2c e280ba4
fix e2e test
mki-c2c b2efe06
use arrow function in should will make cypress wait for the expected …
mki-c2c 525c5e6
fix test
mki-c2c 2c3f0d8
fix legends test
mki-c2c af2d822
refactor info features
mki-c2c 1954e75
explicit wait for legend fixtures
mki-c2c 333a240
remove unnecessary unmount hook (review comments)
mki-c2c ce754fa
explicit wait for profile API calls
mki-c2c File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,163 @@ | ||
describe('Location Info', () => { | ||
beforeEach(() => { | ||
cy.intercept('POST', 'short/create', { | ||
statusCode: 200, | ||
body: { short_url: 'http://localhost:8080/s/uSxF' }, | ||
}).as('shortUrl') | ||
|
||
cy.intercept( | ||
{ | ||
method: 'GET', | ||
pathname: '/geocode/reverse', | ||
}, | ||
req => { | ||
const dist = Math.sqrt( | ||
(parseFloat(req.query.easting.toString()) - 67887) ** 2 + | ||
(parseFloat(req.query.northing.toString()) - 85410) ** 2 | ||
) | ||
const categorizedDist = | ||
dist > 5 ? (dist > 100 ? 1972.1284 : 394.2305) : 20.98493 | ||
req.reply({ | ||
statusCode: 200, | ||
body: { | ||
count: 1, | ||
results: [ | ||
{ | ||
id_caclr_locality: '37', | ||
id_caclr_street: '1147', | ||
id_caclr_bat: '213956', | ||
street: 'Bergstr', | ||
number: '18', | ||
locality: 'Roodt/Eisch/Test', | ||
commune: 'Habscht', | ||
postal_code: '8398', | ||
country: 'Luxembourg', | ||
country_code: 'lu', | ||
distance: categorizedDist, | ||
contributor: 'ACT', | ||
geom: { | ||
type: 'Point', | ||
coordinates: [req.query.easting, req.query.northing], | ||
}, | ||
geomlonlat: { | ||
type: 'Point', | ||
coordinates: [6.00041535, 49.697110053], | ||
}, | ||
}, | ||
], | ||
}, | ||
}) | ||
} | ||
) | ||
}) | ||
|
||
describe('Open location info on position', () => { | ||
describe('Display basic feature info for multiple layers', () => { | ||
beforeEach(() => { | ||
cy.visit('/?zoom=8') | ||
}) | ||
it('should display coordinate and address information in the panel', () => { | ||
cy.get('[data-cy="locationInfo"]').should('be.hidden') | ||
cy.url().should('not.contain', 'crosshair=') | ||
cy.window() | ||
.its('olMap') | ||
.then(function (olMap) { | ||
const featureLayers = olMap | ||
.getLayers() | ||
.getArray() | ||
.filter((l: any) => l.get('cyLayerType') === 'infoFeatureLayer') | ||
const features = featureLayers | ||
.map((l: any) => l.getSource().getFeatures()) | ||
.flat() | ||
cy.wrap(features.length).should('equal', 0) | ||
}) | ||
|
||
cy.get('div.ol-viewport').rightclick(350, 300, { force: true }) | ||
cy.get('[data-cy="locationInfo"]').should('be.visible') | ||
cy.get('[data-cy="locationInfo"]').find('input').should('exist') | ||
cy.get('[data-cy="locationInfo"]') | ||
.find('input') | ||
.invoke('val') | ||
.should('contain', 'localhost:8080/s') | ||
// 8 location infos (5 projections, elevation, address, distance) | ||
cy.get('[data-cy="locationInfo"] > div > table > tbody > tr').should( | ||
'have.length', | ||
8 | ||
) | ||
cy.get('[data-cy="locationInfo"] > div > table > tbody > tr') | ||
.eq(6) | ||
.find('td') | ||
.should('contain.text', 'Roodt/Eisch/Test') | ||
cy.get('[data-cy="locationInfo"] > div > table > tbody > tr') | ||
.eq(7) | ||
.find('td') | ||
.should('contain.text', '1.97 km') | ||
// check pointer | ||
cy.window() | ||
.its('olMap') | ||
.then(function (olMap) { | ||
const featureLayers = olMap | ||
.getLayers() | ||
.getArray() | ||
.filter((l: any) => l.get('cyLayerType') === 'infoFeatureLayer') | ||
const features = featureLayers | ||
.map((l: any) => l.getSource().getFeatures()) | ||
.flat() | ||
cy.wrap(features.length).should('equal', 1) | ||
}) | ||
|
||
cy.url().should('contain', 'crosshair=true') | ||
}) | ||
|
||
it('streetview should integrate smoothly in the panel', () => { | ||
cy.get('div.ol-viewport').rightclick(350, 300, { force: true }) | ||
cy.get('[data-cy="streetviewOff"]').should('not.exist') | ||
cy.get('[data-cy="streetviewOn"]').click() | ||
cy.get('[data-cy="streetviewOff"]').should('exist') | ||
cy.get('[data-cy="streetviewNoData"]').should('be.visible') | ||
cy.get('[data-cy="streetviewNoData"]') | ||
.find('span') | ||
.should( | ||
'contain.text', | ||
"Il n'y a pas de panorama Google disponible à cet endroit" | ||
) | ||
cy.window() | ||
.its('olMap') | ||
.then(function (olMap) { | ||
const featureLayers = olMap | ||
.getLayers() | ||
.getArray() | ||
.filter((l: any) => l.get('cyLayerType') === 'svFeatureLayer') | ||
const features = featureLayers | ||
.map((l: any) => l.getSource().getFeatures()) | ||
.flat() | ||
cy.wrap(features.length).should('equal', 0) | ||
}) | ||
cy.get('div.ol-viewport').rightclick(350, 50, { force: true }) | ||
cy.get('[data-cy="streetviewNoData"]').should('not.be.visible') | ||
cy.get('[data-cy="streetviewLoading"]').should('not.be.visible') | ||
cy.window() | ||
.its('olMap') | ||
.should(function (olMap) { | ||
const featureLayers = olMap | ||
.getLayers() | ||
.getArray() | ||
.filter((l: any) => l.get('cyLayerType') === 'svFeatureLayer') | ||
const features = featureLayers | ||
.map((l: any) => l.getSource().getFeatures()) | ||
.flat() | ||
expect(features.length).to.equal(3) | ||
}) | ||
cy.get('[data-cy="locationInfo"] > div > table > tbody > tr') | ||
.last() | ||
.find('td') | ||
.should('contain.text', '20.98 m') | ||
cy.get('div.ol-viewport').click(382, 82, { force: true }) | ||
cy.get('[data-cy="locationInfo"] > div > table > tbody > tr') | ||
.last() | ||
.find('td') | ||
.should(el => expect(el).to.contain.text('394.23 m')) | ||
}) | ||
}) | ||
}) | ||
}) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason why hiding the panel with css instead of removing it from the dom?