- 
                Notifications
    You must be signed in to change notification settings 
- Fork 117
Update route summary tooltip with correct time and correct URL Routing #51
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
          
     Open
      
      
            wdcsimon
  wants to merge
  3
  commits into
  valhalla:master
  
    
      
        
          
  
    
      Choose a base branch
      
     
    
      
        
      
      
        
          
          
        
        
          
            
              
              
              
  
           
        
        
          
            
              
              
           
        
       
     
  
        
          
            
          
            
          
        
       
    
      
from
wdcsimon:master
  
      
      
   
  
    
  
  
  
 
  
      
    base: master
Could not load branches
            
              
  
    Branch not found: {{ refName }}
  
            
                
      Loading
              
            Could not load tags
            
            
              Nothing to show
            
              
  
            
                
      Loading
              
            Are you sure you want to change the base?
            Some commits from the old base branch may be removed from the timeline,
            and old review comments may become outdated.
          
          
  
     Open
                    Changes from all commits
      Commits
    
    
            Show all changes
          
          
            3 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      
    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 hidden or 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 hidden or 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
    
  
  
    
              
  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.
This seems wrong, can you elaborate here?
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.
Basically "directions" or "isochrones" are not physical files, but handlers, so they should follow a # rather that a / as this provides correct URL routing. If we use the / then if a user does a browser page refresh, they end up generating a 404-error page, by using the # we avoid this potential issue. See https://maps.whanganui.govt.nz/routing to see this in action.
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.
Right, as a web dev noob I figured that's mostly syntactical in real life if using
/or#.What I can see on your demo page, it's not properly resolving permalinks, i.e. page refreshes fail to parse the full URL into a parameterized version of the web app. E.g. this: https://maps.whanganui.govt.nz/routing/#directions?profile=bicycle&wps=175.02682766786324%2C-39.91050190801741%2C175.04880524660373%2C-39.93498734998717, would generate a route from the waypoints on https://valhalla.openstreetmap.de/.
Wouldn't you also have to update the function which parses the URL from a permalink?
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.
Though I'm still open to adhering to proper standards (if that's what it is), but another point is people already pointing to the app, in all the issues in upstream Valhalla etc. If there's no really good reason to change it, I wouldn't like to include that in the merge, it'd mess up all existing links (I know I can tell Apache to deal with this, but again, needs a good reason for me).
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.
Good point about the permalink, the # doesn't help with that. Will look at how that can be resolved.
Probably better to stick with the / at the moment.
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 think @chrstnbwnkl convinced me about the
#, I always wondered why so many SPAs do that. Anyways, I guess we'll just need to update the URL parsing function to trigger permalinks on#. I'd guess it could be done in a backwards-compatible way so that old/URLs are still resolved properly, e.g. from open Valhalla issues. There's custom code in the app for that, I remember.If you don't have the time for that @wdcsimon let us know and we'll handle it at some point. Thanks anyway!