-
Notifications
You must be signed in to change notification settings - Fork 15
PB-101 : zoom on GPX extent on file added #626
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
Conversation
Passing run #441 ↗︎Details:
Review all test suite changes for PR #626 ↗︎ |
4761db4
to
b3f7679
Compare
9661d0e
to
690237f
Compare
@@ -465,7 +466,7 @@ const actions = { | |||
if (!extent) { | |||
updatedLayer.errorKey = 'kml_gpx_file_empty' | |||
updatedLayer.hasError = true | |||
} else if (!getKmlExtentForProjection(rootState.position.projection, extent)) { | |||
} else if (!getExtentForProjection(rootState.position.projection, extent)) { |
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.
I've just seen that in your previous PR for GPX support it seems that you don't support GPX after a reload as the GPX data will not be set (no store subscriber to get the GPX data from url). This means that you would need to add that support and also need a similar logic in the layer store as here and have a updateGpxLayer()
and test here again for the extent being in projection bound like for kml. So we would handle the case were an online GPX is updated and the new version is out of bound.
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.
That's something I wanted to do in another PR
re-using some parts that were made for KML
adding test to better cover getExtentForProjection and getKmlExtent better feedback when a parsed GPX is empty or out of the current projection's bounds
690237f
to
b0261cb
Compare
// TODO : zoom to extent | ||
const extent = bbox(gpxToGeoJSON(parseGpx)) | ||
if (!extent) { | ||
throw new EmptyGPXError() |
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.
You also need to handle this error here
web-mapviewer/src/modules/menu/components/advancedTools/ImportFile/ImportFileLocalTab.vue
Line 79 in d9e436d
} else if (error instanceof EmptyKMLError) { |
2f20b59
to
cfa281a
Compare
re-using some parts that were made for KML
Test link