Open dittaeva opened 12 years ago
Today you can go to route.is/relation/1114901 and it will take you directly to this relation. Do you want to change that to just route.is/1114901 as well?
Apparently going directly to a route name is also supported now: route.is/nb/route/Turvei A3
I want to skip the "[language code]/route/" part, and be able to go to area with route.is/in/, and redirect to search when either doesn't match existing routes/areas. There's a conflict with the language codes here, not sure what to do with that, there might be other conflicts as well.
So, I'd like "route.is/Turvei A3" to tak me directly to the route, "route.is/Turvaei A3" to take me to search, and "route.is/in/Sogndal" to take me to map centered on Sogndal municipality (area) with the route list open, and "route.is/in/Sogndæl to take me to search. The route.is/in feature probably needs to only look at areas with administrative codes of some sort.
So for route.is/in/California you just want to got to the first result in Nominatim?
And a URL like this route.is/Jotunheimen should go to the search panel?
I guess the language codes are always shorter than relation numbers (and only with numbers, so there shouldn't be a conflict there. Route names could probably conflict with language codes, but those conflicts would be few, and one could differentiate between language code and route name with a "/" on language names.
Ok, you answered most of my questions while posting them :-)
But you want to remove the language code entirely from the URL?
So for route.is/in/California you just want to got to the first result in Nominatim?
I suppose yes, and I suppose the state is on top because it has "Admin Level: 4".
And a URL like this route.is/Jotunheimen should go to the search panel?
If there is no route by that name, yes.
But you want to remove the language code entirely from the URL?
I suppose so, at least from the URL that is used/displayed. Gotta go now.
Ok, then I need to check how to do the translations without the language code.
I thought it was independent of the url (detected) already.
Ok, I will check it out.
I have commited some code which makes is possible to do:
route.is/Turvei A3 -> opens the relation route.is/Turvaaai A3 -> opens the search panel route.is/1629177 -> opens the relation
The code still adds the language code. I'll try to remove that. And I need to add the route.is/in URL's.
Now it is also possible to open an area by using the URL: route.is/in/Jotunheimen -> opens the map showing Jotunheimen area, and opens the routes panel
It takes only the first result matching one of the types defined here: https://github.com/Kresendo/waymarked-trails-site/blob/master/django/src/routemap/apps/search/views.py#L124
Still haven't removed the language code yet. I will leave this issue for comments now, before I continue.
This seems to work very well indeed. I am still not sure about the language codes, so as long as URLs without them also work I think we can leave them in. One feature that I do miss is for the header text of the route list to include the name of the area we are seeing.
So instead of "Routes in area" it would say "Routes in Jotunheimen". This might as well be a feature that is always used for the route list so that whichever area you are looking at it would be in the header. Does nominatim support such an "inverted" search?
@lonvia this is now live on http://test.route.is , would you like a pull request for Waymarked Trails?
I'd certainly love to see issue 58 solved and the 'in/' link is really nice, too. I'd prefer keeping the route/relation links, though.
If you don't like the language prefixes, you can switch Django to language support via cookies. I think it is sufficient to replace the i18n_patterns with normal patterns. Check out the Django docs around this section.
One feature that I do miss is for the header text of the route list to include the name of the area we are seeing.
Ok, that is fixable.
So instead of "Routes in area" it would say "Routes in Jotunheimen". This might as well be a feature that is always used for the route list so that whichever area you are looking at it would be in the header. Does nominatim support such an "inverted" search?
You can do reverse geocoding, but I think it only gives you administrative areas.
Ok, then let's do both. When area has been specified with the URL (route.is/in/Jotunheimen) we use the area name from the URL, when just bringing up list of routes for an area we use reverse geocoding. If the name is too long for the list box it should be cut off with "…".
I'd prefer keeping the route/relation links, though.
Ok, we'll enable them too then.
If you don't like the language prefixes, you can switch Django to language support via cookies. I think it is sufficient to replace the i18n_patterns with normal patterns. Check out the Django docs around this section.
Let's do that @esisa
It does not seems like Nominatim return an area name that we can actually use so I will skip that feature.
Example Eidsbugarden, Jotunheimen. http://nominatim.openstreetmap.org/reverse?format=xml&lat=61.37465&lon=8.29266&zoom=18&addressdetails=1
If you don't like the language prefixes, you can switch Django to language support via cookies. I think it is sufficient to replace the i18n_patterns with normal patterns. Check out the Django docs around this section.
I cannot get this to work. The language support break if I replace i18n_patterns with normal patterns. I tried lots of different solutions, but none have worked so far.
Then lets just keep them in for now.
fredag 14. juni 2013 skrev Espen Oldeman Lund:
If you don't like the language prefixes, you can switch Django to language support via cookies. I think it is sufficient to replace the i18n_patterns with normal patterns. Check out the Django docs around this section.
I cannot get this to work. The language support break if I replace i18n_patterns with normal patterns. I tried lots of different solutions, but none have worked so far.
— Reply to this email directly or view it on GitHubhttps://github.com/WNRI/route.is/issues/13#issuecomment-19456228 .
Then lets just keep them in for now
OK.
The user should be able to go directly to a relation with route.is/[relation ID], and directly to a named route with route.is/California%20Coastal%20Trail, or directly to a view of a named area with route.is/in/California. All other URLs with text should be redirected to search, f.ex.
See also lonvia/waymarked-trails-site#58 which is the same issue, but for Waymarked Trails.