Comments (5)
Now it is available via throwing parameter to Formatter like,
formatter: new L.Routing.Valhalla.Formatter({units:'imperial'})
- corrected wrong answer
from lrm-mapzen.
Hi, I've tried without the unitNames parameter, as you suggested on the leaflet-routing-machine repo, but it doesn't seem to have any effect.
Am I right in thinking the json passed to Valhalla should include a units parameter with this setting? It isn't doing... this is an example of the json that's generated:
{"locations":[{"lat":53.43753,"lon":-1.10557,"type":"break"},{"lat":53.5224,"lon":-1.1394,"type":"break"}],"costing":"auto"}
Any suggestions? Or am I missing something?
Thanks
from lrm-mapzen.
If you want miles returned from Valhalla then you need to add directions_options":{"units":"miles"}
to the request, for example:
{"locations":[{"lat":53.43753,"lon":-1.10557,"type":"break"},{"lat":53.5224,"lon":-1.1394,"type":"break"}],"costing":"auto","directions_options":{"units":"miles"}}
from lrm-mapzen.
If you are using the upstream, couldn't it be the case that the commits that added this feature aren't merged upstream? @hanbyul-here did you pr your changes back to upstream?
from lrm-mapzen.
Yes, you can pass the unit option to Valhalla, but lrm-valhalla is currently not using that option. It just gets default value from Valhalla in km, and converts it with Formatter (It is planning to update to use all available options of Valhalla soon! ) I updated example of lrm-valhalla using miles on master branch, and npm side too. Please try this and let us know it works for you or not.
from lrm-mapzen.
Related Issues (20)
- Example of bicycle routing with different types of bikes
- Sub-Route (transfer) bug HOT 1
- getting ready for leaflet 1.0 HOT 2
- add location hash for gh-pages example
- Error in Routing Calculations HOT 4
- Problem with pedestrian mode HOT 4
- Tune by Turn & Search for the destination HOT 3
- L.Routing.mapzenFormatter and options HOT 1
- Can't set the language to spanish HOT 8
- No 'Access-Control-Allow-Origin' to valhalla.mapzen.com HOT 7
- How to get a route without using the control? HOT 4
- Consider how to handle routing with multiple break points where some are along the way HOT 2
- Returning turn-by-turn data from a route. HOT 4
- Making the turn by turn example work with requirejs (r.js) HOT 2
- add a buffer to fitSelectedRoutes so pins don't get cut off HOT 1
- change too general class name HOT 1
- not passing some options HOT 1
- make default pins for the start and end of a route different colors
- fitBounds doesn't work with mapzenLine
- Add possibility to use your own Valhalla Server
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 lrm-mapzen.