Comments (19)
OK, so now only those profiles without an icon will be counted.
You can now also set an icon using the "icon" field in the config.
I will probably open a PR today, until then you can see the changes here
SachsenspieltCoding@5b4cab4
from graphhopper-maps.
Well, yes, but that's not exactly what I meant. The issue is how we handle both custom icons and icons based on a profile's prefix.
Maybe we can talk about this in more detail in person on Tuesday?
from graphhopper-maps.
@easbar Yes, I see your point. I actually thought of that when I added it, which is why I mentioned it in the PR.
How do you think it could be handled better? Just replace the icon with something more meaningful, or can you think of a completely different approach?
from graphhopper-maps.
Maybe some icon that is 1) less confused-looking and 2) something that allows the profiles to be distinguished from each other. For example we could just use icons showing numbers 1, 2, 3, ... ? Or a car icon with a little number next to it? Then again they aren't necessarily cars so maybe something more generic? But honestly I don't have a good suggestion atm, so maybe just numbers will do for now?
from graphhopper-maps.
It would be an idea. But aren't numbers even more confusing? I mean, when there are a bunch of contextless numbers in the profiles area, it may lead to even more confusion what a "3" or a "5" means for instance.
The best option I can think of is to allow some sort of custom icons respectively the general option to set icons for custom profiles.
from graphhopper-maps.
Maybe it is just me, but I think numbers 1,2,3,... would be less confusing (and seem less buggy) for me than three question marks. To figure out which one is which we still need to hover the icon of course.
from graphhopper-maps.
Perhaps @karussell could give his opinion on this?
While I'm still not 100% sure about the number icons, I have no problem implementing this in a PR.
Also, I would prefer an option to set an icon manually, but this would require a new field in the RoutingProfile
interface, which is implemented by the graphhopper.d.ts
file.
https://github.com/graphhopper/graphhopper-maps/blob/master/src/api/graphhopper.d.ts#L59-L61
Is it possible to add it there, or should I then add a second .d.ts
file that implements this interface?
from graphhopper-maps.
Also, I would prefer an option to set an icon manually, but this would require a new field in the RoutingProfile interface,
Can we not just do this using the config file?
from graphhopper-maps.
Yes, that is the plan. But since the config is more or less typed through the TypeScript interfaces, this would also require a change in the type files. There may be a way around this, I haven't fully analysed it yet.
from graphhopper-maps.
The config is typed in custom.d.ts and sure you can modify it accordingly when you are adding the icon option
from graphhopper-maps.
Oh yes, thanks for the hint!
from graphhopper-maps.
This is what you thought of, right?
from graphhopper-maps.
Yes, that looks good?! Definitely better than the question marks if you ask me. Maybe just start counting the first unknown profile as "1"(?)
from graphhopper-maps.
Yeah, I also thought of this. It would require more code, so I just decided for the easier option first.
I'll try my best.
from graphhopper-maps.
Sounds good. Maybe as a base icon we could check if an existing profile name is "contained" and then show the number at top right like for mtb_hello it would be the "mtb" icon as base:
from graphhopper-maps.
Sounds possible. I'll look into this tomorrow
from graphhopper-maps.
What do you think? I've loaded the default profiles from the GraphHopper API to test it out. The styling is work in progress.
There is one edge case I came across that I would like to discuss here. Let's say I have the profiles
car, car_veryfast, slowvehicle
.
By default it would look like this:
But what if I manually change the slowvehicle
icon to a car icon? Well, we can do two things
- Ignore counting and set the icon normally
- Behave as if it were named
car_slowvehicle
, so that it also has the number in the top right corner.
The current implementation is 1), which I think has the most potential for customisation.
from graphhopper-maps.
Really nice, thanks!
For the slowvehicle
: not 100% sure if I understood the case but for a profile name without an icon we could fallback to the current question mark plus a number if there is more than one unknown profile.
from graphhopper-maps.
For the protocol: The option to set icons via an attribute in the profile config will not be supported. Instead, the focus is on the prefixes, which technically allow custom profiles in a way that is enough for the most users.
from graphhopper-maps.
Related Issues (20)
- Hazards - All Hazards On A Route Should Be Able To Be Visible At The Same Time And Indicate Hazard Type
- "Recalculate the current route based on current position"-Button HOT 2
- current position marker
- Sometimes clicking on an item in the autocomplete list is broken HOT 1
- provide possibility showing all restaurants, parks or similar
- App crashes when changing windows size HOT 4
- Incomplete text after selecting same item from list. HOT 5
- one map tile service is down others stay blank too
- Drawing areas fails if no priority block exists HOT 1
- autocomplete selection broken for touch devices on non-mobile view
- Enhancement: Display arrival time for all options - and maybe arrival time within elevation profile info window
- Changing map HOT 1
- add profile for busses HOT 1
- Could not get geocoding results with geocoder-convertor HOT 1
- wrong route offset
- map flickering when zooming and route is shown HOT 1
- make all conditional access obstacles visible via route hint
- sac_scale value hiking HOT 1
- Walking navigation doesn't find the shortest path HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graphhopper-maps.