-
Notifications
You must be signed in to change notification settings - Fork 71
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
Load Track from file and add as Route #312
Conversation
Nice, great feature! Make sure to run UI-wise, would it be possible to combine this with the regular track loading? Having two entries could be slightly confusing for users not knowing about the difference between routes and tracks. Also, there is currently no way to convert a track after is has already been added. Here are some ideas:
|
Ups thank you for the yarn checking commands, wasn't aware that let is not allowed (all specifications I read prefer it). I like your suggestions, will try to implement it. |
Prettier and Eslint should automatically be executed as pre-commit hook, don't know why that apparently didn't work: Lines 17 to 20 in 8621c44
But no need to remove those - I intend to introduce Babel, just want to get a bugfix release out first, so probably will postpone merging after that. |
I had thought about having a common dialog, but wasn't sure. For everyday use two separate menu entries might be more efficient and less bloated. On the other hand, it might be useful for common settings like choosing the color for the the track(s) to load. I personally don't really mind either way for this PR, as we already got the users confused that the loaded tracks aren't editable.
I don't want to raise the bar for merging this PR. This should be an enhancement for later in a separate issue, as we currently have no general concept for interacting with tracks (changing color, removing) - neither on the map nor in the layer switcher, also see #297 (comment). |
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.
Thanks for your PR! Some minor comments inline.
js/plugin/RouteLoaderConverter.js
Outdated
|
||
if(isBusy === true) | ||
$("#loadedittrackdlg #msg_busy").removeClass("invisible"); | ||
// $("#loadedittrackdlg #busy_img").addClass("d-block"); |
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.
Do you want to keep commented code (two more)?
js/plugin/RouteLoaderConverter.js
Outdated
turf.featureEach(this._currentGeoJSON,(feature,idx) => { | ||
if(turf.getType(feature) == "Point") | ||
{ | ||
console.log("POI",feature); |
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.
Please remove the console.log
js/plugin/RouteLoaderConverter.js
Outdated
if (toGeoJSON === undefined) { | ||
if (typeof window !== 'undefined') { | ||
toGeoJSON = require('togeojson'); | ||
} else { | ||
toGeoJSON = require('togeojson')(root); | ||
} | ||
} |
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.
We don't need this? Could you move this to external code when using in other contexts?
You shold be able just to push more commits into your branch, see the GitHub hint at end of comments section below:
|
I am with you, that the best approach is, to move these UI suggestions in new feature requests. So I am not touching the UI for now |
Sorry my fault I believed to close only this discussion thread so I have ot reopen it. Beneath the code changes you mentioned (I was too lazy to recheck it) I will although try to remove the ES6 features (understanding that Babel would sove this, but I will try to follow the current coding rules). |
Thanks for your contribution! |
Only by the maintainers, so this is done by me. |
Many thanks for maintaining this nice project. |
- common track style - TracksLoader now also adds points as POIs - RouteLoaderConverter does not add route points as POI
Loading a track as route with lots of waypoints (simplify tolerance of 0) caused a long pause before even handling the first route request. This seems to be caused by a repaint for every added marker/layer. Adding them all at once in FeatureGroup.addTo(map) helps (although still added in a loop).
to prevent code in GPX getting executed like this: <name><img src="xyz" onerror="alert('script executed')"></name>
This pull request is related to #254 and #274. It adds a dropdown item and modal dialog to import a local trackfile and using parts of the linestring points to add it as route.
I haven't done yarn push-transifex, because in my understanding should be done after merge (otherwise please tell me).
Feel free to change or request changes from me.