Compare commits

..

280 Commits

Author SHA1 Message Date
DennisSchiefer f2ca2ccaed bumped version to 0.1.6 2012-05-16 12:37:59 +01:00
DennisSchiefer 4cdf683447 Merge branch 'develop'
Conflicts:
	AUTHORS.md
	WebContent/OSRM.config.js
	WebContent/localization/OSRM.Locale.dk.js
	WebContent/localization/OSRM.Locale.pl.js
2012-05-16 12:37:01 +01:00
DennisSchiefer 3bce384f9b changed test server to work server 2012-05-16 12:31:57 +01:00
DennisSchiefer 03bb7f4f40 Merge branch 'trial/viass' into trial/gui 2012-05-16 12:29:44 +01:00
DennisSchiefer c900cd0122 Merge remote-tracking branch 'origin/trial/gui' into trial/gui
Conflicts:
	WebContent/OSRM.config.js
2012-05-16 10:32:21 +01:00
DennisSchiefer 2fbfdc93b1 moved maintenance message to config file 2012-05-16 10:27:25 +01:00
DennisSchiefer cd68e21b95 moved maintenance message to config file 2012-05-16 10:08:10 +01:00
DennisSchiefer 8677218404 transparancy for IE8 2012-05-16 10:07:21 +01:00
DennisSchiefer f6744f9aa1 corrected jsonp call to fetch timestamp 2012-05-16 07:41:36 +01:00
DennisSchiefer df623df3e9 compatibility 2012-05-16 07:34:04 +01:00
shiin 6665207066 added basic maintenance message 2012-05-15 23:02:19 +02:00
shiin 26262541a4 completed language-dependent bing maps 2012-05-15 21:03:58 +02:00
DennisSchiefer ba0064af99 prepared for bing language specific maps 2012-05-15 17:19:09 +01:00
DennisSchiefer 8d40bc7f4f added option to query current layer 2012-05-15 16:24:10 +01:00
DennisSchiefer b85849b6bd fix to timeoutRoute call 2012-05-15 15:10:24 +01:00
DennisSchiefer 543b54e2af fix to polnish translation 2012-05-15 15:10:02 +01:00
DennisSchiefer dfd5ee9134 added via marker numbering 2012-05-15 13:48:24 +01:00
DennisSchiefer 19ae6db308 made timestamp secure against injections 2012-05-15 13:47:36 +01:00
DennisSchiefer 2a634041a7 different colors for history routes 2012-05-15 13:36:21 +01:00
DennisSchiefer 34389f9789 added support for new API regarding via_nodes 2012-05-15 11:39:39 +01:00
DennisSchiefer 2ee7ea87cd prevent bug when first route yields a timeout 2012-05-15 10:42:05 +01:00
DennisSchiefer 6186f3f27e added option for Bing Layers (you still have to provide your own API
key, though!)
2012-05-15 10:33:45 +01:00
DennisSchiefer a53a34a261 integrated attribution fix to Leaflet code 2012-05-15 10:08:40 +01:00
DennisSchiefer e706a9867d data_updated -> data_timestamp 2012-05-14 17:50:17 +01:00
DennisSchiefer 9e5689858e when checking if two routes are equal, only check up to 5 digits 2012-05-14 17:12:02 +01:00
DennisSchiefer 40900f6f56 put Danish after German (de < dk) 2012-05-14 16:31:24 +01:00
DennisSchiefer f266655b9b added data update date 2012-05-14 15:40:23 +01:00
DennisSchiefer 8b0ae1bc5f added Italien translsation (thanks to sabas),
clarified procedure to add commits
2012-05-14 15:39:59 +01:00
DennisSchiefer 979327ec82 refactored code for history routes 2012-05-14 12:18:04 +01:00
DennisSchiefer 0976358fdf added comment 2012-05-14 07:12:29 +01:00
DennisSchiefer 9502689ff8 correction for IE css 2012-05-14 07:06:29 +01:00
shiin 36f5b36c6b more work on history routes 2012-05-13 20:28:24 +02:00
shiin 101fc5d02f removed third parameter from OSRM.bind as it is no longer used 2012-05-13 12:59:19 +02:00
shiin e9736173b0 added clarifying comment to JSONP call 2012-05-13 12:51:49 +02:00
shiin 1ec7c6ab50 did some renaming 2012-05-12 11:33:05 +02:00
shiin f90d1db802 made html + css look better 2012-05-12 08:22:21 +02:00
DennisSchiefer 14ca66459a history routes work now (i hope) 2012-05-11 16:25:06 +01:00
DennisSchiefer e7b3590352 commented out route history 2012-05-11 15:08:04 +01:00
DennisSchiefer c0e86c47c2 changed many names for jsonp routing functions 2012-05-11 12:30:00 +01:00
DennisSchiefer 4a8c2f323c removed comments 2012-05-11 08:23:39 +01:00
DennisSchiefer d4e6ad8a05 added funtionality to the show previous routes button 2012-05-10 15:28:18 +01:00
DennisSchiefer f95e515f20 fixed bug with IE and select elements,
made config box nicer
2012-05-10 14:44:20 +01:00
DennisSchiefer 85ea79701c work on history routes 2012-05-10 14:43:20 +01:00
DennisSchiefer 357ec5acfc danish: da -> dk 2012-05-10 12:53:51 +01:00
DennisSchiefer 47b2268504 test 2012-05-10 12:52:55 +01:00
DennisSchiefer 224c55dec1 fixed bug that did not always remove drag marker on reset 2012-05-10 12:26:56 +01:00
DennisSchiefer 1727187b5e Danish da -> dk 2012-05-10 11:01:50 +01:00
shiin 4d28f02273 route history test 2 2012-05-09 22:34:27 +02:00
shiin a329b1259e finished new gui for language toggle 2012-05-09 22:22:51 +02:00
DennisSchiefer e39479b908 changes localization to new selector elements,
completed units selector,
modified localization selector
2012-05-09 17:27:11 +01:00
DennisSchiefer 2b4935c29c added code to create selector elements with our look&feel 2012-05-09 17:23:11 +01:00
DennisSchiefer 3e15c0a164 tests with showing routing history 2012-05-09 16:22:18 +01:00
DennisSchiefer 7830f82b62 added language support for new elements 2012-05-09 15:21:11 +01:00
shiin 84677ddddf moving UI to new boxes 2012-05-08 22:37:27 +02:00
shiin c8912ad6ee fixed printing bug in IE8 2012-05-08 21:40:55 +02:00
shiin 2d956983a5 finished new box design 2012-05-08 20:52:41 +02:00
DennisSchiefer 884f79a620 new handling of gui boxes (work in progress) 2012-05-08 16:58:08 +01:00
DennisSchiefer 39f33b670d added functions for binding functions to a context and for concating
them
2012-05-08 15:58:54 +01:00
DennisSchiefer a975dba975 first steps to make printing work with IE8 2012-05-08 15:57:25 +01:00
DennisSchiefer 50aea3310a fixed bug that caused wrong destinations when clicking on a routing
instruction after zooming
2012-05-08 13:32:44 +01:00
DennisSchiefer 6c1c830c0d commented out stuff 2012-05-08 10:23:22 +01:00
DennisSchiefer 772ad0d618 added polnish and danish translation, minor version bump 2012-05-07 07:09:56 +01:00
shiin 826cbc9a24 added parameter to set meters/miles,
changed toHumanDistance functions so that conditions don't need to be
checked all the time
2012-05-06 19:10:43 +02:00
shiin 7451cc3150 added Danish translation 2012-05-06 18:45:13 +02:00
shiin 0e9dcc30b7 added miles/feet display (without gui option at the moment) 2012-05-06 18:37:23 +02:00
shiin 222e4e8916 testing route history 2012-05-06 18:36:58 +02:00
DennisSchiefer a3cdba5044 moved localization and printing paths to (internal) variables, so it's
easier to place everything in a different directory
2012-05-04 13:05:30 +01:00
DennisSchiefer 57040e6924 minor fixes in printing for IE8 2012-05-04 08:46:14 +01:00
DennisSchiefer b9a817ce26 bug with redrawing print route 2012-05-03 16:26:11 +01:00
DennisSchiefer 4130144687 removed Leaflet relative path 2012-05-03 15:25:58 +01:00
DennisSchiefer ec5934364a images moved from css style to main.js 2012-05-03 14:18:11 +01:00
DennisSchiefer 23d1ea2a32 polnish tranlation added 2012-05-03 09:06:34 +01:00
shiin 28e78e6ea6 Übersetzung 2012-04-28 08:54:53 +02:00
shiin 90925bd91d made printing window more robust (on refresh, stand-alone opening,
closing browser window...)
2012-04-28 08:33:55 +02:00
shiin 42f38a42db reconverted all routing arrows 2012-04-28 08:32:52 +02:00
shiin ab8c700a94 removed localization directory from config file 2012-04-27 21:09:29 +02:00
shiin 10a96e3aba bugfix 2012-04-27 20:52:53 +02:00
DennisSchiefer 99f0abef0c changed some mouse cursors 2012-04-27 17:29:49 +01:00
DennisSchiefer e7bb320924 bugfix for displaying correct map tile layer when printing 2012-04-27 16:39:06 +01:00
DennisSchiefer 96e5c4b518 version bump 2012-04-27 16:10:03 +01:00
DennisSchiefer a3cfd49f97 shortener reply parameter name flexible,
check if reply is correct,
beautified continue marker
2012-04-27 12:13:27 +01:00
DennisSchiefer fbe722465d individual ids/classes for geocoder search results 2012-04-27 08:55:11 +01:00
DennisSchiefer 448e6cfdc7 gui handling now uses a main class in which all other gui classes plug
in
2012-04-27 08:40:18 +01:00
DennisSchiefer 8e79b29925 changed result-link to route-link 2012-04-27 07:02:37 +01:00
DennisSchiefer bd61494cf4 added authors 2012-04-27 07:01:33 +01:00
DennisSchiefer d33a75812d changed result-link to route-link 2012-04-27 07:01:19 +01:00
DennisSchiefer 9f5f6019bf changed language in html to English 2012-04-26 15:32:48 +01:00
DennisSchiefer aef70b832c josm request will also use only 6 digits precision 2012-04-26 13:45:54 +01:00
DennisSchiefer 611d265a27 corrected display of geocoder results 2012-04-26 13:45:23 +01:00
DennisSchiefer 635b13b61c all route/geocoder requests will only send 6 digits after the decimal
point.
2012-04-26 13:15:41 +01:00
DennisSchiefer a8a4f56292 printing support finalized (yeah!) 2012-04-26 12:49:30 +01:00
DennisSchiefer a0ceee732e added relative root url for Leaflet 2012-04-26 12:48:01 +01:00
DennisSchiefer 560ce74d06 printing window will now be loaded in IE and Chrome 2012-04-26 07:34:51 +01:00
DennisSchiefer d7ffb0d492 trying to get printing to act correctly with Chrome/IE 2012-04-25 16:36:53 +01:00
DennisSchiefer 369edbe9a7 opening josm will only load the current view if you are close enough,
opening josm will no longer trigger a constant loading symbol in
browsers
2012-04-25 15:01:20 +01:00
DennisSchiefer 94ca30c690 printing icon can now deactivates when there is no route 2012-04-25 12:17:36 +01:00
DennisSchiefer ab1e5255eb Merge branch 'trial/folders' into develop 2012-04-25 07:12:02 +01:00
shiin 0068d4062d changed header area for normal routes 2012-04-24 23:23:27 +02:00
shiin 04298b73f3 added image for "head on",
removed unneeded images
2012-04-24 23:06:19 +02:00
DennisSchiefer 7657f0de22 finished printing support (?) 2012-04-24 22:12:24 +02:00
DennisSchiefer 7cdeeb0723 continued work on printing header 2012-04-24 15:28:09 +01:00
DennisSchiefer c0b71cb62a restored large images 2012-04-24 15:24:42 +01:00
DennisSchiefer 253df58fdb beginning to restructure routing header area 2012-04-24 09:38:20 +01:00
DennisSchiefer cd3005f9fe corrected wrong name when querying layers 2012-04-24 09:35:13 +01:00
DennisSchiefer 94cf796ed2 refinement to French translation 2012-04-24 08:50:27 +01:00
DennisSchiefer 18995379ab added explanation for contributing 2012-04-24 07:42:03 +01:00
DennisSchiefer a5246cc8b8 added french to config 2012-04-24 07:41:44 +01:00
DennisSchiefer 3a7f527c68 french translation added, thanks to Nicolas belett VIGNERON,
Moyg, Jean-Frédéric
2012-04-24 07:25:22 +01:00
DennisSchiefer f404337383 Merge remote-tracking branch 'temp/master' into develop 2012-04-24 07:16:38 +01:00
shiin 7421117278 extended mapview to give information about the current visible tile
layer,
continued work on printing
2012-04-24 00:56:41 +02:00
JeanFred f6173b7a48 Add localisation in French 2012-04-23 22:14:27 +02:00
DennisSchiefer dffd67ef72 continued printing work 2012-04-23 17:30:09 +01:00
DennisSchiefer 3444499cf4 onload event can use a different window 2012-04-23 17:29:53 +01:00
DennisSchiefer 7241438502 corrected error ne instead of sw direction 2012-04-23 17:29:18 +01:00
DennisSchiefer 44c38146c9 enabled printing 2012-04-23 14:48:09 +01:00
DennisSchiefer 2060088c6b finished making jsonp parameter names interchangeable 2012-04-23 09:58:34 +01:00
shiin 38defe9629 some files weren't removed properly... 2012-04-23 00:09:22 +02:00
shiin 087bb12847 more file & folder restructuring 2012-04-23 00:08:02 +02:00
shiin c59a6f9444 reorganized folders 2012-04-22 23:48:43 +02:00
shiin 40c0222ffd better UI for route reversal (source/target are changed when response is
received/timeout)
2012-04-22 21:03:50 +02:00
shiin f763ec2664 work-around for invisible scrollbars in Chrome when usind webkit3d 2012-04-22 20:50:09 +02:00
DennisSchiefer 186f78f01e adapted printing to new geometry routines 2012-04-21 08:14:17 +01:00
DennisSchiefer 1da10942d5 changed jsonp call, so that position of the callback command has
to be given as "%jsonp" in the string
2012-04-21 08:13:42 +01:00
DennisSchiefer 7ad253732a link shortener parameters now changeable in config file 2012-04-21 08:11:57 +01:00
DennisSchiefer 4b1c4068f2 Merge branch 'trial/printing' into develop 2012-04-20 12:11:50 +01:00
DennisSchiefer 57ec4e5465 route geometry is requeried 2012-04-20 11:07:47 +01:00
DennisSchiefer f3290ab64b zooming/switching to show unnamed roads will not rebuild the complete
driving directions,
pending JSONP calls can be cleared
2012-04-20 07:37:26 +02:00
DennisSchiefer eb3c2f560e switched back to using normal images in route description (FF wasn't
actually faster, he just reported wrong numbers)
2012-04-19 21:32:07 +02:00
DennisSchiefer 869b13e9db init via_nodes with empty array 2012-04-19 12:59:31 +01:00
DennisSchiefer 57d9bc5bae route direction icons are now background images (which should be faster
in rendering)
2012-04-19 11:02:09 +01:00
DennisSchiefer 917ef160c5 delete route when reversing it 2012-04-19 11:01:18 +01:00
DennisSchiefer ae513dce5c corrected error with marking unnamed streets, introduced by speeding up
route geometry computation
2012-04-19 11:00:57 +01:00
DennisSchiefer 93b5ce2968 switched to small driving direction images 2012-04-19 09:59:36 +01:00
DennisSchiefer ba08d0b36c added road to first driving direction,
allow geographic direction in all driving directions
2012-04-19 09:57:15 +01:00
DennisSchiefer 2e60e92b31 added waiting message to route reversal,
moved reversal logic to OSRM.Markers
2012-04-19 09:48:32 +01:00
DennisSchiefer 5a9a55544b improved speed of decoding route geometry 2012-04-18 16:56:56 +01:00
DennisSchiefer ee7c79641a fixed bug in route reversal (source/target marker would switch colors
when dragged)
2012-04-18 16:55:56 +01:00
DennisSchiefer 6e57c31ec2 added localization to route link 2012-04-18 16:29:44 +01:00
DennisSchiefer 3d9d4f3764 geolocation will no longer interfer with initial position/route passed
to the website,
corrected centering offset of routes
2012-04-18 08:51:31 +01:00
DennisSchiefer 596e7fc60a added cross-browser support for onload event,
made IE8 work again
2012-04-18 07:46:04 +01:00
DennisSchiefer 8845c070a2 moved favicon handling to webserver 2012-04-18 06:56:17 +01:00
DennisSchiefer eaf5dd328f added finnish for overview map 2012-04-17 22:37:15 +02:00
DennisSchiefer 20a0a3b170 Merge remote-tracking branch 'origin/develop' into develop 2012-04-17 22:35:03 +02:00
DennisSchiefer 8d5d1a9400 Merge branch 'trial/printing' into develop 2012-04-17 22:34:18 +02:00
DennisSchiefer 572a306d6d Merge commit 'f2efcfc588f75c391946b1cf8d5600fcf849d3c9' into develop 2012-04-17 22:33:26 +02:00
DennisSchiefer 63a9e4c6c2 remove newline 2012-04-17 22:32:56 +02:00
DennisSchiefer c84d4b323e Merge commit '9bd4b772789b11ca085e7e7f052b410903cf2eb0' into develop 2012-04-17 22:30:28 +02:00
DennisSchiefer 46f717566d added finnish localization 2012-04-17 09:06:15 +01:00
DennisSchiefer 0199673d14 Merge remote-tracking branch 'temp/master' into develop 2012-04-17 09:03:16 +01:00
Teemu Koskinen 607d5408d3 Add Finnish translations 2012-04-16 21:01:40 +03:00
DennisSchiefer 33035fccc0 pushed version 2012-04-16 19:43:57 +02:00
DennisSchiefer c14e461370 added onload_zoomlevel 2012-04-16 19:39:47 +02:00
DennisSchiefer 6f4e9a1d11 added explanation to driving instruction localization 2012-04-16 18:57:21 +02:00
DennisSchiefer 3610e21854 bugfix for zoomlevel in route links 2012-04-16 18:51:22 +02:00
DennisSchiefer f6a3815e91 continued work on printing support 2012-04-16 16:04:36 +01:00
DennisSchiefer f2efcfc588 increased padding when centering on a route 2012-04-16 16:03:59 +01:00
DennisSchiefer 2bf573dbe1 bug in position of " in string 2012-04-16 12:28:51 +01:00
DennisSchiefer 9bd4b77278 use relative image locations 2012-04-16 12:28:16 +01:00
DennisSchiefer fb995ad0b0 small UI move 2012-04-16 10:26:10 +01:00
DennisSchiefer 3a85661e45 fixed bugs with IE 2012-04-16 10:23:31 +01:00
DennisSchiefer 0ba881c390 localization for printing 2012-04-15 23:12:17 +02:00
DennisSchiefer c7782b2776 more work on printing 2012-04-15 23:01:05 +02:00
DennisSchiefer 23ca80030e disabled printing for this release 2012-04-15 19:35:50 +02:00
DennisSchiefer f08c389faa moved version to 0.1.4 2012-04-15 19:35:26 +02:00
DennisSchiefer 47369a0036 continued work on printing support 2012-04-15 19:34:18 +02:00
DennisSchiefer 253b591a87 fixed error with translation of east to German 2012-04-15 19:33:23 +02:00
DennisSchiefer 5c4488d350 removed fixed with from input boxes 2012-04-15 19:32:41 +02:00
DennisSchiefer 25310ff1bd corrected error in via computation when no road was visible 2012-04-15 19:31:49 +02:00
DennisSchiefer c2d52080d3 use geocode even if no route is found 2012-04-14 18:49:28 +02:00
DennisSchiefer bf681855ed moved list of supported languages and tileservers to config file 2012-04-14 18:26:32 +02:00
DennisSchiefer 899d216b9b made it easier to remove localization and on-demand loading of new
language packs,
added parameter to say whether to use on-demand reloading,
added parameter for the directory that contains the localization files,
corrected a small bug when the string for the HEAD_ON instruction was
not available,
2012-04-14 18:03:33 +02:00
DennisSchiefer 73aeab3a57 reworked loading of images and icons (-> easier to add new ones),
adapted routing description to use new description ids,
fixed bug with localization dropdown and FF3,
added localization for "(found X results)"
2012-04-13 17:47:53 +01:00
DennisSchiefer 61073ebc9d added newline to readme 2012-04-12 22:52:18 +02:00
DennisSchiefer 393334cabd corrected error in route description,
made dropdown button more beautiful
2012-04-12 22:44:30 +02:00
DennisSchiefer 01e4afe2f0 changed legal string in html file 2012-04-11 23:07:00 +02:00
DennisSchiefer 9b599c90f8 Merge branch 'trial/printing' into develop
Conflicts:
	WebContent/OSRM.debug.js
2012-04-11 23:03:24 +02:00
DennisSchiefer 252c234221 made parsing of get parameters more robust 2012-04-11 22:59:41 +02:00
DennisSchiefer 888a5d04c8 removal of dragger marker more consistent,
changed printing initialization to be more easily removable from GUI,
localization bug fixes,
added option to give language as get parameter (hl=),
2012-04-11 22:00:19 +02:00
DennisSchiefer b1631eff77 more localization,
fixed bugs with FF3
2012-04-11 17:31:02 +01:00
DennisSchiefer ffd5e2de99 all images are now loaded in main.js 2012-04-10 23:50:04 +02:00
DennisSchiefer ea207cef6e improved language support: geocoding uses language settings, geocoding
results & locations are also translated if possible
2012-04-10 21:47:30 +02:00
DennisSchiefer 893c09f6fc Merge remote-tracking branch 'origin/trial/printing' into trial/printing
Conflicts:
	WebContent/OSRM.GUI.js
2012-04-09 22:35:47 +02:00
shiin 213bb71b35 changed behaviour of geocoder (return always triggers geocoder, moving a
single marker clears search results)
2012-04-09 11:59:32 +02:00
shiin 0fd8d4d8cf all visible lat/lng coordinates are truncated after 6 digits (this
includes inputboxes, osmbugs link, route link, gpx link),
moved all events from html to javascript
2012-04-08 19:50:30 +02:00
shiin 13f0a3fb6b redid html and css,
switched to sans-serif font
2012-04-08 12:02:36 +02:00
shiin 3141d3ba48 prepared localization / route description module to use description ids
instead of description strings
2012-04-06 12:27:23 +02:00
DennisSchiefer 4ff4fcf516 corrected bug in reverse geocoder timeout handler 2012-04-05 09:08:41 +02:00
DennisSchiefer f273f0cfc5 drag marker can no longer be removed by clicking on it 2012-04-05 09:04:48 +02:00
DennisSchiefer dc192d47a8 input boxes are no longer deleted on language change 2012-04-05 01:12:15 +02:00
DennisSchiefer 0f032f7635 bugfix, so that markers will use correct mousepointer again 2012-04-04 15:40:16 +02:00
DennisSchiefer 060c7e499a added bugtracker URL to readme 2012-04-04 15:11:38 +02:00
DennisSchiefer 28a241c371 more testing on printing 2012-04-04 13:08:25 +02:00
DennisSchiefer bab2887f8f Merge branch 'trial/dragging' into develop
Conflicts:
	WebContent/OSRM.JSONP.js
	WebContent/OSRM.debug.js
	WebContent/main.html
2012-04-03 21:30:35 +02:00
DennisSchiefer abba49a44e - added GUI support for language switching
- first tests for support of printing
2012-04-03 21:13:44 +02:00
DennisSchiefer 4638e7c24d corrected error and bumped version to 0.1.3 2012-04-02 20:57:39 +02:00
DennisSchiefer fe420e5bfc added buttons to delete source and target 2012-04-02 08:54:25 +02:00
DennisSchiefer 93ae928236 added icons that can change their image,
added image change while dragging markers,
increased (invisible) size of drag marker,
fixed issues with drag marker and highlight marker overlapping
2012-04-02 08:29:03 +02:00
DennisSchiefer 3b485f1426 finished dragging of routes,
moved corrected bugs in Leaflet to their own file
(drag after dragend, distance to path),
open osmbugs in new window
2012-04-01 19:13:54 +02:00
DennisSchiefer 5165e01a5c added draggable routes,
changed findViaPosition to only return the index and not set the node,
IMPORTANT: changed leaflet-src.js for a bugfix!,
2012-03-30 16:30:16 +01:00
DennisSchiefer 7b4e923ec4 added option (commented out) to use input box for route links to get
a marked url when clicking in it -> test what is better
2012-03-30 10:35:14 +01:00
DennisSchiefer 007dd19cec added buttons to switch to JOSM and OSM Bugs,
added getCenter function that respects UI visibility
2012-03-30 10:10:51 +01:00
DennisSchiefer fd3cf02af4 complete restructure of OSRM.Routing 2012-03-29 16:55:12 +01:00
DennisSchiefer 2bb51717b9 extracted OSRM.Map and OSRM.MapView classes,
moved centering that respects UI visibility to OSRM.MapView
2012-03-29 14:34:55 +01:00
DennisSchiefer 4fe6346146 reordered styles in main.html,
readded default values to GUI,
made TODO marker to check whether GUI is initilaized
2012-03-28 15:02:09 +01:00
DennisSchiefer c5bd2b0b1d renamed routing.js,
encapsulated local helper functions in OSRM.base
2012-03-28 14:30:26 +01:00
DennisSchiefer 71426cf760 changed OSRM debug to work with IE6,
deactivated JSONP timing routines
2012-03-28 14:06:18 +01:00
DennisSchiefer 0ab287e707 modified JSONP statistics,
rearranged OSRM debug so that it works in IE
2012-03-28 13:59:39 +01:00
DennisSchiefer 49cc0bfb09 added functions to test JSONP timings 2012-03-28 13:01:26 +01:00
DennisSchiefer e132ac5c53 moved routing functions to OSRM namespace,
added functions to measure JSONP timings
2012-03-28 12:57:42 +01:00
DennisSchiefer 1a9776cff9 moved utils into OSRM namespace 2012-03-28 12:17:22 +01:00
DennisSchiefer 342a0d22bd - removed bug in centering routes when UI was hidden
- moved all browser dependencies to OSRM.Browser
- refactored via code to use Leaflet functions
- added function to extract route layerPoints
2012-03-28 10:51:54 +01:00
DennisSchiefer 251a43980a switched to Markdown readme 2012-03-26 16:47:40 +01:00
DennisSchiefer 41ba8b5e3e next try 2012-03-26 14:28:38 +01:00
DennisSchiefer 30df2aae10 Do inline links now work with Github asciidoc renderer? 2012-03-26 14:27:18 +01:00
DennisSchiefer a6f00b1856 yet another version 2012-03-26 14:15:44 +01:00
DennisSchiefer af26c47052 GitHUB didn't like my asciidoc... 2012-03-26 14:01:53 +01:00
DennisSchiefer 0a774aeef2 Changed name of README 2012-03-26 13:58:32 +01:00
DennisSchiefer a89aa68686 added README 2012-03-26 13:53:39 +01:00
DennisSchiefer 4b93107415 made logo a bit smaller so that it is centered,
removing source or target now clears route description,
changed GUI handling to no longer be dependent on the actual width of
the sidebar
2012-03-23 18:13:07 +01:00
DennisSchiefer e0602934b2 Refactored Geocoder -> now resides in OSRM namespace 2012-03-23 09:55:55 +01:00
DennisSchiefer fdace26222 changed getPosition().lat / .lng to getLat(), getLng() 2012-03-22 18:31:35 +01:00
DennisSchiefer bef41ed667 geocoder error messages now state the input string,
website is XHTML1.0 strict compliant,
centering now respects if the sidebar is shown,
corrected spelling mistakes
2012-03-22 17:35:09 +01:00
DennisSchiefer 4e2e95cc27 version and date is now taken from OSRM.base,
when source/target markers are deleted the inputbox is emptied
2012-03-19 17:09:03 +01:00
DennisSchiefer f4c6ec90ce fix to route link generator and parser 2012-03-19 10:28:32 +01:00
DennisSchiefer eed22b343a more geocoder refactoring 2012-03-18 22:17:59 +01:00
DennisSchiefer 08ce748a37 removed dirty flags 2012-03-18 22:00:29 +01:00
DennisSchiefer 69790eb8c7 refactored geocoder code (still need to check dirty flags) 2012-03-18 21:44:14 +01:00
DennisSchiefer 97b9c65c97 refactored reverse geocoder 2012-03-18 20:03:15 +01:00
DennisSchiefer 92dbadebae increased zoom level for route description (new config entry),
removed some deprecated comments
2012-03-18 18:17:04 +01:00
DennisSchiefer fe6d854e11 improved handling of dragging,
link to route gui improved,
JSONP can now take parameters
2012-03-18 17:42:05 +01:00
DennisSchiefer 4615b01fdf moved inputbox logic to javascript file,
corrected error with second ENTER not being registered
2012-03-18 15:04:17 +01:00
DennisSchiefer 276b023b05 changed checking if eventhandler storage exists 2012-03-18 12:29:02 +01:00
DennisSchiefer 350cacb2f3 added try-finally guards to JSONP calls 2012-03-18 11:38:21 +01:00
DennisSchiefer 25ec6105c5 reverse geocoding now always shows two information if possible 2012-03-17 22:26:57 +01:00
DennisSchiefer 3e4249ad41 used abbreviations for sub-namespaces GLOBALS, CONSTANTS 2012-03-17 20:49:19 +01:00
DennisSchiefer 13126ac0c1 moved all variables/objects to OSRM namespace 2012-03-17 20:43:52 +01:00
DennisSchiefer d51aee4fbe bugfix to route link storing map view location 2012-03-17 17:07:34 +01:00
DennisSchiefer f9877fd8ba refactoring: used hasSource, hasTarget routines throughout the code 2012-03-17 17:04:45 +01:00
DennisSchiefer a39a35df73 moved leaflet.ie.css to new position 2012-03-17 15:48:24 +01:00
DennisSchiefer 2670dd68f3 added event handler base class 2012-03-17 15:28:27 +01:00
DennisSchiefer 9adb590ce7 added OSRM.CONSTANTS, OSRM.GLOBALS for better structuring,
improved comments in OSRM.base.js and OSRM.config.js
2012-03-17 14:45:04 +01:00
DennisSchiefer 9567a7e38c added support for saving route zoom level and position in route links 2012-03-17 14:17:08 +01:00
DennisSchiefer d86eaa00a0 compressed target.png 2012-03-16 18:27:52 +01:00
DennisSchiefer 54c0d50b68 reseting now also resets OSRM.JSONP 2012-03-16 17:52:10 +01:00
DennisSchiefer 204189c326 - version bump to v0.1.1
- restructured buttons (route is gone, search is show)
- added prefetching gui hide/show buttons
- increased timeout to 5000ms
- click highlight marker to hide it
- boundary box on Europe when querying geocoder
- added "reached your destination" display in route instructions
- improved visual for route summary
- when loading a stored route, source and target are named and the route
is zoomed correctly
- improved display results of reverse geocoder (ues village/country
tags)
- more consistent behaviour when displaying reverse geocoder results
or geocoordinates
- reverse geocoder now works at dragend
- more consistent behaviour when leaving an input box
- reversing a route when only one marker is set empties the result box
2012-03-16 15:06:43 +01:00
DennisSchiefer acdfa546a8 added more precise distance values (at least three digits of precision) 2012-03-16 10:41:54 +01:00
DennisSchiefer 6a9216d6e4 added functions to check whether source or target exists,
readded routing button
2012-03-16 09:42:14 +01:00
DennisSchiefer 9c2a1dc37f implemented several security measures when parsing GET input to the site 2012-03-16 09:07:03 +01:00
DennisSchiefer 26c9d357f0 made reverse geocoding more intuitive,
changed search and route buttons to centering buttons
2012-03-16 07:22:47 +01:00
DennisSchiefer 879d73c629 testing to remove route button -> search will be automatical on lost
focus
2012-03-15 17:45:22 +01:00
DennisSchiefer 441146eeae changed look of route description header area 2012-03-15 17:42:17 +01:00
DennisSchiefer d453cadc8c added call option to set destination when calling the site 2012-03-15 14:22:00 +01:00
DennisSchiefer 74188206e8 website url is now retrieved directly from browser,
removed unneeded localization strings
2012-03-15 14:01:34 +01:00
DennisSchiefer 700206099b made route reset more robust by clearing *really* everything,
improved route description (added distances to the right, bold street
names, orientation in first instruction and non-breaking spaces for
units),
route link now displays the shortened link name,
content of input boxes is only overwritten if the respective node is
set or dragged,
experimental support for reverse geocoding (when setting a new node by
text box or clicking on map)
2012-03-15 13:29:28 +01:00
DennisSchiefer aa952df541 added favicon,
removed commata that IE was complaining about
2012-03-15 09:05:00 +01:00
DennisSchiefer b8944da9dc prevent browser context menu on map 2012-03-14 18:07:15 +01:00
DennisSchiefer 22dda2b285 added new gui buttons for opening/closing,
route button now works,
more precise error message when geocoder does not find a result,
added maximum input length for text boxes
2012-03-14 17:42:14 +01:00
DennisSchiefer 0ee469c4e0 Merge branch 'develop' of
https://DennisSchiefer@bitbucket.org/DennisSchiefer/project-osrm-web.git
into develop

Conflicts:
	WebContent/routing.js
2012-03-14 16:50:14 +01:00
DennisSchiefer a7eef27e99 added legal headers,
beautified comments,
moved language settings to config,
moved timeout settings to config,
corrected bug with route link and via nodes,
removed old files,
corrected spelling error for roundabout
2012-03-14 16:45:15 +01:00
DennisSchiefer 4b40f1253f added legal headers,
beautified comments,
moved language settings to config,
moved timeout settings to config,
corrected bug with route link and via nodes
removed old files
2012-03-14 16:30:11 +01:00
DennisSchiefer 5ebe8080f9 small bug class/id mixed up 2012-03-14 11:24:40 +01:00
DennisSchiefer d92b28d2c3 restructured for release 2012-03-14 10:39:37 +01:00
DennisSchiefer ec27881f39 test fencing 2012-03-13 22:39:28 +01:00
DennisSchiefer c5a8ec7c31 added better lat/lng display when dragging,
added experimental faster route redraw (commented out),
changed default website url and routing url,
removed drag after dragend event workaround
2012-03-13 22:25:40 +01:00
DennisSchiefer afbd3347da added clear debug log button,
removed showing of links in gpx, route requests,
checked html with validator
2012-03-13 20:51:44 +01:00
DennisSchiefer 41bcafc3a1 added lat/lng processing 2012-03-13 17:57:48 +01:00
DennisSchiefer 27d24885a9 debug window stays at botoom when adding data 2012-03-13 17:36:40 +01:00
DennisSchiefer 805402b230 starting to reverse geocoding 2012-03-13 17:32:18 +01:00
DennisSchiefer 4918549bac fixed bug when selecting city options in geocoder,
added clicking on map to create markers,
reset also clears input boxes now
2012-03-13 15:26:53 +01:00
DennisSchiefer 784f417857 changed geocoder to official OSM geocoder,
switched default map style to osm.org
2012-03-13 14:31:23 +01:00
DennisSchiefer 0bc3e098ac added GUI support for IE9 and IE10,
changed GUI legal text,
changed via-node deletion to click only,
moved default entries for input boxes to config file,
made input boxes selectable again
2012-03-13 14:15:07 +01:00
DennisSchiefer dfd3a5d554 changed round-about symbol, corrected bug with ENTER not working on
location input
2012-03-13 10:26:31 +01:00
DennisSchiefer 9dcc472c60 Merge branch 'feature/prefetching' into develop 2012-03-12 13:33:14 +01:00
DennisSchiefer c972e2cf41 Merge branch 'gui/buttons' into develop 2012-03-12 13:26:38 +01:00
DennisSchiefer de9ab83cea ignore eclipse files 2012-03-12 13:16:32 +01:00
schiefer 174e388e2d debug window added,
when including OSRM.debug, a debug window is shown
2012-03-12 11:33:39 +01:00
DennisSchiefer ee41fb45b7 added more turn instructions, changed clickability of gui 2012-03-10 17:08:25 +01:00
schiefer 93892b9806 changed buttons look 2012-03-09 17:33:06 +01:00
schiefer 749d83a69f - store prefetched images permanently
(otherwise they are not prefetched before the function terminated)
- store each type of marker icon once
2012-03-09 15:26:32 +01:00
schiefer 8b109904c8 initial import 2012-03-09 09:24:51 +01:00
1844 changed files with 12352 additions and 327209 deletions
-8
View File
@@ -1,8 +0,0 @@
{
"plugins": ["transform-class-properties"],
"presets": [
"stage-0",
"es2015",
"react"
]
}
-90
View File
@@ -1,90 +0,0 @@
---
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: false
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: true
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: false
BinPackArguments: false
BinPackParameters: false
BraceWrapping:
AfterClass: true
AfterControlStatement: true
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: true
AfterStruct: true
AfterUnion: true
BeforeCatch: true
BeforeElse: true
IndentBraces: true
BreakBeforeBinaryOperators: false
BreakBeforeBraces: Allman
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
ColumnLimit: 100
CommentPragmas: '^ IWYU pragma:'
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
IncludeCategories:
- Regex: '^<'
Priority: 3
- Regex: '^"(osrm|util|engine|extract|contract)/'
Priority: 2
- Regex: '.*'
Priority: 1
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Right
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
TabWidth: 8
UseTab: Never
...
-4
View File
@@ -1,4 +0,0 @@
---
Checks: '-clang-analyzer-*,google-*,llvm-*,misc-*,readability-*,-google-build-explicit-make-pair,-google-explicit-constructor,-google-readability-braces-around-statements,-google-readability-casting,-google-readability-namespace-comments,-google-readability-function,-google-readability-todo,-google-runtime-int,-llvm-namespace-comment,-llvm-header-guard,-llvm-twine-local,-misc-argument-comment,-readability-braces-around-statements,-readability-identifier-naming'
...
-14
View File
@@ -1,14 +0,0 @@
# Kind-specific patterns to check AST nodes against. Both python-clang and
# libclang docs explain CursorKind, with differences in detail. See also:
# - https://github.com/llvm-mirror/clang/blob/aca4fe314a55cacae29e1548cb7bfd2119c6df4c/bindings/python/clang/cindex.py#L599
# - http://clang.llvm.org/doxygen/group__CINDEX.html#gaaccc432245b4cd9f2d470913f9ef0013
# - https://docs.python.org/2/library/re.html#regular-expression-syntax
class_decl: '^([A-Z]+[a-z]+)+$'
struct_decl: '^([A-Z]+[a-z]+)+$'
field_decl: '^[a-z_]+$'
var_decl: '^[a-z]+[a-z0-9_]*$'
parm_decl: '^[a-z]*[a-z0-9_]*$'
namespace: '^[a-z_]*$'
cxx_method: '^([A-Z]+[a-z]+)+$'
function_decl: '^[a-z]+([A-Z]+[a-z]+)*$'
-2
View File
@@ -1,2 +0,0 @@
test
build
-28
View File
@@ -1,28 +0,0 @@
{
"rules": {
"indent": [
2,
4
],
"quotes": [
1,
"single"
],
"linebreak-style": [
2,
"unix"
],
"semi": [
2,
"always"
],
"no-console": [
1
]
},
"env": {
"es6": true,
"node": true
},
"extends": "eslint:recommended"
}
-15
View File
@@ -1,15 +0,0 @@
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto
# Explicitly declare text files you want to always be normalized and converted
# to native line endings on checkout.
*.cpp text
*.hpp text
# Declare files that will always have CRLF line endings on checkout.
*.bat text eol=crlf
*.cmd text eol=crlf
*.ps1 text eol=crlf
# Declare files that will always have LF line endings on checkout.
*.sh text eol=lf
-19
View File
@@ -1,19 +0,0 @@
# Issue
What issue is this PR targeting? If there is no issue that addresses the problem, please open a corresponding issue and link it here.
Please read our [documentation](https://github.com/Project-OSRM/osrm-backend/blob/master/docs/releasing.md) on release and version management.
If your PR is still work in progress please attach the relevant label.
## Tasklist
- [ ] CHANGELOG.md entry ([How to write a changelog entry](http://keepachangelog.com/en/1.0.0/#how))
- [ ] update relevant [Wiki pages](https://github.com/Project-OSRM/osrm-backend/wiki)
- [ ] add tests (see [testing documentation](https://github.com/Project-OSRM/osrm-backend/blob/master/docs/testing.md)
- [ ] review
- [ ] adjust for comments
- [ ] cherry pick to release branch
## Requirements / Relations
Link any requirements here. Other pull requests this PR is based on?
+2 -112
View File
@@ -1,112 +1,2 @@
# mason #
#########
/.mason
/mason_packages
# pre compiled dependencies #
#############################
osrm-deps
.ycm_extra_conf.py
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
############
# it's better to unpack these files and commit the raw source
# git has its own built in compression methods
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip
# Logs and databases #
######################
*.log
*.sql
*.sqlite
# OS generated files #
######################
.DS_Store
ehthumbs.db
Icon?
Thumbs.db
# build related files #
#######################
/_build*
/build/
/example/build/
/test/data/monaco*
/test/data/ch
/test/data/corech
/test/data/mld
/cmake/postinst
# Eclipse related files #
#########################
.setting*
.scb
.cproject
.project
# Visual Studio (Code) related files #
######################################
/.vs*
/*.local.bat
# stxxl related files #
#######################
.stxxl
stxxl.log
stxxl.errlog
# Compiled Binary Files #
####################################
/osrm-extract
/osrm-io-benchmark
/osrm-components
/osrm-routed
/osrm-datastore
/osrm-prepare
/osrm-unlock-all
/osrm-cli
/osrm-check-hsgr
/osrm-springclean
/nohup.out
# Sandbox folder #
###################
/sandbox/
# Test related files #
######################
/test/profile.lua
/test/cache
/test/speeds.csv
/test/penalties.csv
node_modules
# Deprecated config file #
##########################
/server.ini
*.swp
# local lua debugging file
debug.lua
# node-osrm artifacts
lib/binding
/.settings
/.project
View File
-16
View File
@@ -1,16 +0,0 @@
*
!README.md
!CHANGELOG.md
!CONTRIBUTING.MD
!LICENCE.TXT
!package.json
!package-lock.json
!yarn.lock
!docs
!example
!taginfo.json
!lib/*.js
!profiles/*
!profiles/lib/*
!profiles/examples/*
!scripts/node_install.sh
-384
View File
@@ -1,384 +0,0 @@
language: cpp
git:
depth: 10
# sudo:required is needed for trusty images
sudo: required
dist: trusty
notifications:
email: false
branches:
only:
- master
- "5.16"
# enable building tags
- /^v\d+\.\d+(\.\d+)?(-\S*)?$/
cache:
yarn: true
ccache: true
apt: true
directories:
- test/cache
env:
global:
- secure: "hk+32aXXF5t1ApaM2Wjqooz3dx1si907L87WRMkO47WlpJmUUU/Ye+MJk9sViH8MdhOcceocVAmdYl5/WFWOIbDWNlBya9QvXDZyIu2KIre/0QyOCTZbrsif8paBXKIO5O/R4OTvIZ8rvWZsadBdmAT9GSbDhih6FzqXAEgeIYQ="
- secure: "VE+cFkseFwW4jK6XwkP0yW3h4DixPJ8+Eb3yKcchGZ5iIJxlZ/8i1vKHYxadgPRwSYwPSB14tF70xj2OmiT2keGzZUfphmPXinBaLEhYk+Bde+GZZkoSl5ND109I/LcyNr0nG9dDgtV6pkvFchgchpyP9JnVOOS0+crEZlAz0RE="
- CCACHE_TEMPDIR=/tmp/.ccache-temp
- CCACHE_COMPRESS=1
- CASHER_TIME_OUT=599 # one second less than 10m to avoid 10m timeout error: https://github.com/Project-OSRM/osrm-backend/issues/2742
- CCACHE_VERSION=3.3.1
- CMAKE_VERSION=3.7.2
- MASON="$(pwd)/scripts/mason.sh"
- ENABLE_NODE_BINDINGS=On
- NODE="4"
matrix:
fast_finish: true
# We override the compiler names here to yield better ccache behavior, which uses this as key
include:
# Debug Builds
- os: linux
compiler: "format-taginfo-docs"
env: NODE=6
sudo: false
before_install:
install:
- source $NVM_DIR/nvm.sh
- nvm install $NODE
- nvm use $NODE
- npm --version
- npm install --ignore-scripts
- npm link --ignore-scripts
script:
- ./scripts/check_taginfo.py taginfo.json profiles/car.lua
- ${MASON} install clang-format 3.8.1
- PATH=$(${MASON} prefix clang-format 3.8.1)/bin:${PATH} ./scripts/format.sh && ./scripts/error_on_dirty.sh
# See issue 4043
#- npm run docs && ./scripts/error_on_dirty.sh
after_success:
- os: linux
compiler: "gcc-7-debug-cov"
addons: &gcc7
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-7', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev', 'lcov']
env: CCOMPILER='gcc-7' CXXCOMPILER='g++-7' BUILD_TYPE='Debug' ENABLE_COVERAGE=ON CUCUMBER_TIMEOUT=20000
before_script:
- cd ${TRAVIS_BUILD_DIR}
- lcov --directory . --zerocounters # clean cached da files
after_success:
# Creating report
- cd ${TRAVIS_BUILD_DIR}
- lcov --directory . --capture --output-file coverage.info # capture coverage info
- lcov --remove coverage.info '/usr/*' --output-file coverage.info # filter out system
- lcov --list coverage.info #debug info
# Uploading report to CodeCov
- bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports"
- os: linux
compiler: "gcc-7-debug-asan"
addons: &gcc7
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-7', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev']
env: CCOMPILER='gcc-7' CXXCOMPILER='g++-7' BUILD_TYPE='Debug' TARGET_ARCH='x86_64-asan' ENABLE_SANITIZER=ON CUCUMBER_TIMEOUT=20000 LSAN_OPTIONS="suppressions=$TRAVIS_BUILD_DIR/scripts/travis/leaksanitizer.conf"
- os: linux
compiler: "clang-5.0-debug"
addons: &clang50
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['libstdc++-5-dev', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev']
env: CLANG_VERSION='5.0.0' BUILD_TYPE='Debug' CUCUMBER_TIMEOUT=60000
- os: linux
compiler: "mason-linux-debug-asan"
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['libstdc++-4.9-dev']
env: CLANG_VERSION='5.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_SANITIZER=ON LSAN_OPTIONS="suppressions=$TRAVIS_BUILD_DIR/scripts/travis/leaksanitizer.conf"
# Release Builds
- os: linux
compiler: "mason-linux-release"
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['libstdc++-4.9-dev']
env: CLANG_VERSION='5.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON RUN_CLANG_FORMAT=ON ENABLE_LTO=ON
- os: linux
compiler: "gcc-7-release"
addons: &gcc7
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-7', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev']
env: CCOMPILER='gcc-7' CXXCOMPILER='g++-7' BUILD_TYPE='Release'
- os: linux
compiler: "gcc-7-release-i686"
env: >
TARGET_ARCH='i686' CCOMPILER='gcc-7' CXXCOMPILER='g++-7' BUILD_TYPE='Release'
CFLAGS='-m32 -msse2 -mfpmath=sse' CXXFLAGS='-m32 -msse2 -mfpmath=sse'
- os: linux
compiler: "gcc-7-stxxl"
addons: &gcc7
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-7', 'libbz2-dev', 'libstxxl-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev']
env: CCOMPILER='gcc-7' CXXCOMPILER='g++-7' BUILD_TYPE='Release' ENABLE_STXXL=On
- os: linux
compiler: "gcc-5-release"
addons: &gcc49
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-5', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev', 'ccache']
env: CCOMPILER='gcc-5' CXXCOMPILER='g++-5' BUILD_TYPE='Release'
- os: linux
compiler: "gcc-6-release"
addons: &gcc49
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-6', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev', 'ccache']
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release'
- os: osx
osx_image: xcode9.2
compiler: "mason-osx-release-node-8"
# we use the xcode provides clang and don't install our own
env: ENABLE_MASON=ON BUILD_TYPE='Release' CUCUMBER_TIMEOUT=60000 CCOMPILER='clang' CXXCOMPILER='clang++' ENABLE_ASSERTIONS=ON ENABLE_LTO=ON NODE="8"
after_success:
- ./scripts/travis/publish.sh
- os: osx
osx_image: xcode9.2
compiler: "mason-osx-release-node-4"
# we use the xcode provides clang and don't install our own
env: ENABLE_MASON=ON BUILD_TYPE='Release' CUCUMBER_TIMEOUT=60000 CCOMPILER='clang' CXXCOMPILER='clang++' ENABLE_ASSERTIONS=ON ENABLE_LTO=ON NODE="4"
after_success:
- ./scripts/travis/publish.sh
# Shared Library
- os: linux
compiler: "gcc-7-release-shared"
addons: &gcc7
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-7', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev']
env: CCOMPILER='gcc-7' CXXCOMPILER='g++-7' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON
# Node build jobs. These skip running the tests.
- os: linux
sudo: false
compiler: "node-4-mason-linux-release"
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['libstdc++-4.9-dev']
env: CLANG_VERSION='5.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="4"
install:
- pushd ${OSRM_BUILD_DIR}
- |
cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DENABLE_MASON=${ENABLE_MASON:-OFF} \
-DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \
-DENABLE_CCACHE=ON \
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \
-DENABLE_GLIBC_WORKAROUND=ON
- make --jobs=${JOBS}
- popd
script:
- npm run nodejs-tests
after_success:
- ./scripts/travis/publish.sh
- os: linux
sudo: false
compiler: "node-4-mason-linux-debug"
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['libstdc++-4.9-dev']
env: CLANG_VERSION='5.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="4"
install:
- pushd ${OSRM_BUILD_DIR}
- |
cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DENABLE_MASON=${ENABLE_MASON:-OFF} \
-DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \
-DENABLE_CCACHE=ON \
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \
-DENABLE_GLIBC_WORKAROUND=ON
- make --jobs=${JOBS}
- popd
script:
- npm run nodejs-tests
after_success:
- ./scripts/travis/publish.sh
- os: linux
sudo: false
compiler: "node-8-mason-linux-release"
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['libstdc++-4.9-dev']
env: CLANG_VERSION='5.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="8"
install:
- pushd ${OSRM_BUILD_DIR}
- |
cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DENABLE_MASON=${ENABLE_MASON:-OFF} \
-DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \
-DENABLE_CCACHE=ON \
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \
-DENABLE_GLIBC_WORKAROUND=ON
- make --jobs=${JOBS}
- popd
script:
- npm run nodejs-tests
after_success:
- ./scripts/travis/publish.sh
- os: linux
sudo: false
compiler: "node-8-mason-linux-debug"
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['libstdc++-4.9-dev']
env: CLANG_VERSION='5.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="8"
install:
- pushd ${OSRM_BUILD_DIR}
- |
cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DENABLE_MASON=${ENABLE_MASON:-OFF} \
-DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \
-DENABLE_CCACHE=ON \
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \
-DENABLE_GLIBC_WORKAROUND=ON
- make --jobs=${JOBS}
- popd
script:
- npm run nodejs-tests
after_success:
- ./scripts/travis/publish.sh
before_install:
- source $NVM_DIR/nvm.sh
- nvm install $NODE
- nvm use $NODE
- node --version
- if [[ ! -z $TARGET_ARCH ]] ; then source ./scripts/travis/before_install.$TARGET_ARCH.sh ; fi
- |
if [[ -z $JOBS ]]; then
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
export JOBS=$((`nproc` + 1))
elif [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
export JOBS=$((`sysctl -n hw.ncpu` + 1))
fi
fi
- |
if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
sudo mdutil -i off /
fi
- |
if [[ ! -f $(which yarn) ]]; then
npm install -g yarn
fi
- export PACKAGE_JSON_VERSION=$(node -e "console.log(require('./package.json').version)")
- export PUBLISH=$([[ "${TRAVIS_TAG:-}" == "v${PACKAGE_JSON_VERSION}" ]] && echo "On" || echo "Off")
- echo "Using ${JOBS} jobs"
- yarn install --ignore-scripts
- yarn check --ignore-scripts --integrity
# Bootstrap cmake to be able to run mason
- CMAKE_URL="https://mason-binaries.s3.amazonaws.com/${TRAVIS_OS_NAME}-x86_64/cmake/${CMAKE_VERSION}.tar.gz"
- CMAKE_DIR="mason_packages/${TRAVIS_OS_NAME}-x86_64/cmake/${CMAKE_VERSION}"
- mkdir -p ${CMAKE_DIR}
- travis_retry wget --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C ${CMAKE_DIR} || travis_terminate 1
- export PATH=${CMAKE_DIR}/bin:${PATH}
- ${MASON} install tbb 2017_U7 && export LD_LIBRARY_PATH=$(${MASON} prefix tbb 2017_U7)/lib/:${LD_LIBRARY_PATH}
- ${MASON} install ccache ${CCACHE_VERSION} && export PATH=$(${MASON} prefix ccache ${CCACHE_VERSION})/bin:${PATH}
- |
if [[ ! -z ${CLANG_VERSION} ]]; then
export CCOMPILER='clang'
export CXXCOMPILER='clang++'
${MASON} install clang++ ${CLANG_VERSION} && export PATH=$(${MASON} prefix clang++ ${CLANG_VERSION})/bin:${PATH} || travis_terminate 1
# we only enable lto for release builds
# and therefore don't need to us ld.gold or llvm tools for linking
# for debug builds
if [[ ${BUILD_TYPE} == 'Release' ]]; then
${MASON} install binutils 2.27 && export PATH=$(${MASON} prefix binutils 2.27)/bin:${PATH} || travis_terminate 1
fi
fi
- ccache --max-size=256M # limiting the cache's size to roughly the previous job's object sizes
- export OSRM_INSTALL_DIR="$(pwd)/install-osrm"
- export OSRM_BUILD_DIR="$(pwd)/build-osrm"
- export CC=${CCOMPILER} CXX=${CXXCOMPILER}
- mkdir ${OSRM_BUILD_DIR}
install:
- pushd ${OSRM_BUILD_DIR}
- |
cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DENABLE_MASON=${ENABLE_MASON:-OFF} \
-DENABLE_ASSERTIONS=${ENABLE_ASSERTIONS:-OFF} \
-DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS:-OFF} \
-DENABLE_COVERAGE=${ENABLE_COVERAGE:-OFF} \
-DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \
-DENABLE_SANITIZER=${ENABLE_SANITIZER:-OFF} \
-DENABLE_STXXL=${ENABLE_STXXL:-OFF} \
-DBUILD_TOOLS=ON \
-DENABLE_CCACHE=ON \
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \
-DENABLE_GLIBC_WORKAROUND=${ENABLE_GLIBC_WORKAROUND:-OFF}
- echo "travis_fold:start:MAKE"
- make --jobs=${JOBS}
- make tests --jobs=${JOBS}
- make benchmarks --jobs=${JOBS}
- echo "travis_fold:end:MAKE"
- ccache -s
- sudo make install
- |
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${OSRM_INSTALL_DIR}/lib
fi
- popd
- mkdir example/build && pushd example/build
- export PKG_CONFIG_PATH=${OSRM_INSTALL_DIR}/lib/pkgconfig
- cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
- make --jobs=${JOBS}
- popd
script:
- if [[ $TARGET_ARCH == armhf ]] ; then echo "Skip tests for $TARGET_ARCH" && exit 0 ; fi
- make -C test/data benchmark
- ./example/build/osrm-example test/data/mld/monaco.osrm
# All tests assume to be run from the build directory
- pushd ${OSRM_BUILD_DIR}
- ./unit_tests/library-tests
- ./unit_tests/extractor-tests
- ./unit_tests/contractor-tests
- ./unit_tests/engine-tests
- ./unit_tests/util-tests
- ./unit_tests/server-tests
- ./unit_tests/partitioner-tests
- |
if [ -z "${ENABLE_SANITIZER}" ] && [ "$TARGET_ARCH" != "i686" ]; then
npm run nodejs-tests
fi
- |
- popd
- yarn test
+13
View File
@@ -0,0 +1,13 @@
The following people contributed code to the Open Source Routing Machine:
Dennis Schieferdecker
Dennis Luxen
Pascal Neis
Teemu Koskinen
Nicolas Belett Vigneron
Moyg
Jean-Frederic
Zbigniew Czernik
Jonas Häggqvist
Sabas
Paul Spencer
-722
View File
@@ -1,722 +0,0 @@
# 5.16.0 RC 7
- Changes from 5.15.1:
- Guidance
- ADDED #4676: Support for maneuver override relation, allowing data-driven overrides for turn-by-turn instructions [#4676](https://github.com/Project-OSRM/osrm-backend/pull/4676)
- CHANGED #4830: Announce reference change if names are empty
- CHANGED #4835: MAXIMAL_ALLOWED_SEPARATION_WIDTH increased to 12 meters
- CHANGED #4842: Lower priority links from a motorway now are used as motorway links [#4842](https://github.com/Project-OSRM/osrm-backend/pull/4842)
- CHANGED #4895: Use ramp bifurcations as fork intersections [#4895](https://github.com/Project-OSRM/osrm-backend/issues/4895)
- CHANGED #4893: Handle motorway forks with links as normal motorway intersections[#4893](https://github.com/Project-OSRM/osrm-backend/issues/4893)
- FIXED #4905: Check required tags of `maneuver` relations [#4905](https://github.com/Project-OSRM/osrm-backend/pull/4905)
- Profile:
- FIXED: `highway=service` will now be used for restricted access, `access=private` is still disabled for snapping.
- ADDED #4775: Exposes more information to the turn function, now being able to set turn weights with highway and access information of the turn as well as other roads at the intersection [#4775](https://github.com/Project-OSRM/osrm-backend/issues/4775)
- FIXED #4763: Add support for non-numerical units in car profile for maxheight [#4763](https://github.com/Project-OSRM/osrm-backend/issues/4763)
- ADDED #4872: Handling of `barrier=height_restrictor` nodes [#4872](https://github.com/Project-OSRM/osrm-backend/pull/4872)
# 5.15.1
- Changes from 5.15.0:
- Bugfixes:
- FIXED: Segfault in map matching when RouteLeg collapsing code is run on a match with multiple submatches
- Guidance:
- Set type of trivial intersections where classes change to Suppressed instead of NoTurn
# 5.15.0
- Changes from 5.14.3:
- Bugfixes:
- FIXED #4704: Fixed regression in bearings reordering introduced in 5.13 [#4704](https://github.com/Project-OSRM/osrm-backend/issues/4704)
- FIXED #4781: Fixed overflow exceptions in percent-encoding parsing
- FIXED #4770: Fixed exclude flags for single toll road scenario
- FIXED #4283: Fix overflow on zero duration segments
- FIXED #4804: Ignore no_*_on_red turn restrictions
- Guidance:
- CHANGED #4706: Guidance refactoring step to decouple intersection connectivity analysis and turn instructions generation [#4706](https://github.com/Project-OSRM/osrm-backend/pull/4706)
- CHANGED #3491: Refactor `isThroughStreet`/Intersection options
- Profile:
- ADDED: `tunnel` as a new class in car profile so that sections of the route with tunnel tags will be marked as such
# 5.14.3
- Changes from 5.14.2:
- Features:
- Added a `waypoints` parameter to the match service plugin that accepts indices to input coordinates and treats only those points as waypoints in the response format.
- Bugfixes:
- FIXED #4754: U-Turn penalties are applied to straight turns.
- FIXED #4756: Removed too restrictive road name check in the sliproad handler
- FIXED #4731: Use correct weights for edge-based graph duplicated via nodes.
- Profile:
- CHANGED: added Belarus speed limits
- CHANGED: set default urban speed in Ukraine to 50kmh
# 5.14.2
- Changes from 5.14.1:
- Bugfixes:
- FIXED #4727: Erroring when a old .core file is present.
- FIXED #4642: Update checks for EMPTY_NAMEID to check for empty name strings
- FIXED #4738: Fix potential segmentation fault
- Node.js Bindings:
- ADDED: Exposed new `max_radiuses_map_matching` option from `EngingConfig` options
- Tools:
- ADDED: New osrm-routed `max_radiuses_map_matching` command line flag to optionally set a maximum radius for map matching
# 5.14.1
- Changes from 5.14.0
- Bugfixes:
- FIXED: don't use removed alternative candidates in `filterPackedPathsByCellSharing`
# 5.14.0
- Changes from 5.13
- API:
- ADDED: new RouteStep property `driving_side` that has either "left" or "right" for that step
- Misc:
- ADDED: Bundles a rough (please improve!) driving-side GeoJSON file for use with `osrm-extract --location-dependent-data data/driving_side.geojson`
- CHANGED: Conditional turn parsing is disabled by default now
- ADDED: Adds a tool to analyze turn instruction generation in a dataset. Useful for tracking turn-by-turn heuristic changes over time.
- CHANGED: Internal refactoring of guidance code as a first step towards a re-runnable guidance pipeline
- ADDED: Now publishing Node 8.x LTS binary modules
- Profile:
- CHANGED: Remove dependency on turn types and turn modifier in the process_turn function in the `car.lua` profile. Guidance instruction types are not used to influence turn penalty anymore so this will break backward compatibility between profile version 3 and 4.
- Guidance:
- ADDED: New internal flag on "segregated intersections" - in the future, will should allow collapsing of instructions across complex intersection geometry where humans only perceive a single maneuver
- CHANGED: Decrease roundabout turn radius threshold from 25m to 15m - adds some "exit the roundabout" instructions for moderately sized roundabouts that were being missed previously
- Docker:
- CHANGED: switch to alpine 3.6, and use a multistage build to reduce image size
- Build:
- FIX: use LUA_LIBRARY_DIRS to propertly detect Lua on all platforms
- Docs:
- FIX: clarify description of roundabout exit instructions
- Bugfixes:
- FIXED: Fix bug where merge instructions got the wrong direction modifier ([PR #4670](https://github.com/Project-OSRM/osrm-backend/pull/4670))
- FIXED: Properly use the `profile.properties.left_hand_driving` property, there was a typo that meant it had no effect
- FIXED: undefined behaviour when alternative candidate via node is same as source node ([#4691](https://github.com/Project-OSRM/osrm-backend/issues/4691))
- FIXED: ensure libosrm.pc is pushed to the correct location for pkgconfig to find it on all platforms
- FIXED: don't consider empty names + empty refs as a valid name for u-turns
# 5.13.0
- Changes from 5.12:
- Profile:
- Append cardinal directions from route relations to ref fields to improve instructions; off by default see `profile.cardinal_directions`
- Support of `distance` weight in foot and bicycle profiles
- Support of relations processing
- Added `way:get_location_tag(key)` method to get location-dependent tags https://github.com/Project-OSRM/osrm-backend/wiki/Using-location-dependent-data-in-profiles
- Added `forward_ref` and `backward_ref` support
- Left-side driving mode is specified by a local Boolean flag `is_left_hand_driving` in `ExtractionWay` and `ExtractionTurn`
- Support literal values for maxspeeds in NO, PL and ZA
- Infrastructure:
- Lua 5.1 support is removed due to lack of support in sol2 https://github.com/ThePhD/sol2/issues/302
- Fixed pkg-config version of OSRM
- Removed `.osrm.core` file since CoreCH is deprecated now.
- Tools:
- Because of boost/program_options#32 with boost 1.65+ we needed to change the behavior of the following flags to not accept `={true|false}` anymore:
- `--use-locations-cache=false` becomes `--disable-location-cache`
- `--parse-conditional-restrictions=true` becomes `--parse-conditional-restrictions`
- The deprecated options `--use-level-cache` and `--generate-edge-lookup`
- Bugfixes:
- Fixed #4348: Some cases of sliproads pre-processing were broken
- Fixed #4331: Correctly compute left/right modifiers of forks in case the fork is curved.
- Fixed #4472: Correctly count the number of lanes using the delimter in `turn:lanes` tag.
- Fixed #4214: Multiple runs of `osrm-partition` lead to crash.
- Fixed #4348: Fix assorted problems around slip roads.
- Fixed #4420: A bug that would result in unnecessary instructions, due to problems in suffix/prefix detection
- Algorithm
- Deprecate CoreCH functionality. Usage of CoreCH specific options will fall back to using CH with core_factor of 1.0
- MLD uses a unidirectional Dijkstra for 1-to-N and N-to-1 matrices which yields speedup.
# 5.12.0
- Changes from 5.11:
- Guidance
- now announcing turning onto oneways at the end of a road (e.g. onto dual carriageways)
- Adds new instruction types at the exit of roundabouts and rotaries `exit roundabout` and `exit rotary`.
- HTTP:
- New query parameter for route/table/match/trip plugings:
`exclude=` that can be used to exclude certain classes (e.g. exclude=motorway, exclude=toll).
This is configurable in the profile.
- NodeJS:
- New query option `exclude` for the route/table/match/trip plugins. (e.g. `exclude: ["motorway", "toll"]`)
- Profile:
- New property for profile table: `excludable` that can be used to configure which classes are excludable at query time.
- New optional property for profile table: `classes` that allows you to specify which classes you expect to be used.
We recommend this for better error messages around classes, otherwise the possible class names are infered automatically.
- Traffic:
- If traffic data files contain an empty 4th column, they will update edge durations but not modify the edge weight. This is useful for
updating ETAs returned, without changing route selection (for example, in a distance-based profile with traffic data loaded).
- Infrastructure:
- New file `.osrm.cell_metrics` created by `osrm-customize`.
- Debug tiles:
- Added new properties `type` and `modifier` to `turns` layer, useful for viewing guidance calculated turn types on the map
# 5.11.0
- Changes from 5.10:
- Features
- BREAKING: Added support for conditional via-way restrictions. This features changes the file format of osrm.restrictions and requires re-extraction
- Internals
- BREAKING: Traffic signals will no longer be represented as turns internally. This requires re-processing of data but enables via-way turn restrictions across highway=traffic_signals
- Additional checks for empty segments when loading traffic data files
- Tunes the constants for turns in sharp curves just a tiny bit to circumvent a mix-up in fork directions at a specific intersection (https://github.com/Project-OSRM/osrm-backend/issues/4331)
- Infrastructure
- Refactor datafacade to make implementing additional DataFacades simpler
- Bugfixes
- API docs are now buildable again
- Suppress unnecessary extra turn instruction when exiting a motorway via a motorway_link onto a primary road (https://github.com/Project-OSRM/osrm-backend/issues/4348 scenario 4)
- Suppress unnecessary extra turn instruction when taking a tertiary_link road from a teritary onto a residential road (https://github.com/Project-OSRM/osrm-backend/issues/4348 scenario 2)
- Various MSVC++ build environment fixes
- Avoid a bug that crashes GCC6
- Re-include .npmignore to slim down published modules
- Fix a pre-processing bug where incorrect directions could be issued when two turns would have similar instructions and we tried to give them distinct values (https://github.com/Project-OSRM/osrm-backend/pull/4375)
- The entry bearing for correct the cardinality of a direction value (https://github.com/Project-OSRM/osrm-backend/pull/4353
- Change timezones in West Africa to the WAT zone so they're recognized on the Windows platform
# 5.10.0
- Changes from 5.9:
- Profiles:
- New version 2 profile API which cleans up a number of things and makes it easier to for profiles to include each other. Profiles using the old version 0 and 1 APIs are still supported.
- New required `setup()` function that must return a configuration hash. Storing configuration in globals is deprecated.
- Passes the config hash returned in `setup()` as an argument to `process_node/way/segment/turn`.
- Properties are now set in `.properties` in the config hash returend by setup().
- initialize raster sources in `setup()` instead of in a separate callback.
- Renames the `sources` helper to `raster`.
- Renames `way_functions` to `process_way` (same for node, segment and turn).
- Removes `get_restrictions()`. Instead set `.restrictions` in the config hash in `setup()`.
- Removes `get_name_suffix_list()`. Instead set `.suffix_list` in the config hash in `setup()`.
- Renames `Handlers` to `WayHandlers`.
- Pass functions instead of strings to `WayHandlers.run()`, so it's possible to mix in your own functions.
- Reorders arguments to `WayHandlers` functions to match `process_way()`.
- Profiles must return a hash of profile functions. This makes it easier for profiles to include each other.
- Guidance: add support for throughabouts
- Bugfixes
- Properly save/retrieve datasource annotations for road segments ([#4346](https://github.com/Project-OSRM/osrm-backend/issues/4346)
- Fix conditional restriction grammer parsing so it works for single-day-of-week restrictions ([#4357](https://github.com/Project-OSRM/osrm-backend/pull/4357))
- Algorithm
- BREAKING: the file format requires re-processing due to the changes on via-ways
- Added support for via-way restrictions
# 5.9.2
- API:
- `annotations=durations,weights,speeds` values no longer include turn penalty values ([#4330](https://github.com/Project-OSRM/osrm-backend/issues/4330))
# 5.9.1
- Infrastructure
- STXXL is not required by default
# 5.9.0
- Changes from 5.8:
- Algorithm:
- Multi-Level Dijkstra:
- Plugins supported: `table`
- Adds alternative routes support (see [#4047](https://github.com/Project-OSRM/osrm-backend/pull/4047) and [3905](https://github.com/Project-OSRM/osrm-backend/issues/3905)): provides reasonably looking alternative routes (many, if possible) with reasonable query times.
- API:
- Exposes `alternatives=Number` parameter overload in addition to the boolean flag.
- Support for exits numbers and names. New member `exits` in `RouteStep`, based on `junction:ref` on ways
- `Intersection` now has new parameter `classes` that can be set in the profile on each way.
- Profiles:
- `result.exits` allows you to set a way's exit numbers and names, see [`junction:ref`](http://wiki.openstreetmap.org/wiki/Proposed_features/junction_details)
- `ExtractionWay` now as new property `forward_classes` and `backward_classes` that can set in the `way_function`.
The maximum number of classes is 8.
- We now respect the `construction` tag. If the `construction` tag value is not on our whitelist (`minor`, `widening`, `no`) we will exclude the road.
- Node.js Bindings:
- Exposes `alternatives=Number` parameter overload in addition to the boolean flag
- Expose `EngineConfig` options in the node bindings
- Tools:
- Exposes engine limit on number of alternatives to generate `--max-alternatives` in `osrm-routed` (3 by default)
- Infrastructure
- STXXL is not required to build OSRM and is an optional dependency for back-compatibility (ENABLE_STXXL=On)
- OpenMP is only required when the optional STXXL dependency is used
- Bug fixes:
- #4278: Remove superflous continious instruction on a motorway.
# 5.8.0
- Changes from 5.7
- API:
- polyline6 support in request string
- new parameter `approaches` for `route`, `table`, `trip` and `nearest` requests. This parameter keep waypoints on the curb side.
'approaches' accepts both 'curb' and 'unrestricted' values.
Note : the curb side depend on the `ProfileProperties::left_hand_driving`, it's a global property set once by the profile. If you are working with a planet dataset, the api will be wrong in some countries, and right in others.
- NodeJs Bindings
- new parameter `approaches` for `route`, `table`, `trip` and `nearest` requests.
- Tools
- `osrm-partition` now ensures it is called before `osrm-contract` and removes inconsitent .hsgr files automatically.
- Features
- Added conditional restriction support with `parse-conditional-restrictions=true|false` to osrm-extract. This option saves conditional turn restrictions to the .restrictions file for parsing by contract later. Added `parse-conditionals-from-now=utc time stamp` and `--time-zone-file=/path/to/file` to osrm-contract
- Command-line tools (osrm-extract, osrm-contract, osrm-routed, etc) now return error codes and legible error messages for common problem scenarios, rather than ugly C++ crashes
- Speed up pre-processing by only running the Lua `node_function` for nodes that have tags. Cuts OSM file parsing time in half.
- osrm-extract now performs generation of edge-expanded-edges using all available CPUs, which should make osrm-extract significantly faster on multi-CPU machines
- Files
- .osrm.nodes file was renamed to .nbg_nodes and .ebg_nodes was added
- Guidance
- #4075 Changed counting of exits on service roundabouts
- Debug Tiles
- added support for visualising turn penalties to the MLD plugin
- added support for showing the rate (reciprocal of weight) on each edge when used
- added support for turn weights in addition to turn durations in debug tiles
- Bugfixes
- Fixed a copy/paste issue assigning wrong directions in similar turns (left over right)
- #4074: fixed a bug that would announce entering highway ramps as u-turns
- #4122: osrm-routed/libosrm should throw exception when a dataset incompatible with the requested algorithm is loaded
- Avoid collapsing u-turns into combined turn instructions
# 5.7.1
- Bugfixes
- #4030 Roundabout edge-case crashes post-processing
# 5.7.0
- Changes from 5.6
- Algorithm:
- OSRM object has new option `algorithm` that allows the selection of a routing algorithm.
- New experimental algorithm: Multi-Level Dijkstra with new toolchain:
- Allows for fast metric updates in below a minute on continental sized networks (osrm-customize)
- Plugins supported: `match` and `route`
- Quickstart: `osrm-extract data.osm.pbf`, `osrm-partition data.osrm`, `osrm-customize data.osrm`, `osrm-routed --algorithm=MLD data.osrm`
- NodeJs Bindings
- Merged https://github.com/Project-OSRM/node-osrm into repository. Build via `cmake .. -DCMAKE_BUILD_TYPE=Release -DENABLE_NODE_BINDINGS=On -DENABLE_MASON=On`.
- `OSRM` object has new option `algorihtm="CH","CoreCH","MLD"`
- Internals
- Shared memory notification via conditional variables on Linux or semaphore queue on OS X and Windows with a limit of 128 OSRM Engine instances
- Files
- .osrm.datasource_index file was removed. Data is now part of .osrm.geometries.
- .osrm.edge_lookup was removed. The option `--generate-edge-lookup` does nothing now.
- `osrm-contract` does not depend on the `.osrm.fileIndex` file anymore
- `osrm-extract` creates new file `.osrm.cnbg` and `.cnbg_to_ebg`
- `osrm-partition` creates new file `.osrm.partition` and `.osrm.cells`
- `osrm-customize` creates new file `.osrm.mldgr`
- Profiles
- Added `force_split_edges` flag to global properties. True value guarantees that segment_function will be called for all segments, but also could double memory consumption
- Map Matching:
- new option `gaps=split|ignore` to enable/disbale track splitting
- new option `tidy=true|false` to simplify traces automatically
# 5.6.3
- Changes from 5.6.0
- Bugfixes
- #3790 Fix incorrect speed values in tile plugin
# 5.6.2
- Changes from 5.6.0
- Bugfixes
- Fix incorrect forward datasources getter in facade
# 5.6.1
- Changes from 5.6.0
- Bugfixes
- Fix #3754 add restricted penalty on NoTurn turns
# 5.6.0
- Changes from 5.5
- Bugfixes
- Fix #3475 removed an invalid `exit` field from the `arrive` maneuver
- Fix #3515 adjusted number of `nodes` in `annotation`
- Fix #3605 Fixed a bug that could lead to turns at the end of the road to be suppressed
- Fix #2844 handle up to 16777215 code units in OSM names
- Infrastructure
- Support building rpm packages.
- Guidance
- No longer emitting turns on ferries, if a ferry should use multiple docking locations
- Profiles
- Removed the `./profile.lua -> ./profiles/car.lua` symlink. Use specific profiles from the `profiles` directory.
- `properties` object has a new `weight_name` field, default value is "duration"
- `properties` object has a new `weight_precision` field that specifies a decimal precision of edge weights, default value 1
- In `way_function` the filed `forward_rate` and `backward_rate` of `ExtractionWay` can now be set.
They have the same interpretation for the way weight as `forward_speed` and `backward_speed` for the edge duration.
The unit of rate is meters per weight unit, so higher values will be prefered during routing.
- `turn_function` now does not return an integer but takes in a `ExtractionTurn` object and can modify the `weight` and `duration` fields
- `segment_function` now takes in a `ExtractionSegment` object and can modify `weight` and `duration` fields
- `properties.uturn_penalty` is deprecated. Set it in the `turn_function`. The turn type is exposed as `ExtractionTurn::direction_modifier`.
- `properties.traffic_light_penalty` is deprecated. Traffic light penalties now need to be set over in the turn function.
Each turn with a traffic light is marked with `ExtractionTurn::has_traffic_light = true`.
- Renamed the helper file `profiles/lib/directional.lua` to `profiles/lib/tags.lua` since it now provides more general tags parsing utility functions.
- The car and foot profiles now depend on the helper file `profiles/lib/handlers.lua`.
- Infrastructure
- Disabled link-time optimized (LTO) builds by default. Enable by passing `-DENABLE_LTO=ON` to `cmake` if you need the performance and know what you are doing.
- Datafile versioning is now based on OSRM semver values, rather than source code checksums.
Datafiles are compatible between patch levels, but incompatible between minor version or higher bumps.
- libOSRM now creates an own watcher thread then used in shared memory mode to listen for data updates
- Tools:
- Added osrm-extract-conditionals tool for checking conditional values in OSM data
- Trip Plugin
- Added a new feature that finds the optimal route given a list of waypoints, a source and a destination. This does not return a roundtrip and instead returns a one way optimal route from the fixed source to the destination points.
# 5.5.1
- Changes from 5.5.0
- API:
- Adds `generate_hints=true` (`true` by default) which lets user disable `Hint` generating in the response. Use if you don't need `Hint`s!
- Bugfixes
- Fix #3418 and ensure we only return bearings in the range 0-359 in API responses
- Fixed a bug that could lead to emitting false instructions for staying on a roundabout
# 5.5.0
- Changes from 5.4.0
- API:
- `osrm-datastore` now accepts the parameter `--max-wait` that specifies how long it waits before aquiring a shared memory lock by force
- Shared memory now allows for multiple clients (multiple instances of libosrm on the same segment)
- Polyline geometries can now be requested with precision 5 as well as with precision 6
- Profiles
- the car profile has been refactored into smaller functions
- get_value_by_key() is now guaranteed never to return empty strings, nil is returned instead.
- debug.lua was added to make it easier to test/develop profile code.
- `car.lua` now depends on lib/set.lua and lib/sequence.lua
- `restrictions` is now used for namespaced restrictions and restriction exceptions (e.g. `restriction:motorcar=` as well as `except=motorcar`)
- replaced lhs/rhs profiles by using test defined profiles
- Handle `oneway=alternating` (routed over with penalty) separately from `oneway=reversible` (not routed over due to time dependence)
- Handle `destination:forward`, `destination:backward`, `destination:ref:forward`, `destination:ref:backward` tags
- Properly handle destinations on `oneway=-1` roads
- Guidance
- Notifications are now exposed more prominently, announcing turns onto a ferry/pushing your bike more prominently
- Improved turn angle calculation, detecting offsets due to lanes / minor variations due to inaccuracies
- Corrected the bearings returned for intermediate steps - requires reprocessing
- Improved turn locations for collapsed turns
- Sliproad classification refinements: the situations we detect as Sliproads now resemble more closely the reality
- Trip Plugin
- changed internal behaviour to prefer the smallest lexicographic result over the largest one
- Bugfixes
- fixed a bug where polyline decoding on a defective polyline could end up in out-of-bound access on a vector
- fixed compile errors in tile unit-test framework
- fixed a bug that could result in inconsistent behaviour when collapsing instructions
- fixed a bug that could result in crashes when leaving a ferry directly onto a motorway ramp
- fixed a bug in the tile plugin that resulted in discovering invalid edges for connections
- improved error messages when missing files during traffic updates (#3114)
- For single coordinate geometries the GeoJSON `Point` encoding was broken. We now always emit `LineString`s even in the one-coordinate-case (backwards compatible) (#3425)
- Debug Tiles
- Added support for turn penalties
- Internals
- Internal/Shared memory datafacades now share common memory layout and data loading code
- File reading now has much better error handling
- Misc
- Progress indicators now print newlines when stdout is not a TTY
- Prettier API documentation now generated via `npm run build-api-docs` output `build/docs`
# 5.4.3
- Changes from 5.4.2
- Bugfixes
- #3254 Fixed a bug that could end up hiding roundabout instructions
- #3260 fixed a bug that provided the wrong location in the arrival instruction
# 5.4.2
- Changes from 5.4.1
- Bugfixes
- #3032 Fixed a bug that could result in emitting `invalid` as an instruction type on sliproads with mode changes
- #3085 Fixed an outdated assertion that could throw without a cause for concern
- #3179 Fixed a bug that could trigger an assertion in TurnInstruciton generation
# 5.4.1
- Changes from 5.4.0
- Bugfixes
- #3016: Fixes shared memory updates while queries are running
# 5.4.0
- Changes from 5.3.0
- Profiles
- includes library guidance.lua that offers preliminary configuration on guidance.
- added left_hand_driving flag in global profile properties
- modified turn penalty function for car profile - better fit to real data
- return `ref` and `name` as separate fields. Do no use ref or destination as fallback for name value
- the default profile for car now ignores HOV only roads
- Guidance
- Handle Access tags for lanes, only considering valid lanes in lane-guidance (think car | car | bike | car)
- Improved the detection of non-noticeable name-changes
- Summaries have been improved to consider references as well
- API:
- `annotations=true` now returns the data source id for each segment as `datasources`
- Reduced semantic of merge to refer only to merges from a lane onto a motorway-like road
- new `ref` field in the `RouteStep` object. It contains the reference code or name of a way. Previously merged into the `name` property like `name (ref)` and are now separate fields.
- Bugfixes
- Fixed an issue that would result in segfaults for viaroutes with an invalid intermediate segment when u-turns were allowed at the via-location
- Invalid only_* restrictions could result in loss of connectivity. As a fallback, we assume all turns allowed when the restriction is not valid
- Fixed a bug that could result in an infinite loop when finding information about an upcoming intersection
- Fixed a bug that led to not discovering if a road simply looses a considered prefix
- BREAKING: Fixed a bug that could crash postprocessing of instructions on invalid roundabout taggings. This change requires reprocessing datasets with osrm-extract and osrm-contract
- Fixed an issue that could emit `invalid` as instruction when ending on a sliproad after a traffic-light
- Fixed an issue that would detect turning circles as sliproads
- Fixed a bug where post-processing instructions (e.g. left + left -> uturn) could result in false pronunciations
- Fixes a bug where a bearing range of zero would cause exhaustive graph traversals
- Fixes a bug where certain looped geometries could cause an infinite loop during extraction
- Fixed a bug where some roads could be falsly identified as sliproads
- Fixed a bug where roundabout intersections could result in breaking assertions when immediately exited
- Infrastructure:
- Adds a feature to limit results in nearest service with a default of 100 in `osrm-routed`
# 5.3.0
- Changes from 5.3.0-rc.3
- Guidance
- Only announce `use lane` on required turns (not using all lanes to go straight)
- Moved `lanes` to the intersection objects. This is BREAKING in relation to other Release Candidates but not with respect to other releases.
- Bugfixes
- Fix BREAKING: bug that could result in failure to load 'osrm.icd' files. This breaks the dataformat
- Fix: bug that results in segfaults when `use lane` instructions are suppressed
- Changes form 5.2.7
- API
- Introduces new `TurnType` in the form of `use lane`. The type indicates that you have to stick to a lane without turning
- Introduces `lanes` to the `Intersection` object. The lane data contains both the markings at the intersection and a flag indicating if they can be chosen for the next turn
- Removed unused `-s` from `osrm-datastore`
- Guidance
- Only announce `use lane` on required turns (not using all lanes to go straight)
- Improved detection of obvious turns
- Improved turn lane detection
- Reduce the number of end-of-road instructions in obvious cases
- Profile:
- bicycle.lua: Surface speeds never increase the actual speed
- Infrastructure
- Add 32bit support
- Add ARM NEON/VFP support
- Fix Windows builds
- Optimize speed file updates using mmap
- Add option to disable LTO for older compilers
- BREAKING: The new turn type changes the turn-type order. This breaks the **data format**.
- BREAKING: Turn lane data introduces two new files (osrm.tld,osrm.tls). This breaks the fileformat for older versions.
- Bugfixes:
- Fix devide by zero on updating speed data using osrm-contract
# 5.3.0 RC3
- Changes from 5.3.0-rc.2
- Guidance
- Improved detection of obvious turns
- Improved turn lane detection
- Bugfixes
- Fix bug that didn't chose minimal weights on overlapping edges
# 5.3.0 RC2
- Changes from 5.3.0-rc.1
- Bugfixes
- Fixes invalid checks in the lane-extraction part of the car profile
# 5.3.0 RC1
- API
- Introduces new `TurnType` in the form of `use lane`. The type indicates that you have to stick to a lane without turning
- Introduces lanes to the route response. The lane data contains both the markings at the intersection and a flag indicating their involvement in the turn
- Infrastructure
- BREAKING: The new turn type changes the turn-type order. This breaks the **data format**.
- BREAKING: Turn lane data introduces two new files (osrm.tld,osrm.tls). This breaks the fileformat for older versions.
# 5.2.5
- Bugfixes
- Fixes a segfault caused by incorrect trimming logic for very short steps.
# 5.2.4
- Bugfixes:
- Fixed in issue that arised on roundabouts in combination with intermediate intersections and sliproads
# 5.2.3
- Bugfixes:
- Fixed an issue with name changes in roundabouts that could result in crashes
# 5.2.2
Changes from 5.2.1
- Bugfixes:
- Buffer overrun in tile plugin response handling
# 5.2.1
Changes from 5.2.0
- Bugfixes:
- Removed debug statement that was spamming the console
# 5.2.0
Changes from 5.2.0 RC2
- Bugfixes:
- Fixed crash when loading shared memory caused by invalid OSM IDs segment size.
- Various small instructions handling fixes
Changes from 5.1.0
- API:
- new parameter `annotations` for `route`, `trip` and `match` requests. Returns additional data about each
coordinate along the selected/matched route line per `RouteLeg`:
- duration of each segment
- distance of each segment
- OSM node ids of all segment endpoints
- Introducing Intersections for Route Steps. This changes the API format in multiple ways.
- `bearing_before`/`bearing_after` of `StepManeuver` are now deprecated and will be removed in the next major release
- `location` of `StepManeuvers` is now deprecated and will be removed in the next major release
- every `RouteStep` now has property `intersections` containing a list of `Intersection` objects.
- Support for destination signs. New member `destinations` in `RouteStep`, based on `destination` and `destination:ref`
- Support for name pronunciations. New member `pronunciation` in `RouteStep`, based on `name:pronunciation`
- Profile changes:
- duration parser now accepts P[n]DT[n]H[n]M[n]S, P[n]W, PTHHMMSS and PTHH:MM:SS ISO8601 formats.
- `result.destinations` allows you to set a way's destinations
- `result.pronunciation` allows you to set way name pronunciations
- `highway=motorway_link` no longer implies `oneway` as per the OSM Wiki
- Infrastructure:
- BREAKING: Changed the on-disk encoding of the StaticRTree to reduce ramIndex file size. This breaks the **data format**
- BREAKING: Intersection Classification adds a new file to the mix (osrm.icd). This breaks the fileformat for older versions.
- Better support for osrm-routed binary upgrade on the fly [UNIX specific]:
- Open sockets with SO_REUSEPORT to allow multiple osrm-routed processes serving requests from the same port.
- Add SIGNAL_PARENT_WHEN_READY environment variable to enable osrm-routed signal its parent with USR1 when it's running and waiting for requests.
- Disable http access logging via DISABLE_ACCESS_LOGGING environment variable.
- Guidance:
- BREAKING: modifies the file format with new internal identifiers
- improved detection of turning streets, not reporting new-name in wrong situations
- improved handling of sliproads (emit turns instead of 'take the ramp')
- improved collapsing of instructions. Some 'new name' instructions will be suppressed if they are without alternative and the segment is short
- Bugfixes
- fixed broken summaries for very short routes
# 5.2.0 RC2
Changes from 5.2.0 RC1
- Guidance:
- improved handling of sliproads (emit turns instead of 'take the ramp')
- improved collapsing of instructions. Some 'new name' instructions will be suppressed if they are without alternative and the segment is short
- BREAKING: modifies the file format with new internal identifiers
- API:
- paramater `annotate` was renamed to `annotations`.
- `annotation` as accidentally placed in `Route` instead of `RouteLeg`
- Support for destination signs. New member `destinations` in `RouteStep`, based on `destination` and `destination:ref`
- Support for name pronunciations. New member `pronunciation` in `RouteStep`, based on `name:pronunciation`
- Add `nodes` property to `annotation` in `RouteLeg` containing the ids of nodes covered by the route
- Profile changes:
- `result.destinations` allows you to set a way's destinations
- `result.pronunciation` allows you to set way name pronunciations
- `highway=motorway_link` no longer implies `oneway` as per the OSM Wiki
- Infrastructure
- BREAKING: Changed the on-disk encoding of the StaticRTree to reduce ramIndex file size. This breaks the **data format**
- Bugfixes
- fixed broken summaries for very short routes
# 5.2.0 RC1
Changes from 5.1.0
- API:
- new parameter `annotate` for `route` and `match` requests. Returns additional data about each
coordinate along the selected/matched route line.
- Introducing Intersections for Route Steps. This changes the API format in multiple ways.
- `bearing_before`/`bearing_after` of `StepManeuver` are now deprecated and will be removed in the next major release
- `location` of `StepManeuvers` is now deprecated and will be removed in the next major release
- every `RouteStep` now has property `intersections` containing a list of `Intersection` objects.
- Profile changes:
- duration parser now accepts P[n]DT[n]H[n]M[n]S, P[n]W, PTHHMMSS and PTHH:MM:SS ISO8601 formats.
- Infrastructure:
- Better support for osrm-routed binary upgrade on the fly [UNIX specific]:
- Open sockets with SO_REUSEPORT to allow multiple osrm-routed processes serving requests from the same port.
- Add SIGNAL_PARENT_WHEN_READY environment variable to enable osrm-routed signal its parent with USR1 when it's running and waiting for requests.
- BREAKING: Intersection Classification adds a new file to the mix (osrm.icd). This breaks the fileformat for older versions.
- Disable http access logging via DISABLE_ACCESS_LOGGING environment
variable.
- Guidance:
- improved detection of turning streets, not reporting new-name in wrong situations
# 5.1.0
Changes with regard to 5.0.0
- API:
- added StepManeuver type `roundabout turn`. The type indicates a small roundabout that is treated as an intersection
(turn right at the roundabout for first exit, go straight at the roundabout...)
- added StepManeuver type `on ramp` and `off ramp` to distinguish between ramps that enter and exit a highway.
- reduced new name instructions for trivial changes
- combined multiple turns into a single instruction at segregated roads`
- Profile Changes:
- introduced a suffix_list / get_name_suffix_list to specify name suffices to be suppressed in name change announcements
- street names are now consistently assembled for the car, bike and walk profile as: "Name (Ref)" as in "Berlin (A5)"
- new `car.lua` dependency `lib/destination.lua`
- register a way's .nodes() function for use in the profile's way_function.
- Infrastructure
- BREAKING: reordered internal instruction types. This breaks the **data format**
- BREAKING: Changed the on-disk encoding of the StaticRTree for better performance. This breaks the **data format**
- Fixes:
- Issue #2310: post-processing for local paths, fixes #2310
- Issue #2309: local path looping, fixes #2309
- Issue #2356: Make hint values optional
- Issue #2349: Segmentation fault in some requests
- Issue #2335: map matching was using shortest path with uturns disabled
- Issue #2193: Fix syntax error position indicators in parameters queries
- Fix search with u-turn
- PhantomNode packing in MSVC now the same on other platforms
- Summary is now not malformed when including unnamed roads
- Emit new-name on when changing fron unanmed road to named road
# 5.0.0
Changes with regard 5.0.0 RC2:
- API:
- if `geometry=geojson` is passed the resulting geometry can be a LineString or Point
depending on how many coordinates are present.
- the removal of the summary field was revered. for `steps=flase` the field will always be an empty string.
Changes with regard to 4.9.1:
- API:
- BREAKING: Complete rewrite of the HTTP and library API. See detailed documentation in the wiki.
- BREAKING: The default coordinate order is now `longitude, latidue`. Exception: Polyline geometry
which follow the original Google specification of `latitdue, longitude`.
- BREAKING: Polyline geometries now use precision 5, instead of previously 6
- BREAKING: Removed GPX support
- New service `tile` which serves debug vector tiles of the road network
- Completely new engine for guidance generation:
- Support for highway ramps
- Support for different intersection types (end of street, forks, merges)
- Instruction post-processing to merge unimportant instructions
- Improved handling of roundabouts
- Tools:
- BREAKING: Renamed osrm-prepare to osrm-contract
- BREAKING: Removes profiles from osrm-contract, only needed in osrm-extract.
- Abort processing in osrm-extract if there are no snappable edges remaining.
- Added .properties file to osrm-extract ouput.
- Enables the use of multiple segment-speed-files on the osrm-contract command line
- Profile changes:
- Remove movable bridge mode
- Add `maxspeed=none` tag to car profile.
- A `side_road` tag support for the OSRM car profile.
- Fixes:
- Issue #2150: Prevents routing over delivery ways and nodes
- Issue #1972: Provide uninstall target
- Issue #2072: Disable alternatives by default and if core factor < 1.0
- Issue #1999: Fix unpacking for self-loop nodes not in core.
- Infrastructure:
- Cucumber test suit is now based on cucumber-js, removes Ruby as dependency
- Updated to mapbox/variant v1.1
- Updated to libosmium v2.6.1
- Remove GeoJSON based debugging output, replaced by debug tiles
# 5.0.0 RC2
- Profiles:
- `properties.allow_uturns_at_via` -> `properties.continue_straight_at_waypoint` (value is inverted!)
- API:
- Removed summary from legs property
- Disable steps and alternatives by default
- Fix `code` field: 'ok' -> 'Ok'
- Allow 4.json and 4.3.json format
- Conform to v5 spec and support "unlimited" as radiuses value.
- `uturns` parameter was replaced by `continue_straight` (value is inverted!)
- Features:
- Report progress for gennerating edge expanded edges in the edge based graph factory
- Add maxspeed=none tag to car profile.
- Optimize StaticRTree code: speedup 2x (to RC1)
- Optimize DouglasPeucker code: speedup 10x (to RC1)
- Optimize WebMercator projection: speedup 2x (to RC1)
- Bugs:
- #2195: Resolves issues with multiple includedirs in pkg-config file
- #2219: Internal server error when using the match plugin
- #2027: basename -> filename
- #2168: Report correct position where parsing failed
- #2036: Add license to storage and storage config exposed in public API
- Fix uturn detection in match plugin
- Add missing -lz to fix linking of server-tests
# 5.0.0 RC1
- Renamed osrm-prepare into osrm-contract
- osrm-contract does not need a profile parameter anymore
- New public HTTP API, find documentation [here](https://github.com/Project-OSRM/osrm-backend/wiki/New-Server-api)
- POST support is discontinued, please use library bindings for more complex requests
- Removed timestamp plugin
- Coordinate order is now Longitude,Latitude
- Cucumber tests now based on Javascript (run with `npm test`)
- Profile API changed:
- `forward_mode` and `backward_mode` now need to be selected from a pre-defined list
- Global profile properties are now stored in a global `properties` element. This includes:
- `properties.traffic_signal_penalty`
- `properties.use_turn_restrictions`
- `properties.u_turn_penalty`
- `properties.allow_u_turn_at_via`
-851
View File
@@ -1,851 +0,0 @@
cmake_minimum_required(VERSION 2.8.11)
# we depend on 2.8.11 introducing target_include_directories
if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR AND NOT MSVC_IDE)
message(FATAL_ERROR "In-source builds are not allowed.
Please create a directory and run cmake from there, passing the path to this source directory as the last argument.
This process created the file `CMakeCache.txt' and the directory `CMakeFiles'. Please delete them.")
endif()
# detect if this is included as subproject and if so expose
# some variables to its parent scope
get_directory_property(BUILD_AS_SUBPROJECT PARENT_DIRECTORY)
if(BUILD_AS_SUBPROJECT)
message(STATUS "Building libosrm as subproject.")
endif()
# set OSRM_BUILD_DIR location (might be used in various scripts)
if (NOT WIN32 AND NOT DEFINED ENV{OSRM_BUILD_DIR})
set(ENV{OSRM_BUILD_DIR} ${CMAKE_CURRENT_BINARY_DIR})
endif()
option(ENABLE_MASON "Use mason for dependencies" OFF)
option(ENABLE_CCACHE "Speed up incremental rebuilds via ccache" ON)
option(BUILD_TOOLS "Build OSRM tools" OFF)
option(BUILD_PACKAGE "Build OSRM package" OFF)
option(ENABLE_ASSERTIONS "Use assertions in release mode" OFF)
option(ENABLE_COVERAGE "Build with coverage instrumentalisation" OFF)
option(ENABLE_SANITIZER "Use memory sanitizer for Debug build" OFF)
option(ENABLE_STXXL "Use STXXL library" OFF)
option(ENABLE_LTO "Use LTO if available" OFF)
option(ENABLE_FUZZING "Fuzz testing using LLVM's libFuzzer" OFF)
option(ENABLE_GOLD_LINKER "Use GNU gold linker if available" ON)
option(ENABLE_NODE_BINDINGS "Build NodeJs bindings" OFF)
option(ENABLE_GLIBC_WORKAROUND "Workaround GLIBC symbol exports" OFF)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
if(ENABLE_MASON)
# versions in use
set(MASON_BOOST_VERSION "1.65.1")
set(MASON_STXXL_VERSION "1.4.1-1")
set(MASON_EXPAT_VERSION "2.2.0")
set(MASON_LUA_VERSION "5.2.4")
set(MASON_BZIP2_VERSION "1.0.6")
set(MASON_TBB_VERSION "2017_U7")
message(STATUS "Enabling mason")
find_program(CURL_FOUND curl)
if(NOT CURL_FOUND)
message(FATAL_ERROR "curl command required with -DENABLE_MASON")
endif()
include(mason)
endif()
# be compatible with version handling before cmake 3.x
if (POLICY CMP0048)
cmake_policy(SET CMP0048 OLD)
endif()
project(OSRM C CXX)
set(OSRM_VERSION_MAJOR 5)
set(OSRM_VERSION_MINOR 16)
set(OSRM_VERSION_PATCH 0)
set(OSRM_VERSION "${OSRM_VERSION_MAJOR}.${OSRM_VERSION_MINOR}.${OSRM_VERSION_PATCH}")
add_definitions(-DOSRM_PROJECT_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
# these two functions build up custom variables:
# DEPENDENCIES_INCLUDE_DIRS and OSRM_DEFINES
# These variables we want to pass to
# include_directories and add_definitions for both
# this build and for sharing externally via pkg-config
function(add_dependency_includes)
if(${ARGC} GREATER 0)
list(APPEND DEPENDENCIES_INCLUDE_DIRS "${ARGV}")
set(DEPENDENCIES_INCLUDE_DIRS "${DEPENDENCIES_INCLUDE_DIRS}" PARENT_SCOPE)
endif()
endfunction(add_dependency_includes)
function(add_dependency_defines defines)
list(APPEND OSRM_DEFINES "${defines}")
set(OSRM_DEFINES "${OSRM_DEFINES}" PARENT_SCOPE)
endfunction(add_dependency_defines)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
include(CheckCXXCompilerFlag)
include(FindPackageHandleStandardArgs)
include(GNUInstallDirs)
set(bitness 32)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(bitness 64)
message(STATUS "Building on a 64 bit system")
else()
message(STATUS "Building on a 32 bit system")
endif()
if(WIN32 AND MSVC_VERSION LESS 1900)
message(FATAL_ERROR "Building with Microsoft compiler needs Latest Visual Studio 2015 (Community or better)")
endif()
# Strictly require GCC>=5.0 and Clang>=3.4 - GCC 4.8 is already too old for C++14.
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
message(FATAL_ERROR "GCC>=5.0 required. In case you are on Ubuntu upgrade via ppa:ubuntu-toolchain-r/test")
endif()
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4)
message(FATAL_ERROR "Clang>=3.4 required. In case you are on Ubuntu upgrade via http://apt.llvm.org")
endif()
endif()
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}/include/)
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/third_party/sol2/)
include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/third_party/variant/include)
set(BOOST_COMPONENTS date_time chrono filesystem iostreams program_options regex system thread unit_test_framework)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/include/util/version.hpp.in
${CMAKE_CURRENT_BINARY_DIR}/include/util/version.hpp
)
file(GLOB UtilGlob src/util/*.cpp src/util/*/*.cpp)
file(GLOB ExtractorGlob src/extractor/*.cpp src/extractor/*/*.cpp)
file(GLOB GuidanceGlob src/guidance/*.cpp src/extractor/intersection/*.cpp)
file(GLOB PartitionerGlob src/partitioner/*.cpp)
file(GLOB CustomizerGlob src/customize/*.cpp)
file(GLOB ContractorGlob src/contractor/*.cpp)
file(GLOB UpdaterGlob src/updater/*.cpp)
file(GLOB StorageGlob src/storage/*.cpp)
file(GLOB ServerGlob src/server/*.cpp src/server/**/*.cpp)
file(GLOB EngineGlob src/engine/*.cpp src/engine/**/*.cpp)
file(GLOB ErrorcodesGlob src/osrm/errorcodes.cpp)
add_library(UTIL OBJECT ${UtilGlob})
add_library(EXTRACTOR OBJECT ${ExtractorGlob})
add_library(GUIDANCE OBJECT ${GuidanceGlob})
add_library(PARTITIONER OBJECT ${PartitionerGlob})
add_library(CUSTOMIZER OBJECT ${CustomizerGlob})
add_library(CONTRACTOR OBJECT ${ContractorGlob})
add_library(UPDATER OBJECT ${UpdaterGlob})
add_library(STORAGE OBJECT ${StorageGlob})
add_library(ENGINE OBJECT ${EngineGlob})
add_library(SERVER OBJECT ${ServerGlob})
set_target_properties(UTIL PROPERTIES LINKER_LANGUAGE CXX)
add_executable(osrm-extract src/tools/extract.cpp)
add_executable(osrm-partition src/tools/partition.cpp)
add_executable(osrm-customize src/tools/customize.cpp)
add_executable(osrm-contract src/tools/contract.cpp)
add_executable(osrm-routed src/tools/routed.cpp $<TARGET_OBJECTS:SERVER> $<TARGET_OBJECTS:UTIL>)
add_executable(osrm-datastore src/tools/store.cpp $<TARGET_OBJECTS:UTIL>)
add_library(osrm src/osrm/osrm.cpp $<TARGET_OBJECTS:ENGINE> $<TARGET_OBJECTS:UTIL> $<TARGET_OBJECTS:STORAGE>)
add_library(osrm_contract src/osrm/contractor.cpp $<TARGET_OBJECTS:CONTRACTOR> $<TARGET_OBJECTS:UTIL>)
add_library(osrm_extract src/osrm/extractor.cpp $<TARGET_OBJECTS:EXTRACTOR> $<TARGET_OBJECTS:UTIL>)
add_library(osrm_guidance $<TARGET_OBJECTS:GUIDANCE> $<TARGET_OBJECTS:UTIL>)
add_library(osrm_partition src/osrm/partitioner.cpp $<TARGET_OBJECTS:PARTITIONER> $<TARGET_OBJECTS:UTIL>)
add_library(osrm_customize src/osrm/customizer.cpp $<TARGET_OBJECTS:CUSTOMIZER> $<TARGET_OBJECTS:UTIL>)
add_library(osrm_update $<TARGET_OBJECTS:UPDATER> $<TARGET_OBJECTS:UTIL>)
add_library(osrm_store $<TARGET_OBJECTS:STORAGE> $<TARGET_OBJECTS:UTIL>)
if(ENABLE_GOLD_LINKER)
execute_process(COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version ERROR_QUIET OUTPUT_VARIABLE LD_VERSION)
if("${LD_VERSION}" MATCHES "GNU gold")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold -Wl,--disable-new-dtags")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold -Wl,--disable-new-dtags")
set(OSRM_LDFLAGS "${OSRM_LDFLAGS} -fuse-ld=gold -Wl,--disable-new-dtags")
message(STATUS "Using GNU gold as linker.")
# Issue 2785: check gold binutils version and don't use gc-sections for versions prior 2.25
string(REGEX REPLACE ".*\\(GNU Binutils[^\\)0-9]+([0-9]+\\.[0-9]+)[^\\)]*\\).*" "\\1" GOLD_BINUTILS_VERSION "${LD_VERSION}")
if ("${GOLD_BINUTILS_VERSION}" VERSION_LESS "2.26")
message(STATUS "Disabling gc-sections on gold binutils < 2.26, see: https://sourceware.org/bugzilla/show_bug.cgi?id=17639")
set(LD_AVOID_GC_SECTIONS TRUE)
endif()
else()
message(WARNING "GNU gold linker isn't available.")
set(ENABLE_GOLD_LINKER OFF)
endif()
endif()
# Disable LTO when mason+gcc is detected before testing for / setting any flags.
# Mason builds libraries with Clang, mixing does not work in the context of lto.
if(ENABLE_MASON AND CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND ENABLE_LTO)
set(ENABLE_LTO OFF)
message(WARNING "Mason and GCC's LTO not work together. Disabling LTO.")
endif()
# Explicitly set the build type to Release if no other type is specified
# on the command line. Without this, cmake defaults to an unoptimized,
# non-debug build, which almost nobody wants.
if(NOT CMAKE_BUILD_TYPE)
message(STATUS "No build type specified, defaulting to Release")
set(CMAKE_BUILD_TYPE Release)
endif()
if(CMAKE_BUILD_TYPE MATCHES Debug)
message(STATUS "Configuring OSRM in debug mode")
elseif(CMAKE_BUILD_TYPE MATCHES Release)
message(STATUS "Configuring OSRM in release mode")
elseif(CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)
message(STATUS "Configuring OSRM in release mode with debug flags")
elseif(CMAKE_BUILD_TYPE MATCHES MinRelSize)
message(STATUS "Configuring OSRM in release mode with minimized size")
else()
message(STATUS "Unrecognized build type - will use cmake defaults")
endif()
# Additional logic for the different build types
if(CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)
message(STATUS "Configuring debug mode flags")
set(ENABLE_ASSERTIONS ON)
endif()
if(NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -fno-inline -fno-omit-frame-pointer")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-inline -fno-omit-frame-pointer")
endif()
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -ggdb")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Og -ggdb")
endif()
if(CMAKE_BUILD_TYPE MATCHES Release OR CMAKE_BUILD_TYPE MATCHES MinRelSize OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)
message(STATUS "Configuring release mode optimizations")
# Check if LTO is available
check_cxx_compiler_flag("-Wl,-flto" LTO_AVAILABLE)
if(ENABLE_LTO AND LTO_AVAILABLE)
set(OLD_CXX_FLAGS ${CMAKE_CXX_FLAGS})
# GCC in addition allows parallelizing LTO
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
include(ProcessorCount)
ProcessorCount(NPROC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flto=${NPROC}")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flto")
endif()
set(CHECK_LTO_SRC "int main(){return 0;}")
check_cxx_source_compiles("${CHECK_LTO_SRC}" LTO_WORKS)
if(LTO_WORKS)
message(STATUS "LTO working")
set(OSRM_CXXFLAGS "${OSRM_CXXFLAGS} -flto")
set(OSRM_LDFLAGS "${OSRM_LDFLAGS} -flto")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -flto")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -flto")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -flto")
else()
message(STATUS "LTO broken")
set(CMAKE_CXX_FLAGS "${OLD_CXX_FLAGS}")
set(ENABLE_LTO Off)
endif()
# Since gcc 4.9 the LTO format is non-standart ('slim'), so we need to use the build-in tools
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND NOT MINGW)
find_program(GCC_AR gcc-ar)
find_program(GCC_RANLIB gcc-ranlib)
if ("${GCC_AR}" STREQUAL "GCC_AR-NOTFOUND" OR "${GCC_RANLIB}" STREQUAL "GCC_RANLIB-NOTFOUND")
message(WARNING "GCC specific binutils not found. In case of linker issues export env vars: AR=gcc-ar, NM=gcc-nm, RANLIB=gcc-ranlib")
else()
message(STATUS "Using GCC specific binutils for LTO:")
message(STATUS " ${GCC_AR}")
message(STATUS " ${GCC_RANLIB}")
set(CMAKE_AR ${GCC_AR})
set(CMAKE_RANLIB ${GCC_RANLIB})
endif()
endif()
# Same for clang LTO requires their own toolchain
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
find_program(LLVM_AR llvm-ar)
find_program(LLVM_RANLIB llvm-ranlib)
if ("${LLVM_AR}" STREQUAL "LLVM_AR-NOTFOUND" OR "${LLVM_RANLIB}" STREQUAL "LLVM_RANLIB-NOTFOUND")
message(WARNING "LLVM specific binutils not found.")
else()
message(STATUS "Using LLVM specific binutils for LTO:")
message(STATUS " ${LLVM_AR}")
message(STATUS " ${LLVM_RANLIB}")
set(CMAKE_AR ${LLVM_AR})
set(CMAKE_RANLIB ${LLVM_RANLIB})
endif()
endif()
endif()
endif()
if(UNIX AND NOT APPLE AND ENABLE_MASON AND (LTO_WORKS OR ENABLE_GOLD_LINKER))
message(WARNING "ENABLE_MASON and ENABLE_LTO/ENABLE_GOLD_LINKER may not work on all linux systems currently")
message(WARNING "For more details see: https://github.com/Project-OSRM/osrm-backend/issues/3202")
endif()
set(MAYBE_COVERAGE_LIBRARIES "")
if (ENABLE_COVERAGE)
if (NOT CMAKE_BUILD_TYPE MATCHES "Debug")
message(ERROR "ENABLE_COVERAGE=ON only make sense with a Debug build")
endif()
message(STATUS "Enabling coverage")
set(MAYBE_COVERAGE_LIBRARIES "-lgcov")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -ftest-coverage -fprofile-arcs")
endif()
if (ENABLE_SANITIZER)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
set(OSRM_CXXFLAGS "${OSRM_CXXFLAGS} -fsanitize=address")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fsanitize=address")
endif()
# Configuring compilers
set(OSRM_WARNING_FLAGS "-Werror=all -Werror=extra -Werror=uninitialized -Werror=unreachable-code -Werror=unused-variable -Werror=unreachable-code -Wno-error=cpp -Wpedantic")
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OSRM_WARNING_FLAGS} -Werror=strict-overflow=2 -Wno-error=unused-local-typedef -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fPIC -fcolor-diagnostics -ftemplate-depth=1024 -Wno-unused-command-line-argument")
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
set(COLOR_FLAG "-fdiagnostics-color=auto")
check_cxx_compiler_flag("-fdiagnostics-color=auto" HAS_COLOR_FLAG)
if(NOT HAS_COLOR_FLAG)
set(COLOR_FLAG "")
endif()
# using GCC
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OSRM_WARNING_FLAGS} -Werror=strict-overflow=1 -Wno-error=maybe-uninitialized -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 ${COLOR_FLAG} -fPIC -ftemplate-depth=1024")
if(WIN32) # using mingw
add_dependency_defines(-DWIN32)
set(OPTIONAL_SOCKET_LIBS ws2_32 wsock32)
endif()
# -fpermissive is required for parallel_do Intel TBB internal issue with GCC < 5
# https://github.com/Project-OSRM/osrm-backend/pull/3603#issuecomment-277688589
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
message(STATUS "Adding -fpermissive for GCC version < 5 bug (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51048). See #3603.")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive")
endif()
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
# using Intel C++
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-intel -wd10237 -Wall -ipo -fPIC")
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
# using Visual Studio C++
set(BOOST_COMPONENTS ${BOOST_COMPONENTS} zlib)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj") # avoid compiler error C1128 from scripting_environment_lua.cpp
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /DWIN32_LEAN_AND_MEAN") # avoid compiler error C2011 from dual #include of winsock.h and winsock2.h
add_dependency_defines(-DBOOST_LIB_DIAGNOSTIC)
add_dependency_defines(-D_CRT_SECURE_NO_WARNINGS)
add_dependency_defines(-DNOMINMAX) # avoid min and max macros that can break compilation
add_dependency_defines(-D_USE_MATH_DEFINES) #needed for M_PI with cmath.h
add_dependency_defines(-D_WIN32_WINNT=0x0501)
add_dependency_defines(-DXML_STATIC)
find_library(ws2_32_LIBRARY_PATH ws2_32)
target_link_libraries(osrm-extract wsock32 ws2_32)
endif()
# Configuring linker
execute_process(COMMAND ${CMAKE_CXX_COMPILER} "-Wl,--version" ERROR_QUIET OUTPUT_VARIABLE LINKER_VERSION)
# For ld.gold and ld.bfs (the GNU linkers) we optimize hard
if("${LINKER_VERSION}" MATCHES "GNU gold" OR "${LINKER_VERSION}" MATCHES "GNU ld")
message(STATUS "Setting linker optimizations")
if(NOT (CMAKE_CXX_COMPILER_ID MATCHES "MSVC" OR "${LD_AVOID_GC_SECTIONS}"))
# Tell compiler to put every function in separate section, linker can then match sections and functions
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffunction-sections -fdata-sections")
# Tell linker to do dead code and data eminination during link time discarding sections
set(LINKER_FLAGS "${LINKER_FLAGS} -Wl,--gc-sections")
endif()
# Default linker optimization flags
set(LINKER_FLAGS "${LINKER_FLAGS} -Wl,-O1 -Wl,--hash-style=gnu -Wl,--sort-common")
else()
message(STATUS "Using unknown linker, not setting linker optimizations")
endif ()
set(OSRM_LDFLAGS "${OSRM_LDFLAGS} ${LINKER_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LINKER_FLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${LINKER_FLAGS}")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${LINKER_FLAGS}")
# Activate C++1y
if(NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
set(OSRM_CXXFLAGS "${OSRM_CXXFLAGS} -std=c++14")
endif()
# Configuring other platform dependencies
if(APPLE)
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.10")
execute_process(COMMAND xcrun --sdk macosx --show-sdk-path OUTPUT_VARIABLE CMAKE_OSX_SYSROOT OUTPUT_STRIP_TRAILING_WHITESPACE)
set(CMAKE_OSX_ARCHITECTURES "x86_64")
message(STATUS "Set Architecture to x64 on OS X")
exec_program(uname ARGS -v OUTPUT_VARIABLE DARWIN_VERSION)
string(REGEX MATCH "[0-9]+" DARWIN_VERSION ${DARWIN_VERSION})
if(OSXLIBSTD)
message(STATUS "linking against ${OSXLIBSTD}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=${OSXLIBSTD}")
elseif(DARWIN_VERSION GREATER 12)
message(STATUS "linking against libc++")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
endif()
endif()
if(UNIX AND NOT APPLE)
set(MAYBE_RT_LIBRARY -lrt)
endif()
# Disallow deprecated protozero APIs
add_definitions(-DPROTOZERO_STRICT_API)
find_package(Threads REQUIRED)
# if mason is enabled no find_package calls are made
# to ensure that we are only compiling and linking against
# fully portable mason packages
if(ENABLE_MASON)
message(STATUS "Installing dependencies via mason")
set(Boost_USE_STATIC_LIBS ON)
mason_use(boost VERSION ${MASON_BOOST_VERSION} HEADER_ONLY)
add_dependency_includes(${MASON_PACKAGE_boost_INCLUDE_DIRS})
mason_use(boost_libfilesystem VERSION ${MASON_BOOST_VERSION})
set(Boost_FILESYSTEM_LIBRARY ${MASON_PACKAGE_boost_libfilesystem_STATIC_LIBS})
mason_use(boost_libiostreams VERSION ${MASON_BOOST_VERSION})
set(Boost_IOSTREAMS_LIBRARY ${MASON_PACKAGE_boost_libiostreams_STATIC_LIBS})
mason_use(boost_libprogram_options VERSION ${MASON_BOOST_VERSION})
set(Boost_PROGRAM_OPTIONS_LIBRARY ${MASON_PACKAGE_boost_libprogram_options_STATIC_LIBS})
mason_use(boost_libregex VERSION ${MASON_BOOST_VERSION})
set(Boost_REGEX_LIBRARY ${MASON_PACKAGE_boost_libregex_STATIC_LIBS})
mason_use(boost_libtest VERSION ${MASON_BOOST_VERSION})
set(Boost_UNIT_TEST_FRAMEWORK_LIBRARY ${MASON_PACKAGE_boost_libtest_STATIC_LIBS})
mason_use(boost_libdate_time VERSION ${MASON_BOOST_VERSION})
set(Boost_DATE_TIME_LIBRARY ${MASON_PACKAGE_boost_libdate_time_STATIC_LIBS})
mason_use(boost_libthread VERSION ${MASON_BOOST_VERSION})
set(Boost_THREAD_LIBRARY ${MASON_PACKAGE_boost_libthread_STATIC_LIBS})
mason_use(boost_libsystem VERSION ${MASON_BOOST_VERSION})
set(Boost_SYSTEM_LIBRARY ${MASON_PACKAGE_boost_libsystem_STATIC_LIBS})
if (ENABLE_STXXL)
mason_use(stxxl VERSION ${MASON_STXXL_VERSION})
add_dependency_includes(${MASON_PACKAGE_stxxl_INCLUDE_DIRS})
set(MAYBE_STXXL_LIBRARY ${MASON_PACKAGE_stxxl_STATIC_LIBS})
add_definitions(-DUSE_STXXL_LIBRARY)
endif()
mason_use(expat VERSION ${MASON_EXPAT_VERSION})
add_dependency_includes(${MASON_PACKAGE_expat_INCLUDE_DIRS})
set(EXPAT_LIBRARIES ${MASON_PACKAGE_expat_STATIC_LIBS})
mason_use(lua VERSION ${MASON_LUA_VERSION})
add_dependency_includes(${MASON_PACKAGE_lua_INCLUDE_DIRS})
set(USED_LUA_LIBRARIES ${MASON_PACKAGE_lua_STATIC_LIBS})
mason_use(bzip2 VERSION ${MASON_BZIP2_VERSION})
add_dependency_includes(${MASON_PACKAGE_bzip2_INCLUDE_DIRS})
set(BZIP2_LIBRARIES ${MASON_PACKAGE_bzip2_STATIC_LIBS})
mason_use(tbb VERSION ${MASON_TBB_VERSION})
add_dependency_includes(${MASON_PACKAGE_tbb_INCLUDE_DIRS})
set(TBB_LIBRARIES ${MASON_PACKAGE_tbb_LDFLAGS})
if(NOT MASON_PACKAGE_tbb_LIBRARY_DIRS)
message(FATAL_ERROR "MASON_PACKAGE_tbb_LIBRARY_DIRS is empty, rpath will not work")
endif()
set(TBB_LINKER_RPATHS "")
foreach(libpath ${MASON_PACKAGE_tbb_LIBRARY_DIRS})
set(TBB_LINKER_RPATHS "${TBB_LINKER_RPATHS} -Wl,-rpath -Wl,${libpath}")
file(GLOB TBBGlob ${libpath}/*.*)
install(FILES ${TBBGlob} DESTINATION lib)
endforeach()
if(APPLE)
set(LINKER_FLAGS "${TBB_LINKER_RPATHS} -Wl,-rpath -Wl,@loader_path")
elseif(UNIX)
set(LINKER_FLAGS "${TBB_LINKER_RPATHS} '-Wl,-rpath,$ORIGIN' -Wl,-z,origin")
endif()
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LINKER_FLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${LINKER_FLAGS}")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${LINKER_FLAGS}")
# current mason packages target -D_GLIBCXX_USE_CXX11_ABI=0
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GLIBCXX_USE_CXX11_ABI=0")
# note: we avoid calling find_package(Osmium ...) here to ensure that the
# expat and bzip2 are used from mason rather than the system
include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/include)
include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/third_party/rapidjson/include)
else()
find_package(Boost 1.54 REQUIRED COMPONENTS ${BOOST_COMPONENTS})
add_dependency_includes(${Boost_INCLUDE_DIRS})
if(WIN32 AND Boost_VERSION VERSION_LESS 106200)
message(FATAL_ERROR "Building with MSVC needs Boost 1.62 with CXX11_CONSTEXPR support")
endif()
find_package(TBB REQUIRED)
add_dependency_includes(${TBB_INCLUDE_DIR})
if(WIN32 AND CMAKE_BUILD_TYPE MATCHES Debug)
set(TBB_LIBRARIES ${TBB_DEBUG_LIBRARIES})
endif()
find_package(EXPAT REQUIRED)
add_dependency_includes(${EXPAT_INCLUDE_DIRS})
if (ENABLE_STXXL)
find_package(STXXL)
if (STXXL_FOUND)
add_dependency_includes(${STXXL_INCLUDE_DIR})
set(MAYBE_STXXL_LIBRARY ${STXXL_LIBRARY})
add_definitions(-DUSE_STXXL_LIBRARY)
else()
MESSAGE(STATUS "STXXL was requested but not found, default STL will be used")
endif()
endif()
find_package(BZip2 REQUIRED)
add_dependency_includes(${BZIP2_INCLUDE_DIR})
find_package(Lua 5.2 REQUIRED)
if (LUA_FOUND)
message(STATUS "Using Lua ${LUA_VERSION_STRING}")
endif()
set(USED_LUA_LIBRARIES ${LUA_LIBRARIES})
add_dependency_includes(${LUA_INCLUDE_DIR})
# add a target to generate API documentation with Doxygen
find_package(Doxygen)
if(DOXYGEN_FOUND)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
add_custom_target(doc
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API documentation with Doxygen" VERBATIM
)
endif()
# note libosmium depends on expat and bzip2
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/cmake")
if(NOT OSMIUM_INCLUDE_DIR)
set(OSMIUM_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/include")
endif()
find_package(Osmium REQUIRED COMPONENTS io)
include_directories(SYSTEM ${OSMIUM_INCLUDE_DIR})
set(RAPIDJSON_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/rapidjson/include")
include_directories(SYSTEM ${RAPIDJSON_INCLUDE_DIR})
endif()
# prefix compilation with ccache by default if available and on clang or gcc
if(ENABLE_CCACHE AND (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU"))
find_program(CCACHE_FOUND ccache)
if(CCACHE_FOUND)
message(STATUS "Using ccache to speed up incremental builds")
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
set(ENV{CCACHE_CPP2} "true")
endif()
endif()
# even with mason builds we want to link to system zlib
# to ensure that osrm binaries play well with other binaries like nodejs
find_package(ZLIB REQUIRED)
add_dependency_includes(${ZLIB_INCLUDE_DIRS})
if(NOT WIN32 AND NOT Boost_USE_STATIC_LIBS)
add_dependency_defines(-DBOOST_TEST_DYN_LINK)
endif()
if(NOT WIN32 AND NOT Boost_USE_STATIC_LIBS)
add_dependency_defines(-DBOOST_TEST_DYN_LINK)
endif()
add_dependency_defines(-DBOOST_SPIRIT_USE_PHOENIX_V3)
add_dependency_defines(-DBOOST_RESULT_OF_USE_DECLTYPE)
add_dependency_defines(-DBOOST_FILESYSTEM_NO_DEPRECATED)
if (ENABLE_STXXL)
set(OpenMP_FIND_QUIETLY ON)
find_package(OpenMP)
if(OPENMP_FOUND)
message(STATUS "OpenMP support found. Linking just in case for stxxl")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
endif()
endif()
add_definitions(${OSRM_DEFINES})
include_directories(SYSTEM ${DEPENDENCIES_INCLUDE_DIRS})
set(BOOST_BASE_LIBRARIES
${Boost_DATE_TIME_LIBRARY}
${Boost_CHRONO_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}
${Boost_IOSTREAMS_LIBRARY}
${Boost_THREAD_LIBRARY}
${Boost_SYSTEM_LIBRARY})
set(BOOST_ENGINE_LIBRARIES
${Boost_ZLIB_LIBRARY}
${Boost_REGEX_LIBRARY}
${BOOST_BASE_LIBRARIES})
# Binaries
target_link_libraries(osrm-datastore osrm_store ${Boost_PROGRAM_OPTIONS_LIBRARY})
target_link_libraries(osrm-extract osrm_extract ${Boost_PROGRAM_OPTIONS_LIBRARY})
target_link_libraries(osrm-partition osrm_partition ${Boost_PROGRAM_OPTIONS_LIBRARY})
target_link_libraries(osrm-customize osrm_customize ${Boost_PROGRAM_OPTIONS_LIBRARY})
target_link_libraries(osrm-contract osrm_contract ${Boost_PROGRAM_OPTIONS_LIBRARY})
target_link_libraries(osrm-routed osrm ${Boost_PROGRAM_OPTIONS_LIBRARY} ${OPTIONAL_SOCKET_LIBS} ${ZLIB_LIBRARY})
set(EXTRACTOR_LIBRARIES
${BZIP2_LIBRARIES}
${Boost_REGEX_LIBRARY}
${BOOST_BASE_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
${EXPAT_LIBRARIES}
${USED_LUA_LIBRARIES}
${OSMIUM_LIBRARIES}
${MAYBE_STXXL_LIBRARY}
${TBB_LIBRARIES}
${ZLIB_LIBRARY}
${MAYBE_COVERAGE_LIBRARIES})
set(GUIDANCE_LIBRARIES
${BOOST_BASE_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
${USED_LUA_LIBRARIES}
${TBB_LIBRARIES}
${MAYBE_COVERAGE_LIBRARIES})
set(PARTITIONER_LIBRARIES
${BOOST_ENGINE_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
${TBB_LIBRARIES}
${MAYBE_RT_LIBRARY}
${MAYBE_COVERAGE_LIBRARIES}
${ZLIB_LIBRARY})
set(CUSTOMIZER_LIBRARIES
${BOOST_ENGINE_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
${TBB_LIBRARIES}
${MAYBE_RT_LIBRARY}
${MAYBE_COVERAGE_LIBRARIES})
set(UPDATER_LIBRARIES
${BOOST_BASE_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
${TBB_LIBRARIES}
${MAYBE_RT_LIBRARY}
${MAYBE_COVERAGE_LIBRARIES}
${ZLIB_LIBRARY})
set(CONTRACTOR_LIBRARIES
${BOOST_BASE_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
${USED_LUA_LIBRARIES}
${MAYBE_STXXL_LIBRARY}
${TBB_LIBRARIES}
${MAYBE_RT_LIBRARY}
${MAYBE_COVERAGE_LIBRARIES})
set(ENGINE_LIBRARIES
${BOOST_ENGINE_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
${TBB_LIBRARIES}
${MAYBE_RT_LIBRARY}
${MAYBE_COVERAGE_LIBRARIES}
${ZLIB_LIBRARY})
set(STORAGE_LIBRARIES
${BOOST_BASE_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
${TBB_LIBRARIES}
${MAYBE_RT_LIBRARY}
${MAYBE_COVERAGE_LIBRARIES})
set(UTIL_LIBRARIES
${BOOST_BASE_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
${MAYBE_STXXL_LIBRARY}
${TBB_LIBRARIES}
${MAYBE_COVERAGE_LIBRARIES}
${ZLIB_LIBRARY})
# Libraries
target_link_libraries(osrm ${ENGINE_LIBRARIES})
target_link_libraries(osrm_update ${UPDATER_LIBRARIES})
target_link_libraries(osrm_contract ${CONTRACTOR_LIBRARIES} osrm_update osrm_store)
target_link_libraries(osrm_extract osrm_guidance ${EXTRACTOR_LIBRARIES})
target_link_libraries(osrm_partition ${PARTITIONER_LIBRARIES})
target_link_libraries(osrm_customize ${CUSTOMIZER_LIBRARIES} osrm_update osrm_store)
target_link_libraries(osrm_store ${STORAGE_LIBRARIES})
# BUILD_COMPONENTS
add_executable(osrm-components src/tools/components.cpp $<TARGET_OBJECTS:UTIL>)
target_link_libraries(osrm-components ${TBB_LIBRARIES} ${BOOST_BASE_LIBRARIES} ${UTIL_LIBRARIES})
install(TARGETS osrm-components DESTINATION bin)
if(BUILD_TOOLS)
message(STATUS "Activating OSRM internal tools")
add_executable(osrm-io-benchmark src/tools/io-benchmark.cpp $<TARGET_OBJECTS:UTIL>)
target_link_libraries(osrm-io-benchmark ${BOOST_BASE_LIBRARIES})
install(TARGETS osrm-io-benchmark DESTINATION bin)
endif()
if (ENABLE_ASSERTIONS)
message(STATUS "Enabling assertions")
add_definitions(-DBOOST_ENABLE_ASSERT_HANDLER)
endif()
# Add RPATH info to executables so that when they are run after being installed
# (i.e., from /usr/local/bin/) the linker can find library dependencies. For
# more info see http://www.cmake.org/Wiki/CMake_RPATH_handling
set_property(TARGET osrm-extract PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE)
set_property(TARGET osrm-partition PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE)
set_property(TARGET osrm-contract PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE)
set_property(TARGET osrm-datastore PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE)
set_property(TARGET osrm-routed PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE)
file(GLOB VariantGlob third_party/variant/include/mapbox/*.hpp)
file(GLOB LibraryGlob include/osrm/*.hpp)
file(GLOB ParametersGlob include/engine/api/*_parameters.hpp)
set(EngineHeader include/engine/status.hpp include/engine/engine_config.hpp include/engine/hint.hpp include/engine/bearing.hpp include/engine/approach.hpp include/engine/phantom_node.hpp)
set(UtilHeader include/util/coordinate.hpp include/util/json_container.hpp include/util/typedefs.hpp include/util/alias.hpp include/util/exception.hpp include/util/bearing.hpp)
set(ExtractorHeader include/extractor/extractor.hpp include/storage/io_config.hpp include/extractor/extractor_config.hpp include/extractor/travel_mode.hpp)
set(PartitionerHeader include/partitioner/partitioner.hpp include/partitioner/partitioner_config.hpp)
set(ContractorHeader include/contractor/contractor.hpp include/contractor/contractor_config.hpp)
set(StorageHeader include/storage/storage.hpp include/storage/io_config.hpp include/storage/storage_config.hpp)
install(FILES ${EngineHeader} DESTINATION include/osrm/engine)
install(FILES ${UtilHeader} DESTINATION include/osrm/util)
install(FILES ${StorageHeader} DESTINATION include/osrm/storage)
install(FILES ${ExtractorHeader} DESTINATION include/osrm/extractor)
install(FILES ${PartitionerHeader} DESTINATION include/osrm/partitioner)
install(FILES ${ContractorHeader} DESTINATION include/osrm/contractor)
install(FILES ${LibraryGlob} DESTINATION include/osrm)
install(FILES ${ParametersGlob} DESTINATION include/osrm/engine/api)
install(FILES ${VariantGlob} DESTINATION include/mapbox)
install(TARGETS osrm-extract DESTINATION bin)
install(TARGETS osrm-partition DESTINATION bin)
install(TARGETS osrm-customize DESTINATION bin)
install(TARGETS osrm-contract DESTINATION bin)
install(TARGETS osrm-datastore DESTINATION bin)
install(TARGETS osrm-routed DESTINATION bin)
install(TARGETS osrm DESTINATION lib)
install(TARGETS osrm_extract DESTINATION lib)
install(TARGETS osrm_partition DESTINATION lib)
install(TARGETS osrm_customize DESTINATION lib)
install(TARGETS osrm_update DESTINATION lib)
install(TARGETS osrm_contract DESTINATION lib)
install(TARGETS osrm_store DESTINATION lib)
# Install profiles and support library to /usr/local/share/osrm/profiles by default
set(DefaultProfilesDir profiles)
install(DIRECTORY ${DefaultProfilesDir} DESTINATION share/osrm)
# Setup exporting variables for pkgconfig and subproject
#
if(BUILD_PACKAGE)
include(CPackConfig)
include(CPack)
endif()
function(JOIN VALUES GLUE OUTPUT)
string (REPLACE ";" "${GLUE}" _TMP_STR "${VALUES}")
set (${OUTPUT} "${_TMP_STR}" PARENT_SCOPE)
endfunction()
JOIN("${OSRM_DEFINES}" " " TMP_OSRM_DEFINES)
set(LibOSRM_CXXFLAGS "${OSRM_CXXFLAGS} ${TMP_OSRM_DEFINES}")
set(LibOSRM_LDFLAGS "${OSRM_LDFLAGS}")
if(BUILD_AS_SUBPROJECT)
set(LibOSRM_CXXFLAGS "${LibOSRM_CXXFLAGS}" PARENT_SCOPE)
set(LibOSRM_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include" PARENT_SCOPE)
set(LibOSRM_LIBRARY_DIR "${CMAKE_CURRENT_BINARY_DIR}" PARENT_SCOPE)
set(LibOSRM_LIBRARIES "osrm" PARENT_SCOPE)
set(LibOSRM_DEPENDENT_LIBRARIES "${ENGINE_LIBRARIES}" PARENT_SCOPE)
set(LibOSRM_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/include"
"${CMAKE_CURRENT_SOURCE_DIR}/include/osrm"
"${CMAKE_CURRENT_SOURCE_DIR}/third_party"
"${DEPENDENCIES_INCLUDE_DIRS}" PARENT_SCOPE)
set(LibOSRM_LIBRARY_DIRS "${LibOSRM_LIBRARY_DIR}" PARENT_SCOPE)
endif()
# pkgconfig defines
set(PKGCONFIG_OSRM_CXXFLAGS "${LibOSRM_CXXFLAGS}")
set(PKGCONFIG_OSRM_LDFLAGS "${LibOSRM_LDFLAGS}")
set(PKGCONFIG_LIBRARY_DIR "${CMAKE_INSTALL_PREFIX}/lib")
set(PKGCONFIG_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/include")
list(APPEND DEPENDENCIES_INCLUDE_DIRS "${PKGCONFIG_INCLUDE_DIR}")
list(APPEND DEPENDENCIES_INCLUDE_DIRS "${PKGCONFIG_INCLUDE_DIR}/osrm")
JOIN("-I${DEPENDENCIES_INCLUDE_DIRS}" " -I" PKGCONFIG_OSRM_INCLUDE_FLAGS)
JOIN("${ENGINE_LIBRARIES}" " " PKGCONFIG_OSRM_DEPENDENT_LIBRARIES)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/pkgconfig.in libosrm.pc @ONLY)
install(FILES ${PROJECT_BINARY_DIR}/libosrm.pc DESTINATION ${PKGCONFIG_LIBRARY_DIR}/pkgconfig)
# uninstall target
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake_uninstall.cmake)
# Modular build system: each directory registered here provides its own CMakeLists.txt
add_subdirectory(unit_tests)
add_subdirectory(src/benchmarks)
if (ENABLE_GLIBC_WORKAROUND)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DGLIBC_WORKAROUND")
endif()
if (ENABLE_NODE_BINDINGS)
add_subdirectory(src/nodejs)
endif()
if (ENABLE_FUZZING)
# Requires libosrm being built with sanitizers; make configurable and default to ubsan
set(FUZZ_SANITIZER "undefined" CACHE STRING "Sanitizer to be used for Fuzz testing")
set_property(CACHE FUZZ_SANITIZER PROPERTY STRINGS "undefined" "integer" "address" "memory" "thread" "leak")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize-coverage=edge,indirect-calls,8bit-counters -fsanitize=address")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
set(OSRM_LDFLAGS "${OSRM_LDFLAGS} -fsanitize=address")
message(STATUS "Using -fsanitize=${FUZZ_SANITIZER} for Fuzz testing")
add_subdirectory(fuzz)
endif ()
# add headers sanity check target that includes all headers independently
# make sure we have all deps for the nodejs sub project's includes (nan, node)
if (ENABLE_NODE_BINDINGS)
set(check_headers_dir "${PROJECT_BINARY_DIR}/check-headers")
file(GLOB_RECURSE headers_to_check
${PROJECT_BINARY_DIR}/*.hpp
${PROJECT_SOURCE_DIR}/include/*.hpp)
foreach(header ${headers_to_check})
get_filename_component(filename ${header} NAME_WE)
set(filename "${check_headers_dir}/${filename}.cpp")
if (NOT EXISTS ${filename})
file(WRITE ${filename} "#include \"${header}\"\n")
endif()
list(APPEND sources ${filename})
endforeach()
add_library(check-headers STATIC EXCLUDE_FROM_ALL ${sources})
set_target_properties(check-headers PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${check_headers_dir})
endif()
-3
View File
@@ -1,3 +0,0 @@
# Code of conduct
Everyone is invited to participate in Project OSRMs open source projects and public discussions: we want to create a welcoming and friendly environment. Harassment of participants or other unethical and unprofessional behavior will not be tolerated in our spaces. The [Contributor Covenant](http://contributor-covenant.org) applies to all projects under the Project-OSRM organization and we ask that you please read [the full text](http://contributor-covenant.org/version/1/2/0/).
-81
View File
@@ -1,81 +0,0 @@
# Everyone
Please take some time to review our [code of conduct](CODE-OF-CONDUCT.md) to help guide your interactions with others on this project.
# User
Before you open a new issue, please search for older ones that cover the same issue.
In general "me too" comments/issues are frowned upon.
You can add a :+1: emoji reaction to the issue if you want to express interest in this.
# Developer
We use `clang-format` version `3.8` to consistently format the code base. There is a helper script under `scripts/format.sh`.
The format is automatically checked by the `mason-linux-release` job of a Travis CI build.
To save development time a local hook `.git/hooks/pre-push`
```
#!/bin/sh
remote="$1"
if [ x"$remote" = xorigin ] ; then
if [ $(git rev-parse --abbrev-ref HEAD) = master ] ; then
echo "Rejected push to $remote/master" ; exit 1
fi
./scripts/format.sh && ./scripts/error_on_dirty.sh
if [ $? -ne 0 ] ; then
echo "Unstaged format changes" ; exit 1
fi
fi
```
could check code format, modify a local repository and reject push due to unstaged formatting changes.
Also `pre-push` hook rejects direct pushes to `origin/master`.
⚠️ `scripts/format.sh` checks all local files that match `*.cpp` or `*.hpp` patterns.
In general changes that affect the API and/or increase the memory consumption need to be discussed first.
Often we don't include changes that would increase the memory consumption a lot if they are not generally usable (e.g. elevation data is a good example).
## Pull Request
Every pull-request that changes the API needs to update the docs in `docs/http.md` and add an entry to `CHANGELOG.md`.
Breaking changes need to have a BREAKING prefix. See the [releasing documentation](docs/releasing.md) on how this affects the version.
Early feedback is also important.
You will see that a lot of the PR have tags like `[not ready]` or `[wip]`.
We like to open PRs as soon as we are starting to work on something to make it visible to the rest of the team.
If your work is going in entirely the wrong direction, there is a good chance someone will pick up on this before it is too late.
Everyone is encouraged to read PRs of other people and give feedback.
For every significant code change we require a pull request review before it is merged.
If your pull request modifies the API this need to be signed of by a team discussion.
This means you will need to find another member of the team with commit access and request a review of your pull request.
Once your pull request is reviewed you can merge it! If you don't have commit access, ping someone that has commit access.
If you do have commit access there are in general two accepted styles to merging:
1. Make sure the branch is up to date with `master`. Run `git rebase master` to find out.
2. Once that is ensured you can either:
- Click the nice green merge button (for a non-fast-forward merge)
- Merge by hand using a fast-forward merge
Which merge you prefer is up to personal preference. In general it is recommended to use fast-forward merges because it creates a history that is sequential and easier to understand.
# Maintainer
## Doing a release
There is an in-depth guide around how to push out a release once it is ready [here](docs/releasing.md).
## The API
Changes to the API need to be discussed and signed off by the team. Breaking changes even more so than additive changes.
## Milestones
If a pull request or an issue is applicable for the current or next milestone, depends on the target version number.
Since we use semantic versioning we restrict breaking changes to major releases.
After a Release Candidate is released we usually don't change the API anymore if it is not critical.
Bigger code changes after a RC was released should also be avoided.
-44
View File
@@ -1,44 +0,0 @@
PROJECT_NAME = "Project OSRM"
PROJECT_BRIEF = "Open Source Routing Machine"
BUILTIN_STL_SUPPORT = YES
EXTRACT_ALL = YES
EXTRACT_PRIVATE = YES
EXTRACT_PACKAGE = YES
EXTRACT_STATIC = YES
EXTRACT_LOCAL_CLASSES = YES
EXTRACT_ANON_NSPACES = YES
QUIET = YES
INPUT = @CMAKE_CURRENT_SOURCE_DIR@
USE_MDFILE_AS_MAINPAGE = @CMAKE_CURRENT_SOURCE_DIR@/README.md
FILE_PATTERNS = *.h *.hpp *.c *.cc *.cpp *.md
RECURSIVE = YES
EXCLUDE = @CMAKE_CURRENT_SOURCE_DIR@/third_party \
@CMAKE_CURRENT_SOURCE_DIR@/build \
@CMAKE_CURRENT_SOURCE_DIR@/node_modules \
@CMAKE_CURRENT_SOURCE_DIR@/unit_tests \
@CMAKE_CURRENT_SOURCE_DIR@/benchmarks \
@CMAKE_CURRENT_SOURCE_DIR@/features
SOURCE_BROWSER = YES
CLANG_ASSISTED_PARSING = NO
HTML_COLORSTYLE_HUE = 217
HTML_COLORSTYLE_SAT = 71
HTML_COLORSTYLE_GAMMA = 50
GENERATE_TREEVIEW = YES
HAVE_DOT = @DOXYGEN_DOT_FOUND@
CALL_GRAPH = YES
CALLER_GRAPH = YES
DOT_IMAGE_FORMAT = svg
INTERACTIVE_SVG = YES
DOT_GRAPH_MAX_NODES = 500
DOT_TRANSPARENT = YES
DOT_MULTI_TARGETS = YES
-22
View File
@@ -1,22 +0,0 @@
Copyright (c) 2017, Project OSRM contributors
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+68 -176
View File
@@ -1,180 +1,72 @@
## Open Source Routing Machine
| Linux / macOS | Windows | Code Coverage |
| ------------- | ------- | ------------- |
| [![Travis](https://travis-ci.org/Project-OSRM/osrm-backend.png?branch=master)](https://travis-ci.org/Project-OSRM/osrm-backend) | [![AppVeyor](https://ci.appveyor.com/api/projects/status/4iuo3s9gxprmcjjh)](https://ci.appveyor.com/project/DennisOSRM/osrm-backend) | [![Codecov](https://codecov.io/gh/Project-OSRM/osrm-backend/branch/master/graph/badge.svg)](https://codecov.io/gh/Project-OSRM/osrm-backend) |
High performance routing engine written in C++14 designed to run on OpenStreetMap data.
The following services are available via HTTP API, C++ library interface and NodeJs wrapper:
- Nearest - Snaps coordinates to the street network and returns the nearest matches
- Route - Finds the fastest route between coordinates
- Table - Computes the duration of the fastest route between all pairs of supplied coordinates
- Match - Snaps noisy GPS traces to the road network in the most plausible way
- Trip - Solves the Traveling Salesman Problem using a greedy heuristic
- Tile - Generates Mapbox Vector Tiles with internal routing metadata
To quickly try OSRM use our [demo server](http://map.project-osrm.org) which comes with both the backend and a frontend on top.
For a quick introduction about how the road network is represented in OpenStreetMap and how to map specific road network features have a look at [this guide about mapping for navigation](https://www.mapbox.com/mapping/mapping-for-navigation/).
Related [Project-OSRM](https://github.com/Project-OSRM) repositories:
- [osrm-frontend](https://github.com/Project-OSRM/osrm-frontend) - User-facing frontend with map. The demo server runs this on top of the backend
- [osrm-text-instructions](https://github.com/Project-OSRM/osrm-text-instructions) - Text instructions from OSRM route response
- [osrm-backend-docker](https://hub.docker.com/r/osrm/osrm-backend/) - Ready to use Docker images
## Documentation
### Full documentation
- [Hosted documentation](http://project-osrm.org)
- [osrm-routed HTTP API documentation](docs/http.md)
- [libosrm API documentation](docs/libosrm.md)
## Contact
- IRC: `irc.oftc.net`, channel: `#osrm` ([Webchat](https://webchat.oftc.net))
- Mailinglist: `https://lists.openstreetmap.org/listinfo/osrm-talk`
## Quick Start
The easiest and quickest way to setup your own routing engine is to use Docker images we provide.
There are two pre-processing pipelines available:
- Contraction Hierarchies (CH)
- Multi-Level Dijkstra (MLD)
we recommend using MLD by default except for special use-cases such as very large distance matrices where CH is still a better fit for the time being.
In the following we explain the MLD pipeline.
If you want to use the CH pipeline instead replace `osrm-partition` and `osrm-customize` with a single `osrm-contract` and change the algorithm option for `osrm-routed` to `--algorithm ch`.
### Using Docker
We base our Docker images ([backend](https://hub.docker.com/r/osrm/osrm-backend/), [frontend](https://hub.docker.com/r/osrm/osrm-frontend/)) on Alpine Linux and make sure they are as lightweight as possible.
Download OpenStreetMap extracts for example from [Geofabrik](http://download.geofabrik.de/)
wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf
Pre-process the extract with the car profile and start a routing engine HTTP server on port 5000
docker run -t -v $(pwd):/data osrm/osrm-backend osrm-extract -p /opt/car.lua /data/berlin-latest.osm.pbf
The flag `-v $(pwd):/data` creates the directory `/data` inside the docker container and makes the current working directory `$(pwd)` available there. The file `/data/berlin-latest.osm.pbf` inside the container is referring to `$(pwd)/berlin-latest.osm.pbf` on the host.
docker run -t -v $(pwd):/data osrm/osrm-backend osrm-partition /data/berlin-latest.osrm
docker run -t -v $(pwd):/data osrm/osrm-backend osrm-customize /data/berlin-latest.osrm
Note that `berlin-latest.osrm` has a different file extension.
docker run -t -i -p 5000:5000 -v $(pwd):/data osrm/osrm-backend osrm-routed --algorithm mld /data/berlin-latest.osrm
Make requests against the HTTP server
curl "http://127.0.0.1:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true"
Optionally start a user-friendly frontend on port 9966, and open it up in your browser
docker run -p 9966:9966 osrm/osrm-frontend
xdg-open 'http://127.0.0.1:9966'
In case Docker complains about not being able to connect to the Docker daemon make sure you are in the `docker` group.
sudo usermod -aG docker $USER
After adding yourself to the `docker` group make sure to log out and back in again with your terminal.
We support the following images on Docker Cloud:
Name | Description
-----|------
`latest` | `master` compiled with release flag
`latest-assertions` | `master` compiled with with release flag, assertions enabled and debug symbols
`latest-debug` | `master` compiled with debug flag
`<tag>` | specific tag compiled with release flag
`<tag>-debug` | specific tag compiled with debug flag
### Building from Source
The following targets Ubuntu 16.04.
For instructions how to build on different distributions, macOS or Windows see our [Wiki](https://github.com/Project-OSRM/osrm-backend/wiki).
Install dependencies
```bash
sudo apt install build-essential git cmake pkg-config \
libbz2-dev libxml2-dev libzip-dev libboost-all-dev \
lua5.2 liblua5.2-dev libtbb-dev
```
Compile and install OSRM binaries
```bash
mkdir -p build
cd build
cmake ..
cmake --build .
sudo cmake --build . --target install
```
### Request Against the Demo Server
Read the [API usage policy](https://github.com/Project-OSRM/osrm-backend/wiki/Demo-server).
Simple query with instructions and alternatives on Berlin:
```
curl "https://router.project-osrm.org/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true&alternatives=true"
```
### Using the Node.js Bindings
The Node.js bindings provide read-only access to the routing engine.
We provide API documentation and examples [here](docs/nodejs/api.md).
You will need a modern `libstdc++` toolchain (`>= GLIBCXX_3.4.20`) for binary compatibility if you want to use the pre-built binaries.
For older Ubuntu systems you can upgrade your standard library for example with:
```
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update -y
sudo apt-get install -y libstdc++-5-dev
```
You can install the Node.js bindings via `npm install osrm` or from this repository either via
npm install
which will check and use pre-built binaries if they're available for this release and your Node version, or via
npm install --build-from-source
to always force building the Node.js bindings from source.
For usage details have a look [these API docs](docs/nodejs/api.md).
An exemplary implementation by a 3rd party with Docker and Node.js can be found [here](https://github.com/door2door-io/osrm-express-server-demo).
Overview
--------
The repository provides a Leaflet [(1)] based web frontend to the Open Source Routing Machine (Project-OSRM [(2)]).
The frontend is implemented in Javascript.
Data is fetched from routing and geocoding servers using JSONP queries.
The website is XHTML 1.0 Strict compliant.
A deployed version of the the web frontend can be seen at [(3)].
## References in publications
Setup
-----
The frontend should work directly as provided.
Several settings - including the URL for the routing server and the geocoder server - can be specified in `OSRM.config.js`.
Different tile servers can be specified in `OSRM.Map.js`.
Note that the URL shortener used for generating route links only works with URLs pointing to the official Project-OSRM website.
When using the code in a (scientific) publication, please cite
```
@inproceedings{luxen-vetter-2011,
author = {Luxen, Dennis and Vetter, Christian},
title = {Real-time routing with OpenStreetMap data},
booktitle = {Proceedings of the 19th ACM SIGSPATIAL International Conference on Advances in Geographic Information Systems},
series = {GIS '11},
year = {2011},
isbn = {978-1-4503-1031-4},
location = {Chicago, Illinois},
pages = {513--516},
numpages = {4},
url = {http://doi.acm.org/10.1145/2093973.2094062},
doi = {10.1145/2093973.2094062},
acmid = {2094062},
publisher = {ACM},
address = {New York, NY, USA},
}
```
Branches
--------
* The `master` branch will always point to the latest released version of the frontend.
* The `develop` branch should always point to a working version with new features and bugfixes (think of it as a nightly-build).
* Other branches contain various work in progress.
Bugtracking
-----------
Please use the OSRM-Project bug tracker [(4)] for submitting any bug reports or feature requests.
Contribute
----------
If you like to contribute, simply fork the project and start coding.
It is best practice to create a new branch (from the current master) with a descriptive name for your contributions.
When you are done, send a pull request from that branch.
With this workflow, each pull request is isolated and can be easily merged.
Integration into Project-OSRM repository
----------------------------------------
The Project-OSRM repository already contains the frontend repository as a submodule.
It will always point to the latest deployed version.
To successfully work a repository that contains submodules, use the following git commands (available in git 1.7.1+):
* `git clone --recursive`
to clone a repository and the contained submodules
* `git pull && git submodule update`
to pull the latest version of the repository and update its submodules if required
Note that the frontend can also be checked out independently of the Project-OSRM repository.
Compatibility
-------------
The frontend has been tested with Firefox 3.0+, Internet Explorer 8+ and Chrome 18+.
Certain visuals like rounded corners or moving boxes will only show in newer browser versions.
But no actual functionality is affected by this.
Note that the frontend will not work with Internet Explorer 6 or 7.
References
----------
[(1)] Cloudmade Leaflet: http://leaflet.cloudmade.com/
[(2)] Project OSRM: http://project-osrm.org/
[(3)] Project OSRM Frontend: http://map.project-osrm.org/
[(4)] Project OSRM Bugtracker: https://github.com/DennisOSRM/Project-OSRM/issues/
[(1)]: http://leaflet.cloudmade.com/ "Cloudmade Leaflet"
[(2)]: http://project-osrm.org/ "Project OSRM"
[(3)]: http://map.project-osrm.org/ "Project-OSRM Frontend"
[(4)]: https://github.com/DennisOSRM/Project-OSRM/issues/ "Project-OSRM Bugtracker"
+28
View File
@@ -0,0 +1,28 @@
/*
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU AFFERO General Public License as published by
the Free Software Foundation; either version 3 of the License, or
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
or see http://www.gnu.org/licenses/agpl.txt.
*/
// OSRM base class
// [has to be loaded before all other OSRM classes]
var OSRM = {};
OSRM.VERSION = '0.1.6';
OSRM.DATE = '120516';
OSRM.CONSTANTS = {};
OSRM.DEFAULTS = {};
OSRM.GLOBALS = {};
OSRM.G = OSRM.GLOBALS; // abbreviations
OSRM.C = OSRM.CONSTANTS;
+95
View File
@@ -0,0 +1,95 @@
/*
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU AFFERO General Public License as published by
the Free Software Foundation; either version 3 of the License, or
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
or see http://www.gnu.org/licenses/agpl.txt.
*/
// OSRM config file
// [has to be loaded directly after OSRM.base]
OSRM.DEFAULTS = {
HOST_ROUTING_URL: 'http://router.project-osrm.org/viaroute',
HOST_SHORTENER_URL: 'http://map.project-osrm.org/shorten/',
HOST_TIMESTAMP_URL: 'http://router.project-osrm.org/timestamp',
HOST_GEOCODER_URL: 'http://nominatim.openstreetmap.org/search',
HOST_REVERSE_GEOCODER_URL: 'http://nominatim.openstreetmap.org/reverse',
WEBSITE_URL: document.URL.replace(/#*(\?.*|$)/i,""), // truncates URL before first ?, and removes tailing #
JSONP_TIMEOUT: 10000,
ZOOM_LEVEL: 14,
ONLOAD_ZOOM_LEVEL: 5,
ONLOAD_LATITUDE: 48.84,
ONLOAD_LONGITUDE: 10.10,
ONLOAD_SOURCE: "",
ONLOAD_TARGET: "",
HIGHLIGHT_ZOOM_LEVEL: 16,
DISTANCE_FORMAT: 0, // 0: km, 1: miles
GEOCODER_BOUNDS: '', // the world is not enough!
//GEOCODER_BOUNDS: '&bounded=1&viewbox=-27.0,72.0,46.0,36.0', // bounds for Europe
SHORTENER_PARAMETERS: '%url&jsonp=%jsonp',
SHORTENER_REPLY_PARAMETER: 'ShortURL',
LANGUAGE: "en",
LANUGAGE_ONDEMAND_RELOADING: true,
LANGUAGE_SUPPORTED: [
{encoding:"en", name:"English"},
{encoding:"de", name:"Deutsch"},
{encoding:"dk", name:"Dansk"},
{encoding:"fi", name:"Suomi"},
{encoding:"fr", name:"Français"},
{encoding:"it", name:"Italiano"},
{encoding:"pl", name:"Polski", culture:"en-US"}
],
TILE_SERVERS: [
{ display_name: 'osm.org',
url:'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
attribution:'Map data &copy; 2011 OpenStreetMap contributors, Imagery &copy; 2011 Mapnik',
options:{maxZoom: 18}
},
{ display_name: 'osm.de',
url:'http://{s}.tile.openstreetmap.de/tiles/osmde/{z}/{x}/{y}.png',
attribution:'Map data &copy; 2011 OpenStreetMap contributors, Imagery &copy; 2011 Mapnik',
options:{maxZoom: 18}
},
{ display_name: 'MapQuest',
url:'http://otile{s}.mqcdn.com/tiles/1.0.0/osm/{z}/{x}/{y}.png',
attribution:'Map data &copy; 2011 OpenStreetMap contributors, Imagery &copy; 2011 MapQuest',
options:{maxZoom: 18, subdomains: '1234'}
},
{ display_name: 'CloudMade',
url:'http://{s}.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/997/256/{z}/{x}/{y}.png',
attribution:'Map data &copy; 2011 OpenStreetMap contributors, Imagery &copy; 2011 CloudMade',
options:{maxZoom: 18}
},
{
display_name: 'Bing Road',
apikey:'AjCb2f6Azv_xt9c6pl_xok96bgAYrXQNctnG4o07sTj4iS9N68Za4B3pRJyeCjGr', // please use your own apikey (http://msdn.microsoft.com/en-us/library/ff428642.aspx)
type:"Road",
options:{minZoom: 1},
bing:true,
},
{
display_name: 'Bing Aerial',
apikey:'AjCb2f6Azv_xt9c6pl_xok96bgAYrXQNctnG4o07sTj4iS9N68Za4B3pRJyeCjGr', // please use your own apikey (http://msdn.microsoft.com/en-us/library/ff428642.aspx)
type:"Aerial",
options:{minZoom: 1},
bing:true,
}
],
MAINTENANCE: false,
MAINTENANCE_HEADER: "Scheduled Maintenance",
MAINTENANCE_TEXT: "The OSRM Website is down for a scheduled maintenance. Please be patient while required updates are performed. The site will be back online shortly.<br/><br/>In the meantime you may want to go out an map a friendly neighborhood near you...<br/><br/><br/>[OSRM]",
};
+217
View File
@@ -0,0 +1,217 @@
/*
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU AFFERO General Public License as published by
the Free Software Foundation; either version 3 of the License, or
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
or see http://www.gnu.org/licenses/agpl.txt.
*/
// OSRM geocoding routines
// [geocoder query, management and display of geocoder results]
// some constants
OSRM.CONSTANTS.SOURCE_LABEL = "source";
OSRM.CONSTANTS.TARGET_LABEL = "target";
OSRM.CONSTANTS.VIA_LABEL = "via";
OSRM.CONSTANTS.DO_FALLBACK_TO_LAT_LNG = true;
OSRM.Geocoder = {
//[normal geocoding]
// process input request and call geocoder if needed
call: function(marker_id, query) {
if(query=="")
return;
//geo coordinates given -> directly draw results
if(query.match(/^\s*[-+]?[0-9]*\.?[0-9]+\s*[,;]\s*[-+]?[0-9]*\.?[0-9]+\s*$/)){
var coord = query.split(/[,;]/);
OSRM.Geocoder._onclickResult(marker_id, coord[0], coord[1]);
OSRM.Geocoder.updateAddress( marker_id );
return;
}
//build request for geocoder
var call = OSRM.DEFAULTS.HOST_GEOCODER_URL + "?format=json&json_callback=%jsonp" + OSRM.DEFAULTS.GEOCODER_BOUNDS + "&accept-language="+OSRM.Localization.current_language+"&q=" + query;
OSRM.JSONP.call( call, OSRM.Geocoder._showResults, OSRM.Geocoder._showResults_Timeout, OSRM.DEFAULTS.JSONP_TIMEOUT, "geocoder_"+marker_id, {marker_id:marker_id,query:query} );
},
// helper function for clicks on geocoder search results
_onclickResult: function(marker_id, lat, lon) {
var index;
if( marker_id == OSRM.C.SOURCE_LABEL )
index = OSRM.G.markers.setSource( new L.LatLng(lat, lon) );
else if( marker_id == OSRM.C.TARGET_LABEL )
index = OSRM.G.markers.setTarget( new L.LatLng(lat, lon) );
else
return;
OSRM.G.markers.route[index].show();
OSRM.G.markers.route[index].centerView();
if( OSRM.G.markers.route.length > 1 )
OSRM.Routing.getRoute();
},
// process geocoder response
_showResults: function(response, parameters) {
if(!response){
OSRM.Geocoder._showResults_Empty(parameters);
return;
}
if(response.length == 0) {
OSRM.Geocoder._showResults_Empty(parameters);
return;
}
// show first result
OSRM.Geocoder._onclickResult(parameters.marker_id, response[0].lat, response[0].lon);
if( OSRM.G.markers.route.length > 1 ) // if a route is displayed, we don't need to show other possible geocoding results
return;
// show possible results for input
var html = "";
html += '<table class="results medium-font">';
for(var i=0; i < response.length; i++){
var result = response[i];
//odd or even ?
var rowstyle='results-body-odd';
if(i%2==0) { rowstyle='results-body-even'; }
html += '<tr class="'+rowstyle+'">';
html += '<td class="results-body-counter"><span">'+(i+1)+'.</span></td>';
html += '<td class="results-body-items">';
if(result.display_name){
html += '<div class="results-body-item" onclick="OSRM.Geocoder._onclickResult(\''+parameters.marker_id+'\', '+result.lat+', '+result.lon+');">'+result.display_name+'</div>';
}
html += "</td></tr>";
}
html += '</table>';
document.getElementById('information-box-header').innerHTML =
"<div class='header-title'>"+OSRM.loc("SEARCH_RESULTS")+"</div>" +
"<div class='header-content'>("+OSRM.loc("FOUND_X_RESULTS").replace(/%i/,response.length)+")</div>";
"<div class='header-content'>(found "+response.length+" results)"+"</div>";
document.getElementById('information-box').innerHTML = html;
},
_showResults_Empty: function(parameters) {
document.getElementById('information-box-header').innerHTML =
"<div class='header-title'>"+OSRM.loc("SEARCH_RESULTS")+"</div>" +
"<div class='header-content'>("+OSRM.loc("FOUND_X_RESULTS").replace(/%i/,0)+")</div>";
if(parameters.marker_id == OSRM.C.SOURCE_LABEL)
document.getElementById('information-box').innerHTML = "<div class='no-results big-font'>"+OSRM.loc("NO_RESULTS_FOUND_SOURCE")+": "+parameters.query +"</div>";
else if(parameters.marker_id == OSRM.C.TARGET_LABEL)
document.getElementById('information-box').innerHTML = "<div class='no-results big-font'>"+OSRM.loc("NO_RESULTS_FOUND_TARGET")+": "+parameters.query +"</div>";
else
document.getElementById('information-box').innerHTML = "<div class='no-results big-font'>"+OSRM.loc("NO_RESULTS_FOUND")+": "+parameters.query +"</div>";
},
_showResults_Timeout: function() {
document.getElementById('information-box-header').innerHTML =
"<div class='header-title'>"+OSRM.loc("SEARCH_RESULTS")+"</div>" +
"<div class='header-content'>("+OSRM.loc("FOUND_X_RESULTS").replace(/%i/,0)+")</div>";
document.getElementById('information-box').innerHTML = "<div class='no-results big-font'>"+OSRM.loc("TIMED_OUT")+"</div>";
},
// [reverse geocoding]
//update geo coordinates in input boxes
updateLocation: function(marker_id) {
if (marker_id == OSRM.C.SOURCE_LABEL && OSRM.G.markers.hasSource()) {
document.getElementById("gui-input-source").value = OSRM.G.markers.route[0].getLat().toFixed(6) + ", " + OSRM.G.markers.route[0].getLng().toFixed(6);
} else if (marker_id == OSRM.C.TARGET_LABEL && OSRM.G.markers.hasTarget()) {
document.getElementById("gui-input-target").value = OSRM.G.markers.route[OSRM.G.markers.route.length-1].getLat().toFixed(6) + ", " + OSRM.G.markers.route[OSRM.G.markers.route.length-1].getLng().toFixed(6);
}
},
// update address in input boxes
updateAddress: function(marker_id, do_fallback_to_lat_lng) {
// build request for reverse geocoder
var lat = null;
var lng = null;
if(marker_id == OSRM.C.SOURCE_LABEL && OSRM.G.markers.hasSource()) {
lat = OSRM.G.markers.route[0].getLat();
lng = OSRM.G.markers.route[0].getLng();
} else if(marker_id == OSRM.C.TARGET_LABEL && OSRM.G.markers.hasTarget() ) {
lat = OSRM.G.markers.route[OSRM.G.markers.route.length-1].getLat();
lng = OSRM.G.markers.route[OSRM.G.markers.route.length-1].getLng();
} else
return;
var call = OSRM.DEFAULTS.HOST_REVERSE_GEOCODER_URL + "?format=json&json_callback=%jsonp" + "&accept-language="+OSRM.Localization.current_language + "&lat=" + lat.toFixed(6) + "&lon=" + lng.toFixed(6);
OSRM.JSONP.call( call, OSRM.Geocoder._showReverseResults, OSRM.Geocoder._showReverseResults_Timeout, OSRM.DEFAULTS.JSONP_TIMEOUT, "reverse_geocoder_"+marker_id, {marker_id:marker_id, do_fallback: do_fallback_to_lat_lng} );
},
// processing JSONP response of reverse geocoder
_showReverseResults: function(response, parameters) {
if(!response) {
OSRM.Geocoder._showReverseResults_Timeout(response, parameters);
return;
}
if(response.address == undefined) {
OSRM.Geocoder._showReverseResults_Timeout(response, parameters);
return;
}
// build reverse geocoding address
var used_address_data = 0;
var address = "";
if( response.address.road) {
address += response.address.road;
used_address_data++;
}
if( response.address.city ) {
if( used_address_data > 0 )
address += ", ";
address += response.address.city;
used_address_data++;
} else if( response.address.village ) {
if( used_address_data > 0 )
address += ", ";
address += response.address.village;
used_address_data++;
}
if( used_address_data < 2 && response.address.country ) {
if( used_address_data > 0 )
address += ", ";
address += response.address.country;
used_address_data++;
}
if( used_address_data == 0 ) {
OSRM.Geocoder._showReverseResults_Timeout(response, parameters);
return;
}
// add result to DOM
if(parameters.marker_id == OSRM.C.SOURCE_LABEL && OSRM.G.markers.hasSource() )
document.getElementById("gui-input-source").value = address;
else if(parameters.marker_id == OSRM.C.TARGET_LABEL && OSRM.G.markers.hasTarget() )
document.getElementById("gui-input-target").value = address;
},
_showReverseResults_Timeout: function(response, parameters) {
if(!parameters.do_fallback)
return;
OSRM.Geocoder.updateLocation(parameters.marker_id);
}
};
+193
View File
@@ -0,0 +1,193 @@
/*
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU AFFERO General Public License as published by
the Free Software Foundation; either version 3 of the License, or
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
or see http://www.gnu.org/licenses/agpl.txt.
*/
// OSRM route management (handles drawing of route geometry - current route, old route, unnamed route, highlight unnamed streets)
// [this holds the route geometry]
OSRM.HistoryRoute = function() {
// style and count of history routes
this._history_styles = [{dashed:false, color:'#FFFFFF', opacity:0.5, weight:5},
{dashed:false, color:'#0000DD', opacity:0.45, weight:5},
{dashed:false, color:'#0000BB', opacity:0.40, weight:5},
{dashed:false, color:'#000099', opacity:0.35, weight:5},
{dashed:false, color:'#000077', opacity:0.30, weight:5},
{dashed:false, color:'#000055', opacity:0.25, weight:5},
{dashed:false, color:'#000033', opacity:0.20, weight:5},
{dashed:false, color:'#000011', opacity:0.15, weight:5},
{dashed:false, color:'#000000', opacity:0.10, weight:5}
];
this._history_length = this._history_styles.length;
// actual history data
this._history = [];
for(var i=0, size=this._history_length; i<size; i++) {
var history = {};
history.route = new OSRM.SimpleRoute("current" , {dashed:false} );
history.markers = [];
history.checksum = null;
this._history.push(history);
}
// helper functions bound to this
this._initiate_redrawHistory = OSRM.bind(this, this._getRoute_RedrawHistory);
this._callback_redrawHistory = OSRM.bind(this, this._showRoute_RedrawHistory);
};
OSRM.extend( OSRM.HistoryRoute,{
// switch history routes on/off
activate: function() {
this.storeHistoryRoute = this._storeHistoryRoute;
this.fetchHistoryRoute = this._fetchHistoryRoute;
this.showHistoryRoutes = this._showHistoryRoutes;
this.clearHistoryRoutes = this._clearHistoryRoutes;
OSRM.G.map.on('zoomend', this._initiate_redrawHistory );
this.storeHistoryRoute();
},
deactivate: function() {
this.clearHistoryRoutes();
this.storeHistoryRoute = this.empty;
this.fetchHistoryRoute = this.empty;
this.showHistoryRoutes = this.empty;
this.clearHistoryRoutes = this.empty;
OSRM.G.map.off('zoomend', this._initiate_redrawHistory );
},
// empty function
empty: function() {},
storeHistoryRoute: function() {},
fetchHistoryRoute: function() {},
showHistoryRoutes: function() {},
clearHistoryRoutes: function() {},
// actual functions
_storeHistoryRoute: function() {
var route = OSRM.G.route;
if( !route.isShown() || !route.isRoute() )
return;
// store current route in staging spot
var hint_data = OSRM.G.response.hint_data;
this._history[0].route.setPositions( route.getPositions() );
this._history[0].checksum = hint_data.checksum;
this._history[0].markers = [];
var markers = this._getCurrentMarkers();
for(var i=0,size=markers.length; i<size; i++) {
var position = { lat:markers[i].lat, lng:markers[i].lng, hint:hint_data.locations[i] };
this._history[0].markers.push(position);
}
},
_fetchHistoryRoute: function() {
if( this._history[0].markers.length == 0 )
return;
if( OSRM.G.route.isShown() && this._equalMarkers(this._history[0].markers, this._getCurrentMarkers()) )
return;
if( this._equalMarkers(this._history[0].markers, this._history[1].markers) )
return;
// move all routes down one position
for(var i=this._history_length-1; i>0; i--) {
this._history[i].route.setPositions( this._history[i-1].route.getPositions() ); // copying positions quicker than creating new route!
this._history[i].markers = this._history[i-1].markers;
this._history[i].checksum = this._history[i-1].checksum;
}
// reset staging spot
this._history[0].route.setPositions( [] );
this._history[0].markers = [];
this._history[0].checksum = null;
},
_showHistoryRoutes: function() {
for(var i=1,size=this._history_length; i<size; i++) {
this._history[i].route.setStyle( this._history_styles[i] );
this._history[i].route.show();
OSRM.G.route.hideOldRoute();
}
},
_clearHistoryRoutes: function() {
for(var i=0,size=this._history_length; i<size; i++) {
this._history[i].route.hide();
this._history[i].route.setPositions( [] );
this._history[i].markers = [];
this._history[i].checksum = null;
}
},
// get positions of current markers (data of jsonp response used, as not all data structures up-to-date!)
_getCurrentMarkers: function() {
var route = [];
var positions = OSRM.G.route.getPositions();
if(positions.length == 0)
return route;
for(var i=0; i<OSRM.G.response.via_points.length; i++)
route.push( {lat:OSRM.G.response.via_points[i][0], lng:OSRM.G.response.via_points[i][1]} );
return route;
},
// check if two routes are equivalent by checking their markers
_equalMarkers: function(lhs, rhs) {
if(lhs.length != rhs.length)
return false;
for(var i=0,size=lhs.length; i<size; i++) {
if( lhs[i].lat.toFixed(5) != rhs[i].lat.toFixed(5) || lhs[i].lng.toFixed(5) != rhs[i].lng.toFixed(5) )
return false;
}
return true;
},
// requery history routes
_showRoute_RedrawHistory: function(response, history_id) {
if(!response)
return;
var positions = OSRM.RoutingGeometry._decode(response.route_geometry, 5);
this._history[history_id].route.setPositions(positions);
this._updateHints(response, history_id);
},
_getRoute_RedrawHistory: function() {
for(var i=0,size=this._history_length; i<size; i++)
if( this._history[i].markers.length > 0 ) {
OSRM.JSONP.clear('history'+i);
OSRM.JSONP.call(this._buildCall(i)+'&instructions=false', this._callback_redrawHistory, OSRM.JSONP.empty, OSRM.DEFAULTS.JSONP_TIMEOUT, 'history'+i, i);
}
},
_buildCall: function(history_id) {
var source = OSRM.DEFAULTS.HOST_ROUTING_URL;
source += '?z=' + OSRM.G.map.getZoom() + '&output=json&jsonp=%jsonp&geomformat=cmp';
if(this._history[history_id].checksum)
source += '&checksum=' + this._history[history_id].checksum;
var history_markers = this._history[history_id].markers;
for(var i=0,size=history_markers.length; i<size; i++) {
source += '&loc=' + history_markers[i].lat.toFixed(6) + ',' + history_markers[i].lng.toFixed(6);
if( history_markers[i].hint )
source += '&hint=' + history_markers[i].hint;
}
return source;
},
_updateHints: function(response, history_id) {
this._history[history_id].checksum = response.hint_data.checksum;
var hints = response.hint_data.locations;
for(var i=0; i<hints.length; i++)
this._history[history_id].markers[i].hint = hints[i];
}
});
+107
View File
@@ -0,0 +1,107 @@
/*
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU AFFERO General Public License as published by
the Free Software Foundation; either version 3 of the License, or
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
or see http://www.gnu.org/licenses/agpl.txt.
*/
// OSRM map handling
// [initialization, event handling, centering relative to UI]
// will hold the map object
OSRM.GLOBALS.map = null;
// map controller
// [map initialization, event handling]
OSRM.Map = {
// map initialization
init: function() {
// check if GUI is initialized!
if(OSRM.G.main_handle == null)
OSRM.GUI.init();
// setup tile servers
var tile_servers = OSRM.DEFAULTS.TILE_SERVERS;
var base_maps = {};
for(var i=0, size=tile_servers.length; i<size; i++) {
if( tile_servers[i].bing == true ) {
base_maps[ tile_servers[i].display_name ] = new L.TileLayer.Bing( tile_servers[i].apikey, tile_servers[i].type, tile_servers[i].options );
} else {
tile_servers[i].options.attribution = tile_servers[i].attribution;
base_maps[ tile_servers[i].display_name ] = new L.TileLayer( tile_servers[i].url, tile_servers[i].options );
}
}
// setup map
OSRM.G.map = new OSRM.MapView('map', {
center: new L.LatLng(OSRM.DEFAULTS.ONLOAD_LATITUDE, OSRM.DEFAULTS.ONLOAD_LONGITUDE),
zoom: OSRM.DEFAULTS.ONLOAD_ZOOM_LEVEL,
layers: [base_maps[tile_servers[0].display_name]],
zoomAnimation: false, // remove animations -> routes are not hidden during zoom
fadeAnimation: false
});
// add layer control
var layerControl = new L.Control.QueryableLayers(base_maps, {});
OSRM.G.map.addLayerControl(layerControl);
// move zoom markers
OSRM.Browser.getElementsByClassName(document,'leaflet-control-zoom')[0].style.left=(OSRM.G.main_handle.boxWidth()+10)+"px";
OSRM.Browser.getElementsByClassName(document,'leaflet-control-zoom')[0].style.top="5px";
// map events
OSRM.G.map.on('zoomend', OSRM.Map.zoomed );
OSRM.G.map.on('click', OSRM.Map.click );
OSRM.G.map.on('contextmenu', OSRM.Map.contextmenu );
OSRM.G.map.on('mousemove', OSRM.Map.mousemove );
},
// init map position and zoom (respect UI visibility / use browser geolocation)
initPosition: function() {
var position = new L.LatLng( OSRM.DEFAULTS.ONLOAD_LATITUDE, OSRM.DEFAULTS.ONLOAD_LONGITUDE);
OSRM.G.map.setViewUI( position, OSRM.DEFAULTS.ONLOAD_ZOOM_LEVEL, true);
if (navigator.geolocation && document.URL.indexOf("file://") == -1) // convenience: FF does not save access rights for local files
navigator.geolocation.getCurrentPosition(OSRM.Map.geolocationResponse);
},
// map event handlers
zoomed: function(e) {
if(OSRM.G.dragging)
OSRM.Routing.getRoute_Dragging();
else
OSRM.Routing.getRoute_Redraw();
},
contextmenu: function(e) {;},
mousemove: function(e) { OSRM.Via.drawDragMarker(e); },
click: function(e) {
if( !OSRM.G.markers.hasSource() ) {
var index = OSRM.G.markers.setSource( e.latlng );
OSRM.Geocoder.updateAddress( OSRM.C.SOURCE_LABEL, OSRM.C.DO_FALLBACK_TO_LAT_LNG );
OSRM.G.markers.route[index].show();
OSRM.G.markers.route[index].centerView( OSRM.G.map.getZoom() );
OSRM.Routing.getRoute();
} else if( !OSRM.G.markers.hasTarget() ) {
var index = OSRM.G.markers.setTarget( e.latlng );
OSRM.Geocoder.updateAddress( OSRM.C.TARGET_LABEL, OSRM.C.DO_FALLBACK_TO_LAT_LNG );
OSRM.G.markers.route[index].show();
OSRM.G.markers.route[index].centerView( OSRM.G.map.getZoom() );
OSRM.Routing.getRoute();
}
},
geolocationResponse: function(response) {
var latlng = new L.LatLng(response.coords.latitude, response.coords.longitude);
OSRM.G.map.setViewUI(latlng, OSRM.DEFAULTS.ZOOM_LEVEL );
}
};
+141
View File
@@ -0,0 +1,141 @@
/*
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU AFFERO General Public License as published by
the Free Software Foundation; either version 3 of the License, or
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
or see http://www.gnu.org/licenses/agpl.txt.
*/
// OSRM marker management (all route markers should only be set and deleted with these routines!)
// [this holds the vital information of the route]
OSRM.Markers = function() {
this.route = new Array();
this.highlight = new OSRM.DragMarker("highlight", {draggable:true,icon:OSRM.G.icons['marker-highlight'],dragicon:OSRM.G.icons['marker-highlight-drag']});;
this.dragger = new OSRM.DragMarker("drag", {draggable:true,icon:OSRM.G.icons['marker-drag'],dragicon:OSRM.G.icons['marker-drag']});;
};
OSRM.extend( OSRM.Markers,{
reset: function() {
// remove route markers
for(var i=0; i<this.route.length;i++)
this.route[i].hide();
this.route.splice(0, this.route.length);
document.getElementById('gui-delete-source').style.visibility = "hidden";
document.getElementById('gui-delete-target').style.visibility = "hidden";
// remove special markers
this.highlight.hide();
this.dragger.hide();
},
removeVias: function() {
// assert correct route array s - v - t
for(var i=1; i<this.route.length-1;i++)
this.route[i].hide();
this.route.splice(1, this.route.length-2);
},
setSource: function(position) {
// source node is always first node
if( this.route[0] && this.route[0].label == OSRM.C.SOURCE_LABEL )
this.route[0].setPosition(position);
else
this.route.splice(0,0, new OSRM.RouteMarker(OSRM.C.SOURCE_LABEL, {draggable:true,icon:OSRM.G.icons['marker-source'],dragicon:OSRM.G.icons['marker-source-drag']}, position));
document.getElementById('gui-delete-source').style.visibility = "visible";
return 0;
},
setTarget: function(position) {
// target node is always last node
if( this.route[this.route.length-1] && this.route[ this.route.length-1 ].label == OSRM.C.TARGET_LABEL )
this.route[this.route.length-1].setPosition(position);
else
this.route.splice( this.route.length,0, new OSRM.RouteMarker(OSRM.C.TARGET_LABEL, {draggable:true,icon:OSRM.G.icons['marker-target'],dragicon:OSRM.G.icons['marker-target-drag']}, position));
document.getElementById('gui-delete-target').style.visibility = "visible";
return this.route.length-1;
},
setVia: function(id, position) {
// via nodes only between source and target nodes
if( this.route.length<2 || id > this.route.length-2 )
return -1;
this.route.splice(id+1,0, new OSRM.RouteMarker(OSRM.C.VIA_LABEL, {draggable:true,icon:OSRM.G.icons['marker-via'],dragicon:OSRM.G.icons['marker-via-drag']}, position));
return id+1;
},
removeMarker: function(id) {
if( id >= this.route.length )
return;
// also remove vias if source or target are removed
if( id==0 && this.route[0].label == OSRM.C.SOURCE_LABEL ) {
this.removeVias();
document.getElementById('gui-input-source').value = "";
document.getElementById('information-box').innerHTML = "";
document.getElementById('information-box-header').innerHTML = "";
document.getElementById('gui-delete-source').style.visibility = "hidden";
} else if( id == this.route.length-1 && this.route[ this.route.length-1 ].label == OSRM.C.TARGET_LABEL ) {
this.removeVias();
id = this.route.length-1;
document.getElementById('gui-input-target').value = "";
document.getElementById('information-box').innerHTML = "";
document.getElementById('information-box-header').innerHTML = "";
document.getElementById('gui-delete-target').style.visibility = "hidden";
}
this.route[id].hide();
this.route.splice(id, 1);
},
reverseMarkers: function() {
var size = this.route.length;
// invert route, if a route is shown
if( size > 1 ) {
// switch positions in nodes
var temp_position = this.route[0].getPosition();
this.route[0].setPosition( this.route[size-1].getPosition() );
this.route[size-1].setPosition( temp_position );
// switch nodes in array
var temp_node = this.route[0];
this.route[0] = this.route[size-1];
this.route[size-1] = temp_node;
// reverse route
this.route.reverse();
// clear information (both delete markers stay visible)
document.getElementById('information-box').innerHTML = "";
document.getElementById('information-box-header').innerHTML = "";
// invert marker, if only one marker is shown (implicit clear of information / delete markers)
} else if( size > 0 ) {
var position = this.route[0].getPosition();
var label = this.route[0].label;
this.removeMarker(0);
if( label == OSRM.C.TARGET_LABEL )
this.setSource( position );
else if( label == OSRM.C.SOURCE_LABEL )
this.setTarget( position );
this.route[0].show();
}
},
hasSource: function() {
if( this.route[0] && this.route[0].label == OSRM.C.SOURCE_LABEL )
return true;
return false;
},
hasTarget: function() {
if( this.route[this.route.length-1] && this.route[this.route.length-1].label == OSRM.C.TARGET_LABEL )
return true;
return false;
},
//relabel all via markers
relabelViaMarkers: function() {
for(var i=1, size=this.route.length-1; i<size; i++)
this.route[i].marker.setLabel(i);
}
});
+137
View File
@@ -0,0 +1,137 @@
/*
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU AFFERO General Public License as published by
the Free Software Foundation; either version 3 of the License, or
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
or see http://www.gnu.org/licenses/agpl.txt.
*/
// OSRM route management (handles drawing of route geometry - current route, old route, unnamed route, highlight unnamed streets)
// [this holds the route geometry]
OSRM.Route = function() {
this._current_route = new OSRM.SimpleRoute("current" , {dashed:false} );
this._old_route = new OSRM.SimpleRoute("old", {dashed:false,color:"#123"} );
this._unnamed_route = new OSRM.MultiRoute("unnamed");
this._current_route_style = {dashed:false,color:'#0033FF', weight:5};
this._current_noroute_style = {dashed:true, color:'#222222', weight:2};
this._old_route_style = {dashed:false,color:'#112233', weight:5};
this._old_noroute_style = {dashed:true, color:'#000000', weight:2};
this._unnamed_route_style = {dashed:false, color:'#FF00FF', weight:10};
this._old_unnamed_route_style = {dashed:false, color:'#990099', weight:10};
this._noroute = OSRM.Route.ROUTE;
this._history = new OSRM.HistoryRoute();
};
OSRM.Route.NOROUTE = true;
OSRM.Route.ROUTE = false;
OSRM.extend( OSRM.Route,{
// show/hide route
showRoute: function(positions, noroute) {
this._noroute = noroute;
this._current_route.setPositions( positions );
if ( this._noroute == OSRM.Route.NOROUTE )
this._current_route.setStyle( this._current_noroute_style );
else
this._current_route.setStyle( this._current_route_style );
this._current_route.show();
//this._raiseUnnamedRoute();
this._history.fetchHistoryRoute();
this._history.showHistoryRoutes();
this._history.storeHistoryRoute();
},
hideRoute: function() {
this._current_route.hide();
this._unnamed_route.hide();
this._history.fetchHistoryRoute();
this._history.showHistoryRoutes();
// deactivate printing
OSRM.Printing.deactivate();
},
// show/hide highlighting for unnamed routes
showUnnamedRoute: function(positions) {
this._unnamed_route.clearRoutes();
for(var i=0; i<positions.length; i++) {
this._unnamed_route.addRoute(positions[i]);
}
this._unnamed_route.setStyle( this._unnamed_route_style );
this._unnamed_route.show();
},
hideUnnamedRoute: function() {
this._unnamed_route.hide();
},
// TODO: hack to put unnamed_route above old_route -> easier way in will be available Leaflet 0.4
_raiseUnnamedRoute: function() {
if(this._unnamed_route.isShown()) {
this._unnamed_route.hide();
this._unnamed_route.show();
}
},
// show/hide previous route as shadow
showOldRoute: function() {
this._old_route.setPositions( this._current_route.getPositions() );
if ( this._noroute == OSRM.Route.NOROUTE)
this._old_route.setStyle( this._old_noroute_style );
else
this._old_route.setStyle( this._old_route_style );
this._old_route.show();
this._raiseUnnamedRoute();
// change color of unnamed route highlighting - no separate object as dragged route does not have unnamed route highlighting
this._unnamed_route.setStyle( this._old_unnamed_route_style );
},
hideOldRoute: function() {
this._old_route.hide();
},
// query routines
isShown: function() {
return this._current_route.isShown();
},
isRoute: function() {
return !(this._noroute);
},
getPositions: function() {
return this._current_route.getPositions();
},
getPoints: function() {
return this._current_route.getPoints();
},
// helper routines
reset: function() {
this.hideRoute();
this._old_route.hide();
this._noroute = OSRM.Route.ROUTE;
this._history.clearHistoryRoutes();
},
fire: function(type,event) {
this._current_route.route.fire(type,event);
},
centerView: function() {
this._current_route.centerView();
},
// handle history routes
activateHistoryRoutes: function() {
this._history.activate();
},
deactivateHistoryRoutes: function() {
this._history.deactivate();
}
});
+119
View File
@@ -0,0 +1,119 @@
/*
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU AFFERO General Public License as published by
the Free Software Foundation; either version 3 of the License, or
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
or see http://www.gnu.org/licenses/agpl.txt.
*/
// OSRM via marker routines
// [find correct position for a via marker]
OSRM.Via = {
// find route segment of current route geometry that is closest to the new via node (marked by index of its endpoint)
_findNearestRouteSegment: function( new_via ) {
var min_dist = Number.MAX_VALUE;
var min_index = undefined;
var p = OSRM.G.map.latLngToLayerPoint( new_via );
var positions = OSRM.G.route.getPoints();
for(var i=1; i<positions.length; i++) {
var _sqDist = L.LineUtil._sqClosestPointOnSegment(p, positions[i-1], positions[i], true);
if( _sqDist < min_dist) {
min_dist = _sqDist;
min_index = i;
}
}
return min_index;
},
// find the correct index among all via nodes to insert the new via node, and insert it
findViaIndex: function( new_via_position ) {
// find route segment that is closest to click position (marked by last index)
var nearest_index = OSRM.Via._findNearestRouteSegment( new_via_position );
// find correct index to insert new via node
var via_points = OSRM.G.response.via_points;
var new_via_index = via_points.length-2;
var via_index = Array();
for(var i=1; i<via_points.length-1; i++) {
via_index[i-1] = OSRM.Via._findNearestRouteSegment( new L.LatLng(via_points[i][0], via_points[i][1]) );
if(via_index[i-1] > nearest_index) {
new_via_index = i-1;
break;
}
}
// add via node
return new_via_index;
},
//function that draws a drag marker
dragTimer: new Date(),
drawDragMarker: function(event) {
if( OSRM.G.route.isShown() == false)
return;
if( OSRM.G.dragging == true )
return;
// throttle computation
if( (new Date() - OSRM.Via.dragTimer) < 25 )
return;
OSRM.Via.dragTimer = new Date();
// get distance to route
var minpoint = OSRM.G.route._current_route.route.closestLayerPoint( event.layerPoint );
var min_dist = minpoint ? minpoint._sqDist : 1000;
// get distance to markers
var mouse = event.latlng;
for(var i=0, size=OSRM.G.markers.route.length; i<size; i++) {
if(OSRM.G.markers.route[i].label=='drag')
continue;
var position = OSRM.G.markers.route[i].getPosition();
var dist = OSRM.G.map.project(mouse).distanceTo(OSRM.G.map.project(position));
if( dist < 20 )
min_dist = 1000;
}
// check whether mouse is over another marker
var pos = OSRM.G.map.layerPointToContainerPoint(event.layerPoint);
var obj = document.elementFromPoint(pos.x,pos.y);
for(var i=0, size=OSRM.G.markers.route.length; i<size; i++) {
if(OSRM.G.markers.route[i].label=='drag')
continue;
if( obj == OSRM.G.markers.route[i].marker._icon)
min_dist = 1000;
}
// special care for highlight marker
if( OSRM.G.markers.highlight.isShown() ) {
if( OSRM.G.map.project(mouse).distanceTo(OSRM.G.map.project( OSRM.G.markers.highlight.getPosition() ) ) < 20 )
min_dist = 1000;
else if( obj == OSRM.G.markers.highlight.marker._icon)
min_dist = 1000;
}
if( min_dist < 400) {
OSRM.G.markers.dragger.setPosition( OSRM.G.map.layerPointToLatLng(minpoint) );
OSRM.G.markers.dragger.show();
} else
OSRM.G.markers.dragger.hide();
}
};
+80
View File
@@ -0,0 +1,80 @@
/*
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU AFFERO General Public License as published by
the Free Software Foundation; either version 3 of the License, or
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
or see http://www.gnu.org/licenses/agpl.txt.
*/
// Leaflet bugfixes
// [assorted bugfixes to Leaflet functions we use]
// return closest point on segment or distance to that point
L.LineUtil._sqClosestPointOnSegment = function (p, p1, p2, sqDist) {
var x = p1.x,
y = p1.y,
dx = p2.x - x,
dy = p2.y - y,
dot = dx * dx + dy * dy,
t;
if (dot > 0) {
t = ((p.x - x) * dx + (p.y - y) * dy) / dot;
if (t > 1) {
x = p2.x;
y = p2.y;
} else if (t > 0) {
x += dx * t;
y += dy * t;
}
}
dx = p.x - x;
dy = p.y - y;
// DS_CHANGE: modified return values
if(sqDist)
return dx*dx + dy*dy;
else {
var p = new L.Point(x,y);
p._sqDist = dx*dx + dy*dy;
return p;
}
};
// makes requestAnimFrame respect the immediate paramter -> prevents drag events after dragend events
// (alternatively: add if(!this.dragging ) return to L.Draggable._updatePosition, but must be done in leaflet.js!)
// [TODO: In Leaflet 0.4 use L.Util.cancelAnimFrame(this._animRequest) in L.Draggable._onUp() instead, also has to be done in leaflet.js!]
L.Util.requestAnimFrame = (function () {
function timeoutDefer(callback) {
window.setTimeout(callback, 1000 / 60);
}
var requestFn = window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame ||
timeoutDefer;
return function (callback, context, immediate, contextEl) {
callback = context ? L.Util.bind(callback, context) : callback;
if (immediate ) { // DS_CHANGE: removed additional condition requestFn === timeoutDefer
callback();
} else {
requestFn(callback, contextEl);
}
};
}());
@@ -0,0 +1,47 @@
/*
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU AFFERO General Public License as published by
the Free Software Foundation; either version 3 of the License, or
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
or see http://www.gnu.org/licenses/agpl.txt.
*/
// queryable Layers control
// [simply Control.Layers extended by query functions]
L.Control.QueryableLayers = L.Control.Layers.extend({
getActiveLayerName: function () {
var i, input, obj,
inputs = this._form.getElementsByTagName('input'),
inputsLen = inputs.length;
for (i = 0; i < inputsLen; i++) {
input = inputs[i];
obj = this._layers[input.layerId];
if (input.checked && !obj.overlay) {
return obj.name;
}
}
},
getActiveLayer: function () {
var i, input, obj,
inputs = this._form.getElementsByTagName('input'),
inputsLen = inputs.length;
for (i = 0; i < inputsLen; i++) {
input = inputs[i];
obj = this._layers[input.layerId];
if (input.checked && !obj.overlay) {
return obj.layer;
}
}
}
});
@@ -0,0 +1,60 @@
/*
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU AFFERO General Public License as published by
the Free Software Foundation; either version 3 of the License, or
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
or see http://www.gnu.org/licenses/agpl.txt.
*/
// Leaflet extension: Dashed Polyline
// [adds dashed optionally dashed lines when using SVG or VML rendering]
// dashed polyline class
L.DashedPolyline = L.Polyline.extend({
initialize: function(latlngs, options) {
L.Polyline.prototype.initialize.call(this, latlngs, options);
},
options: {
dashed: true
}
});
// svg rendering
L.DashedPolyline = !L.Browser.svg ? L.DashedPolyline : L.DashedPolyline.extend({
_updateStyle: function () {
L.Polyline.prototype._updateStyle.call(this);
if (this.options.stroke) {
if (this.options.dashed == true)
this._path.setAttribute('stroke-dasharray', '8,6');
else
this._path.setAttribute('stroke-dasharray', '');
}
}
});
// vml rendering
L.DashedPolyline = L.Browser.svg || !L.Browser.vml ? L.DashedPolyline : L.DashedPolyline.extend({
_updateStyle: function () {
L.Polyline.prototype._updateStyle.call(this);
if (this.options.stroke) {
if (this.options.dashed == true)
this._stroke.dashstyle = "dash";
else
this._stroke.dashstyle = "solid";
}
}
});
+72
View File
@@ -0,0 +1,72 @@
/*
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU AFFERO General Public License as published by
the Free Software Foundation; either version 3 of the License, or
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
or see http://www.gnu.org/licenses/agpl.txt.
*/
// Leaflet extension: MouseMarker
// [marker class that propagates modifier and button presses in mouse click events and allows for changing icons]
// extended marker class
L.MouseMarker = L.Marker.extend({
initialize: function (latlng, options) {
L.Marker.prototype.initialize.apply(this, arguments);
},
switchIcon: function( icon ) {
this.options.icon = icon;
if (this._map) {
this._changeIcon();
this._reset();
}
},
setLabel: function( label ) {
if(this._icon) {
this._icon.lastChild.innerHTML=label;
this._icon.lastChild.style.display = "block";
}
},
_changeIcon: function () {
var options = this.options;
if (this._icon) {
this._icon = options.icon.switchIcon( this._icon );
if (this.options.clickable) // TODO: only needed until Leaflet 0.4
this._icon.className += ' leaflet-clickable';
}
var panes = this._map._panes;
if (this._shadow)
panes.shadowPane.removeChild(this._shadow);
this._shadow = options.icon.createShadow();
if (this._shadow)
panes.shadowPane.appendChild(this._shadow);
},
_onMouseClick: function (e) {
L.DomEvent.stopPropagation(e);
if (this.dragging && this.dragging.moved()) { return; }
this.fire(e.type, {
altKey: e.altKey,
ctrlKey: e.ctrlKey,
shiftKey: e.shiftKey,
button: e.button
});
}
});
+123
View File
@@ -0,0 +1,123 @@
/*
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU AFFERO General Public License as published by
the Free Software Foundation; either version 3 of the License, or
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
or see http://www.gnu.org/licenses/agpl.txt.
*/
// Leaflet extension: SwitchableIcon
// [will be an extension of L.Icon in Leaflet 0.4, for now it is a copy with added functionality]
// icon class with functions to simply switch the icon images
L.SwitchableIcon = L.Class.extend({
options: {
/*
iconUrl: (String) (required)
iconSize: (Point) (can be set through CSS)
iconAnchor: (Point) (centered by default if size is specified, can be set in CSS with negative margins)
popupAnchor: (Point) (if not specified, popup opens in the anchor point)
shadowUrl: (Point) (no shadow by default)
shadowSize: (Point)
*/
className: ''
},
initialize: function (options) {
L.Util.setOptions(this, options);
},
createIcon: function () {
return this._createIcon('icon');
},
createShadow: function () {
return this.options.shadowUrl ? this._createIcon('shadow') : null;
},
_createIcon: function (name) {
var img = this._createImg(this.options[name + 'Url']);
this._setIconStyles(img, name);
return img;
},
_setIconStyles: function (img, name) {
var options = this.options,
size = options[name + 'Size'],
anchor = options.iconAnchor;
if (!anchor && size) {
anchor = size.divideBy(2, true);
}
if (name === 'shadow' && anchor && options.shadowOffset) {
anchor._add(options.shadowOffset);
}
img.className = 'leaflet-marker-' + name + ' ' + options.className;
if (anchor) {
img.style.marginLeft = (-anchor.x) + 'px';
img.style.marginTop = (-anchor.y) + 'px';
}
if (size) {
img.style.width = size.x + 'px';
img.style.height = size.y + 'px';
}
},
_createImg: function (src) {
var el;
if (!L.Browser.ie6) {
el = document.createElement('div');
var img = document.createElement('img');
var num = document.createElement('div');
img.src = src;
num.className = 'via-counter';
num.innerHTML = "";
el.appendChild(img);
el.appendChild(num);
} else {
el = document.createElement('div');
el.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' + src + '")';
}
return el;
},
// new functions start here
switchIcon: function (el) {
return this._switchIcon('icon', el);
},
switchShadow: function (el) {
return this.options.shadowUrl ? this._switchIcon('shadow', el) : null;
},
_switchIcon: function (name, el) {
var img = this._switchImg(this.options[name + 'Url'], el);
this._setIconStyles(img, name);
return img;
},
_switchImg: function (src, el) {
if (!L.Browser.ie6) {
el.firstChild.src = src;
} else {
el.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' + src + '")';
}
return el;
}
});
+191
View File
@@ -0,0 +1,191 @@
/*
* Portions of this code and logic copied from OpenLayers and
* redistributed under the original Clear BSD license terms:
*
* http://trac.osgeo.org/openlayers/browser/license.txt
*
* Copyright 2005-2010 OpenLayers Contributors, released under
* the Clear BSD license. See authors.txt for a list of contributors.
* All rights reserved.
*
* --
*
* Leaflet-specific modifications are released under the following
* terms:
*
* This program is free software. It comes without any warranty, to
* the extent permitted by applicable law. You can redistribute it
* and/or modify it under the terms of the Do What The Fuck You Want
* To Public License, Version 2, as published by Sam Hocevar. See
* http://sam.zoy.org/wtfpl/COPYING for more details.
*/
L.TileLayer.Bing = L.TileLayer.extend({
supportedTypes: ['Road', 'Aerial', 'AerialWithLabels'],
attributionTemplate: '<span style="display:inline-block">' +
'<a target="_blank" href="http://www.bing.com/maps/">' +
//'<img src="{logo}" /></a><br><span>{copyrights}' +
'</a><span>{copyrights}' +
'<a style="white-space: nowrap" target="_blank" '+
'href="http://www.microsoft.com/maps/product/terms.html">' +
'Terms of Use</a></span></span>',
supportedCultures: {"en":"en-US", "de":"de-DE", "fr":"fr-FR", "it":"it-IT", "es":"es-ES", "nl":"nl-BE"},
initialize: function(/*String*/ apiKey, /*String*/ mapType, /*Object*/ options) {
this._apiKey = apiKey;
this._mapType = mapType;
this._loadMetadata();
L.Util.setOptions(this, options);
},
redraw: function() {
this._reset();
this._update();
},
_loadMetadata: function() {
this._callbackId = "_l_tilelayer_bing_" + (L.TileLayer.Bing._callbackId++);
var that = this;
window[this._callbackId] = function() {
L.TileLayer.Bing.processMetadata.apply(that, arguments);
};
var params = {
key: this._apiKey,
jsonp: this._callbackId,
include: 'ImageryProviders'
},
url = "http://dev.virtualearth.net/REST/v1/Imagery/Metadata/" +
this._mapType + L.Util.getParamString(params),
script = document.createElement("script");
script.type = "text/javascript";
script.src = url;
script.id = this._callbackId;
document.getElementsByTagName("head")[0].appendChild(script);
},
_onMetadataLoaded: function() {},
onAdd: function(map, insertAtTheBottom) {
if (!this.metadata) {
this._onMetadataLoaded = L.Util.bind(function() {
L.TileLayer.prototype.onAdd.call(this, map, insertAtTheBottom);
map.on('moveend', this._updateAttribution, this);
this._updateAttribution();
}, this);
} else {
L.TileLayer.prototype.onAdd.call(this, map, insertAtTheBottom);
map.on('moveend', this._updateAttribution, this);
this._updateAttribution();
}
},
onRemove: function(map) {
if (this._map.attributionControl) {
this._map.attributionControl.removeAttribution(this.attribution);
}
this._map.off('moveend', this._updateAttribution, this);
L.TileLayer.prototype.onRemove.call(this, map);
},
getTileUrl: function(xy, z) {
var subdomains = this.options.subdomains,
quadDigits = [],
i = z,
digit,
mask,
quadKey;
// borrowed directly from OpenLayers
for (; i > 0; --i) {
digit = '0';
mask = 1 << (i - 1);
if ((xy.x & mask) != 0) {
digit++;
}
if ((xy.y & mask) != 0) {
digit++;
digit++;
}
quadDigits.push(digit);
}
return this._url
.replace('{culture}', this.supportedCultures[OSRM.Localization.current_language] || "en-US" )
.replace('{subdomain}', subdomains[(xy.x + xy.y) % subdomains.length])
.replace('{quadkey}', quadDigits.join(""));
},
_updateAttribution: function() {
if (this._map.attributionControl) {
var metadata = this.metadata;
var res = metadata.resourceSets[0].resources[0];
var bounds = this._map.getBounds();
var providers = res.imageryProviders, zoom = this._map.getZoom() + 1,
copyrights = "", provider, i, ii, j, jj, bbox, coverage;
for (i=0,ii=providers.length; i<ii; ++i) {
provider = providers[i];
for (j=0,jj=provider.coverageAreas.length; j<jj; ++j) {
coverage = provider.coverageAreas[j];
if (zoom <= coverage.zoomMax && zoom >= coverage.zoomMin && coverage.bbox.intersects(bounds)) {
copyrights += provider.attribution + " ";
j = jj;
}
}
}
this._map.attributionControl.removeAttribution(this.attribution);
this._map.attributionControl._attributions = {};
this._map.attributionControl._update();
this.attribution = this.attributionTemplate
.replace('{logo}', metadata.brandLogoUri)
.replace('{copyrights}', copyrights);
this._map.attributionControl.addAttribution(this.attribution);
}
}
});
L.TileLayer.Bing._callbackId = 0;
L.TileLayer.Bing.processMetadata = function(metadata) {
if (metadata.authenticationResultCode != 'ValidCredentials') {
throw "Invalid Bing Maps API Key"
}
if (!metadata.resourceSets.length || !metadata.resourceSets[0].resources.length) {
throw "No resources returned, perhaps " + this._mapType + " is an invalid map type?";
}
if (metadata.statusCode != 200) {
throw "Bing Maps API request failed with status code " + metadata.statusCode;
}
this.metadata = metadata;
var res = metadata.resourceSets[0].resources[0],
providers = res.imageryProviders,
i = 0,
j,
provider,
bbox,
script = document.getElementById(this._callbackId);
for (; i<providers.length; i++) {
provider = providers[i];
for (j=0; j<provider.coverageAreas.length; j++) {
bbox = provider.coverageAreas[j].bbox;
provider.coverageAreas[j].bbox = new L.LatLngBounds(new L.LatLng(bbox[0],bbox[1],true),new L.LatLng(bbox[2],bbox[3], true));
}
}
this._url = res.imageUrl;
this.options.subdomains = [].concat(res.imageUrlSubdomains);
script.parentNode.removeChild(script);
window[this._callbackId] = undefined; // cannot delete from window in IE
delete this._callbackId;
this._onMetadataLoaded();
}
+83
View File
@@ -0,0 +1,83 @@
/*
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU AFFERO General Public License as published by
the Free Software Foundation; either version 3 of the License, or
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
or see http://www.gnu.org/licenses/agpl.txt.
*/
// map view/model
// [extending Leaflet L.Map with setView/fitBounds methods that respect UI visibility, better layerControl]
OSRM.MapView = L.Map.extend({
setViewUI: function(position, zoom, no_animation) {
if( OSRM.G.main_handle.boxVisible() ) {
var point = this.project( position, zoom);
point.x-=OSRM.G.main_handle.boxWidth()/2;
position = this.unproject(point,zoom);
}
this.setView( position, zoom, no_animation);
},
fitBoundsUI: function(bounds) {
var southwest = bounds.getSouthWest();
var northeast = bounds.getNorthEast();
var zoom = this.getBoundsZoom(bounds);
var sw_point = this.project( southwest, zoom);
if( OSRM.G.main_handle.boxVisible() )
sw_point.x-=OSRM.G.main_handle.boxWidth()+20;
else
sw_point.x-=20;
sw_point.y+=20;
var ne_point = this.project( northeast, zoom);
ne_point.y-=20;
ne_point.x+=20;
bounds.extend( this.unproject(sw_point,zoom) );
bounds.extend( this.unproject(ne_point,zoom) );
this.fitBounds( bounds );
},
getBoundsUI: function(unbounded) {
var bounds = this.getPixelBounds();
if( OSRM.G.main_handle.boxVisible() )
bounds.min.x+=OSRM.G.main_handle.boxWidth();
var sw = this.unproject(new L.Point(bounds.min.x, bounds.max.y), this._zoom, true),
ne = this.unproject(new L.Point(bounds.max.x, bounds.min.y), this._zoom, true);
return new L.LatLngBounds(sw, ne);
},
getCenterUI: function(unbounded) {
var viewHalf = this.getSize();
if( OSRM.G.main_handle.boxVisible() )
viewHalf.x += OSRM.G.main_handle.boxWidth();
var centerPoint = this._getTopLeftPoint().add(viewHalf.divideBy(2));
return this.unproject(centerPoint, this._zoom, unbounded);
},
addLayerControl: function( layerControl ) {
if( this.layerControl )
return;
this.layerControl = layerControl;
this.addControl(this.layerControl);
},
getActiveLayerId: function() {
var tile_server_id = 0;
var tile_servers = OSRM.DEFAULTS.TILE_SERVERS;
var tile_server_name = this.layerControl.getActiveLayerName();
for(var i=0, size=tile_servers.length; i<size; i++) {
if( tile_servers[i].display_name == tile_server_name ) {
tile_server_id = i;
break;
}
}
return tile_server_id;
}
});
+166
View File
@@ -0,0 +1,166 @@
/*
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU AFFERO General Public License as published by
the Free Software Foundation; either version 3 of the License, or
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
or see http://www.gnu.org/licenses/agpl.txt.
*/
// OSRM markers
// [base marker class, derived highlight marker and route marker classes]
// base marker class (wraps Leaflet markers)
OSRM.Marker = function( label, style, position ) {
this.label = label ? label : "marker";
this.position = position ? position : new L.LatLng(0,0);
this.marker = new L.MouseMarker( this.position, style );
this.marker.parent = this;
this.shown = false;
this.hint = null;
};
OSRM.extend( OSRM.Marker,{
show: function() {
OSRM.G.map.addLayer(this.marker);
this.shown = true;
},
hide: function() {
OSRM.G.map.removeLayer(this.marker);
this.shown = false;
},
setPosition: function( position ) {
this.position = position;
this.marker.setLatLng( position );
this.hint = null;
},
getPosition: function() {
return this.position;
},
getLat: function() {
return this.position.lat;
},
getLng: function() {
return this.position.lng;
},
isShown: function() {
return this.shown;
},
centerView: function(zoom) {
if( zoom == undefined )
zoom = OSRM.DEFAULTS.ZOOM_LEVEL;
OSRM.G.map.setViewUI( this.position, zoom );
},
toString: function() {
return "OSRM.Marker: \""+this.label+"\", "+this.position+")";
}
});
// route marker class (draggable, invokes route drawing routines)
OSRM.RouteMarker = function ( label, style, position ) {
style.baseicon = style.icon;
OSRM.RouteMarker.prototype.base.constructor.apply( this, arguments );
this.label = label ? label : "route_marker";
this.marker.on( 'click', this.onClick );
this.marker.on( 'drag', this.onDrag );
this.marker.on( 'dragstart', this.onDragStart );
this.marker.on( 'dragend', this.onDragEnd );
};
OSRM.inheritFrom( OSRM.RouteMarker, OSRM.Marker );
OSRM.extend( OSRM.RouteMarker, {
onClick: function(e) {
for( var i=0; i<OSRM.G.markers.route.length; i++) {
if( OSRM.G.markers.route[i].marker === this ) {
OSRM.G.markers.removeMarker( i );
break;
}
}
OSRM.Routing.getRoute();
OSRM.G.markers.highlight.hide();
OSRM.G.markers.dragger.hide();
},
onDrag: function(e) {
this.parent.setPosition( e.target.getLatLng() );
if(OSRM.G.markers.route.length>1)
OSRM.Routing.getRoute_Dragging();
OSRM.Geocoder.updateLocation( this.parent.label );
},
onDragStart: function(e) {
OSRM.G.dragging = true;
this.switchIcon(this.options.dragicon);
// store id of dragged marker
for( var i=0; i<OSRM.G.markers.route.length; i++)
if( OSRM.G.markers.route[i].marker === this ) {
OSRM.G.dragid = i;
break;
}
if( this.parent != OSRM.G.markers.highlight)
OSRM.G.markers.highlight.hide();
if( this.parent != OSRM.G.markers.dragger)
OSRM.G.markers.dragger.hide();
if (OSRM.G.route.isShown())
OSRM.G.route.showOldRoute();
},
onDragEnd: function(e) {
OSRM.G.dragging = false;
this.switchIcon(this.options.baseicon);
this.parent.setPosition( e.target.getLatLng() );
if (OSRM.G.route.isShown()) {
OSRM.Routing.getRoute();
OSRM.G.route.hideOldRoute();
OSRM.G.route.hideUnnamedRoute();
} else {
OSRM.Geocoder.updateAddress(this.parent.label);
OSRM.GUI.clearResults();
}
},
toString: function() {
return "OSRM.RouteMarker: \""+this.label+"\", "+this.position+")";
}
});
//drag marker class (draggable, invokes route drawing routines)
OSRM.DragMarker = function ( label, style, position ) {
OSRM.DragMarker.prototype.base.constructor.apply( this, arguments );
this.label = label ? label : "drag_marker";
};
OSRM.inheritFrom( OSRM.DragMarker, OSRM.RouteMarker );
OSRM.extend( OSRM.DragMarker, {
onClick: function(e) {
if( this.parent != OSRM.G.markers.dragger)
this.parent.hide();
},
onDragStart: function(e) {
var new_via_index = OSRM.Via.findViaIndex( e.target.getLatLng() );
OSRM.G.markers.route.splice(new_via_index+1,0, this.parent );
OSRM.RouteMarker.prototype.onDragStart.call(this,e);
},
onDragEnd: function(e) {
OSRM.G.markers.route[OSRM.G.dragid] = new OSRM.RouteMarker(OSRM.C.VIA_LABEL, {draggable:true,icon:OSRM.G.icons['marker-via'],dragicon:OSRM.G.icons['marker-via-drag']}, e.target.getLatLng() );
OSRM.G.markers.route[OSRM.G.dragid].show();
OSRM.RouteMarker.prototype.onDragEnd.call(this,e);
this.parent.hide();
},
toString: function() {
return "OSRM.DragMarker: \""+this.label+"\", "+this.position+")";
}
});
+98
View File
@@ -0,0 +1,98 @@
/*
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU AFFERO General Public License as published by
the Free Software Foundation; either version 3 of the License, or
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
or see http://www.gnu.org/licenses/agpl.txt.
*/
// OSRM routes
// [drawing of all types of route geometry]
// simple route class (wraps Leaflet Polyline)
OSRM.SimpleRoute = function (label, style) {
this.label = (label ? label : "route");
this.route = new L.DashedPolyline();
this.route.setLatLngs( [] );
if(style) this.route.setStyle( style );
this.shown = false;
};
OSRM.extend( OSRM.SimpleRoute,{
show: function() {
OSRM.G.map.addLayer(this.route);
this.shown = true;
},
hide: function() {
OSRM.G.map.removeLayer(this.route);
this.shown = false;
},
isShown: function() {
return this.shown;
},
getPoints: function() {
return this.route._originalPoints;
},
getPositions: function() {
return this.route.getLatLngs();
},
setPositions: function(positions) {
this.route.setLatLngs( positions );
},
setStyle: function(style) {
this.route.setStyle(style);
},
centerView: function() {
var bounds = new L.LatLngBounds( this.getPositions() );
OSRM.g.map.fitBoundsUI( bounds );
},
toString: function() {
return "OSRM.Route("+ this.label + ", " + this.route.getLatLngs().length + " points)";
}
});
// multiroute class (wraps Leaflet LayerGroup to hold several disjoint routes)
OSRM.MultiRoute = function (label) {
this.label = (label ? label : "multiroute");
this.route = new L.LayerGroup();
this.shown = false;
};
OSRM.extend( OSRM.MultiRoute,{
show: function() {
OSRM.G.map.addLayer(this.route);
this.shown = true;
},
hide: function() {
OSRM.G.map.removeLayer(this.route);
this.shown = false;
},
isShown: function() {
return this.shown;
},
addRoute: function(positions) {
var line = new L.DashedPolyline( positions );
line.on('click', function(e) { OSRM.G.route.fire('click',e); });
this.route.addLayer( line );
},
clearRoutes: function() {
this.route.clearLayers();
},
setStyle: function(style) {
this.route.invoke('setStyle', style);
},
toString: function() {
return "OSRM.MultiRoute("+ this.label + ")";
}
});
Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

+44
View File
@@ -0,0 +1,44 @@
/*
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU AFFERO General Public License as published by
the Free Software Foundation; either version 3 of the License, or
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
or see http://www.gnu.org/licenses/agpl.txt.
*/
// OSRM GUI
// [base GUI class, all other GUI modules extend this class]
OSRM.GUI = {
// initialization functions of all GUI parts
init_functions: [],
// init GUI
init: function() {
for(var i=0, size=OSRM.GUI.init_functions.length; i<size; i++) {
OSRM.GUI.init_functions[i]();
}
},
//extend GUI class and add init functions to the array
extend: function( properties ) {
for( property in properties ) {
if( property == 'init' )
OSRM.GUI.init_functions.push( properties[property] );
else
OSRM.GUI[property] = properties[property];
}
}
};
+53
View File
@@ -0,0 +1,53 @@
/*
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU AFFERO General Public License as published by
the Free Software Foundation; either version 3 of the License, or
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
or see http://www.gnu.org/licenses/agpl.txt.
*/
// OSRM MainGUI
// [handles all GUI events that interact with appearance of main window]
// OSRM GUIBoxGroup
// [group UI boxes so that handles can be shown/hidden together]
OSRM.GUIBoxGroup = function() {
this._handles = [];
};
OSRM.extend( OSRM.GUIBoxGroup, {
add: function( handle ) {
this._handles.push( handle );
handle.$addToGroup(this);
},
select: function( handle ) {
for(var i=0; i< this._handles.length; i++) {
if( this._handles[i] != handle )
this._handles[i].$hideBox();
else
this._handles[i].$showBox();
}
},
$hide: function() {
for(var i=0; i< this._handles.length; i++) {
this._handles[i].$hide();
}
},
$show: function() {
for(var i=0; i< this._handles.length; i++) {
this._handles[i].$show();
}
}
});
+128
View File
@@ -0,0 +1,128 @@
/*
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU AFFERO General Public License as published by
the Free Software Foundation; either version 3 of the License, or
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
or see http://www.gnu.org/licenses/agpl.txt.
*/
// OSRM GUIBoxHandle
// [performs showing and hiding of UI boxes]
OSRM.GUIBoxHandle = function( box_name, side, css, transitionStartFct, transitionEndFct ) {
// do not create handle if box does not contain a toggle button
var toggle = document.getElementById( box_name + '-toggle');
if( toggle == null ) {
console.log("[error] No toggle button for " + box_name);
return;
}
// create handle DOM elements
var wrapper = document.createElement('div');
wrapper.id = box_name + '-handle-wrapper';
wrapper.className = 'not-selectable box-wrapper box-handle-wrapper-'+side;
wrapper.style.cssText += css;
var content = document.createElement('div');
content.id = box_name + '-handle-content';
content.className = 'box-content box-handle-content-'+side;
var icon = document.createElement('div');
icon.id = box_name + '-handle-icon';
icon.className = 'iconic-button';
content.appendChild(icon);
wrapper.appendChild(content);
document.body.appendChild(wrapper);
// create attributes
this._box = document.getElementById( box_name + '-wrapper' );
this._class = this._box.className;
this._width = this._box.clientWidth;
this._side = side;
this._handle = wrapper;
this._box_group = null;
this._transitionEndFct = transitionEndFct;
// hide box and show handle by default
this._box.style[this._side]=-this._width+"px";
this._box_visible = false;
this._handle.style.visibility="visible";
// add functionality
var full_fct = transitionStartFct ? OSRM.concat(this._toggle, transitionStartFct) : this._toggle;
var fct = OSRM.bind( this, full_fct );
toggle.onclick = fct;
icon.onclick = fct;
var full_fct = transitionEndFct ? OSRM.concat(this._onTransitionEnd, transitionEndFct) : this._onTransitionEnd;
var fct = OSRM.bind( this, full_fct );
if( OSRM.Browser.FF3==-1 && OSRM.Browser.IE6_9==-1 ) {
var box_wrapper = document.getElementById(box_name + '-wrapper');
box_wrapper.addEventListener("transitionend", fct, false);
box_wrapper.addEventListener("webkitTransitionEnd", fct, false);
box_wrapper.addEventListener("oTransitionEnd", fct, false);
box_wrapper.addEventListener("MSTransitionEnd", fct, false);
} else {
this._legacyTransitionEndFct = fct; // legacy browser support
}
};
OSRM.extend( OSRM.GUIBoxHandle, {
boxVisible: function() {
return this._box_visible;
},
boxWidth: function() {
return this._width;
},
$addToGroup: function(group) {
this._box_group = group;
},
$show: function() {
this._handle.style.visibility="visible";
},
$hide: function() {
this._handle.style.visibility="hidden";
},
$showBox: function() {
this._box_visible = true;
this._handle.style.visibility="hidden";
this._box.style[this._side]="5px";
this._transitionEndFct();
},
$hideBox: function() {
this._box_visible = false;
this._handle.style.visibility="visible";
this._box.style[this._side]=-this._width+"px";
},
_toggle: function() {
this._box.className += " box-animated";
if( this._box_visible == false ) {
this._box_group.$hide();
this._box.style[this._side]="5px";
} else {
this._box.style[this._side]=-this._width+"px";
}
// legacy browser support
if( OSRM.Browser.FF3!=-1 || OSRM.Browser.IE6_9!=-1 )
setTimeout(this._legacyTransitionEndFct, 0);
},
_onTransitionEnd: function() {
this._box.className = this._class;
if( this._box_visible == true ) {
this._box_group.$show();
this._box_visible = false;
} else {
this._box_visible = true;
}
}
});
+115
View File
@@ -0,0 +1,115 @@
/*
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU AFFERO General Public License as published by
the Free Software Foundation; either version 3 of the License, or
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
or see http://www.gnu.org/licenses/agpl.txt.
*/
// OSRM MainGUI
// [handles all GUI events that interact with appearance of main window]
OSRM.GUI.extend( {
// init GUI
init: function() {
// init main box
var main_group = new OSRM.GUIBoxGroup();
OSRM.G.main_handle = new OSRM.GUIBoxHandle("main", "left", "left:-5px;top:5px;", OSRM.GUI.beforeMainTransition, OSRM.GUI.afterMainTransition);
main_group.add( OSRM.G.main_handle );
main_group.select( OSRM.G.main_handle );
// init additional boxes
var option_group = new OSRM.GUIBoxGroup();
var config_handle = new OSRM.GUIBoxHandle("config", "right", "right:-5px;bottom:70px;");
var mapping_handle = new OSRM.GUIBoxHandle("mapping", "right", "right:-5px;bottom:25px;");
option_group.add( config_handle );
option_group.add( mapping_handle );
option_group.select( null );
// init starting source/target
document.getElementById('gui-input-source').value = OSRM.DEFAULTS.ONLOAD_SOURCE;
document.getElementById('gui-input-target').value = OSRM.DEFAULTS.ONLOAD_TARGET;
// init units selector
OSRM.GUI.selectorInit( "gui-units-toggle", [{display:"Kilometers",value:0},{display:"Miles",value:1}], 0, OSRM.GUI.onUnitsChanged );
// query last update of data
OSRM.G.data_timestamp = "n/a";
OSRM.JSONP.call(OSRM.DEFAULTS.HOST_TIMESTAMP_URL+"?jsonp=%jsonp", OSRM.GUI.setDataTimestamp, OSRM.JSONP.empty, OSRM.DEFAULTS.JSONP_TIMEOUT, 'data_timestamp');
},
// set language dependent labels
setLabels: function() {
document.getElementById("open-josm").innerHTML = OSRM.loc("OPEN_JOSM");
document.getElementById("open-osmbugs").innerHTML = OSRM.loc("OPEN_OSMBUGS");
document.getElementById("gui-reset").innerHTML = OSRM.loc("GUI_RESET");
document.getElementById("gui-reverse").innerHTML = OSRM.loc("GUI_REVERSE");
document.getElementById("gui-option-highlight-nonames-label").innerHTML = OSRM.loc("GUI_HIGHLIGHT_UNNAMED_ROADS");
document.getElementById("gui-option-show-previous-routes-label").innerHTML = OSRM.loc("GUI_SHOW_PREVIOUS_ROUTES");
document.getElementById("gui-search-source").innerHTML = OSRM.loc("GUI_SEARCH");
document.getElementById("gui-search-target").innerHTML = OSRM.loc("GUI_SEARCH");
document.getElementById("gui-search-source-label").innerHTML = OSRM.loc("GUI_START")+":";
document.getElementById("gui-search-target-label").innerHTML = OSRM.loc("GUI_END")+":";
document.getElementById("gui-input-source").title = OSRM.loc("GUI_START_TOOLTIP");
document.getElementById("gui-input-target").title = OSRM.loc("GUI_END_TOOLTIP");
document.getElementById("legal-notice").innerHTML = OSRM.loc("GUI_LEGAL_NOTICE");
document.getElementById("gui-mapping-label").innerHTML = OSRM.loc("GUI_MAPPING_TOOLS");
document.getElementById("gui-config-label").innerHTML = OSRM.loc("GUI_CONFIGURATION");
document.getElementById("gui-language-2-label").innerHTML = OSRM.loc("GUI_LANGUAGE")+":";
document.getElementById("gui-units-label").innerHTML = OSRM.loc("GUI_UNITS")+":";
document.getElementById('gui-data-timestamp').innerHTML = OSRM.loc("GUI_DATA_TIMESTAMP")+": " + OSRM.G.data_timestamp;
document.getElementById("gui-units-toggle").getElementsByTagName("option")[0].innerHTML = OSRM.loc("GUI_KILOMETERS");
document.getElementById("gui-units-toggle").getElementsByTagName("option")[1].innerHTML = OSRM.loc("GUI_MILES");
OSRM.GUI.selectorOnChange( document.getElementById("gui-units-toggle") );
},
// clear output area
clearResults: function() {
document.getElementById('information-box').innerHTML = "";
document.getElementById('information-box-header').innerHTML = "";
},
// reposition and hide zoom controls before main box animation
beforeMainTransition: function() {
var zoom_controls = OSRM.Browser.getElementsByClassName(document,'leaflet-control-zoom');
if( zoom_controls.length > 0)
zoom_controls[0].style.visibility="hidden";
},
// show zoom controls after main box animation
afterMainTransition: function() {
var zoom_controls = OSRM.Browser.getElementsByClassName(document,'leaflet-control-zoom');
if( zoom_controls.length > 0) {
zoom_controls[0].style.left = ( OSRM.G.main_handle.boxVisible() == true ? (OSRM.G.main_handle.boxWidth()+10) : "30") + "px";
zoom_controls[0].style.visibility="visible";
}
},
// toggle distance units
onUnitsChanged: function(value) {
OSRM.Utils.setToHumanDistanceFunction(value);
OSRM.Routing.getRoute();
},
// set timestamp of data
setDataTimestamp: function(response) {
if(!response)
return;
OSRM.G.data_timestamp = response.timestamp.slice(0,25).replace(/<\/?[^>]+(>|$)/g ,""); // discard tags
document.getElementById('gui-data-timestamp').innerHTML = OSRM.loc("GUI_DATA_TIMESTAMP")+": " + OSRM.G.data_timestamp;
}
});
+149
View File
@@ -0,0 +1,149 @@
/*
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU AFFERO General Public License as published by
the Free Software Foundation; either version 3 of the License, or
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
or see http://www.gnu.org/licenses/agpl.txt.
*/
// OSRM RoutingGUI
// [handles all GUI events that interact with routing in main window]
OSRM.GUI.extend( {
// init
init: function() {
// init variables
OSRM.Utils.setToHumanDistanceFunction(OSRM.DEFAULTS.DISTANCE_FORMAT);
// init events
document.getElementById("gui-input-source").onchange = function() {OSRM.GUI.inputChanged(OSRM.C.SOURCE_LABEL);};
document.getElementById("gui-delete-source").onclick = function() {OSRM.GUI.deleteMarker(OSRM.C.SOURCE_LABEL);};
document.getElementById("gui-search-source").onclick = function() {OSRM.GUI.showMarker(OSRM.C.SOURCE_LABEL);};
document.getElementById("gui-input-target").onchange = function() {OSRM.GUI.inputChanged(OSRM.C.TARGET_LABEL);};
document.getElementById("gui-delete-target").onclick = function() {OSRM.GUI.deleteMarker(OSRM.C.TARGET_LABEL);};
document.getElementById("gui-search-target").onclick = function() {OSRM.GUI.showMarker(OSRM.C.TARGET_LABEL);};
document.getElementById("gui-reset").onclick = OSRM.GUI.resetRouting;
document.getElementById("gui-reverse").onclick = OSRM.GUI.reverseRouting;
document.getElementById("open-josm").onclick = OSRM.GUI.openJOSM;
document.getElementById("open-osmbugs").onclick = OSRM.GUI.openOSMBugs;
document.getElementById("option-highlight-nonames").onclick = OSRM.Routing.getRoute_Redraw;
document.getElementById("option-show-previous-routes").onclick = OSRM.GUI.showPreviousRoutes;
},
// click: button "reset"
resetRouting: function() {
document.getElementById('gui-input-source').value = "";
document.getElementById('gui-input-target').value = "";
OSRM.G.route.reset();
OSRM.G.markers.reset();
document.getElementById('information-box').innerHTML = "";
document.getElementById('information-box-header').innerHTML = "";
OSRM.JSONP.reset();
},
// click: button "reverse"
reverseRouting: function() {
// invert input boxes
var tmp = document.getElementById("gui-input-source").value;
document.getElementById("gui-input-source").value = document.getElementById("gui-input-target").value;
document.getElementById("gui-input-target").value = tmp;
// recompute route if needed
if( OSRM.G.route.isShown() ) {
OSRM.G.markers.route.reverse();
OSRM.Routing.getRoute_Reversed(); // temporary route reversal for query, actual reversal done after receiving response
OSRM.G.markers.route.reverse();
OSRM.G.markers.highlight.hide();
OSRM.RoutingDescription.showSimple( OSRM.G.response );
// simply reverse markers
} else {
OSRM.G.markers.reverseMarkers();
}
},
// click: button "show"
showMarker: function(marker_id) {
if( OSRM.JSONP.fences["geocoder_source"] || OSRM.JSONP.fences["geocoder_target"] ) // needed when focus was on input box and user clicked on button
return;
if( marker_id == OSRM.C.SOURCE_LABEL && OSRM.G.markers.hasSource() )
OSRM.G.markers.route[0].centerView();
else if( marker_id == OSRM.C.TARGET_LABEL && OSRM.G.markers.hasTarget() )
OSRM.G.markers.route[OSRM.G.markers.route.length-1].centerView();
},
// changed: any inputbox (is called when enter is pressed [after] or focus is lost [before])
inputChanged: function(marker_id) {
if( marker_id == OSRM.C.SOURCE_LABEL)
OSRM.Geocoder.call(OSRM.C.SOURCE_LABEL, document.getElementById('gui-input-source').value);
else if( marker_id == OSRM.C.TARGET_LABEL)
OSRM.Geocoder.call(OSRM.C.TARGET_LABEL, document.getElementById('gui-input-target').value);
},
// click: button "open JOSM"
openJOSM: function() {
var center = OSRM.G.map.getCenterUI();
var bounds = OSRM.G.map.getBoundsUI();
var xdelta = Math.min(0.02, Math.abs(bounds.getSouthWest().lng - center.lng) );
var ydelta = Math.min(0.01, Math.abs(bounds.getSouthWest().lat - center.lat) );
var p = [ 'left=' + (center.lng - xdelta).toFixed(6), 'bottom=' + (center.lat - ydelta).toFixed(6), 'right=' + (center.lng + xdelta).toFixed(6), 'top=' + (center.lat + ydelta).toFixed(6)];
var url = 'http://127.0.0.1:8111/load_and_zoom?' + p.join('&');
var frame = document.getElementById('josm-frame');
if(!frame) {
frame = L.DomUtil.create('iframe', null, document.body);
frame.style.display = "none";
frame.id = 'josm-frame';
}
frame.src = url;
},
//click: button "open OSM Bugs"
openOSMBugs: function() {
var position = OSRM.G.map.getCenterUI();
window.open( "http://osmbugs.org/?lat="+position.lat.toFixed(6)+"&lon="+position.lng.toFixed(6)+"&zoom="+OSRM.G.map.getZoom() );
},
//click: button "delete marker"
deleteMarker: function(marker_id) {
var id = null;
if(marker_id == 'source' && OSRM.G.markers.hasSource() )
id = 0;
else if(marker_id == 'target' && OSRM.G.markers.hasTarget() )
id = OSRM.G.markers.route.length-1;
if( id == null)
return;
OSRM.G.markers.removeMarker( id );
OSRM.Routing.getRoute();
OSRM.G.markers.highlight.hide();
},
//click: checkbox "show previous routes"
showPreviousRoutes: function(value) {
if( document.getElementById('option-show-previous-routes').checked == false)
OSRM.G.route.deactivateHistoryRoutes();
else
OSRM.G.route.activateHistoryRoutes();
}
});
+67
View File
@@ -0,0 +1,67 @@
/*
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU AFFERO General Public License as published by
the Free Software Foundation; either version 3 of the License, or
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
or see http://www.gnu.org/licenses/agpl.txt.
*/
// OSRM selector
// [create special selector elements]
OSRM.GUI.extend( {
// initialize selector with all options and our look&feel
selectorInit: function(id, options, selected, onchange_fct) {
// create dropdown menu
var select = document.getElementById(id);
select.className += " styled-select-helper base-font";
select.onchange = function() { OSRM.GUI.selectorOnChange(this); onchange_fct(this.value); };
// fill dropdown menu
for(var i=0, size=options.length; i<size; i++) {
var option=document.createElement("option");
option.innerHTML = options[i].display;
option.value = options[i].value;
select.appendChild(option);
}
select.value = options[selected].value;
// create visible dropdown menu
var textnode = document.createTextNode( options[selected].display );
var myspan = document.createElement("span");
myspan.className = "styled-select base-font";
myspan.id = "styled-select-" + select.id;
myspan.appendChild(textnode);
select.parentNode.insertBefore(myspan, select);
myspan.style.width = (select.clientWidth-2)+"px";
myspan.style.height = (select.clientHeight)+"px";
},
// required behaviour of selector on change to switch shown name
selectorOnChange: function(select) {
var option = select.getElementsByTagName("option");
for(var i = 0; i < option.length; i++)
if(option[i].selected == true) {
document.getElementById("styled-select-" + select.id).childNodes[0].nodeValue = option[i].childNodes[0].nodeValue;
break;
}
},
// change selector value
selectorChange: function(select, value) {
select.value = value;
OSRM.GUI.selectorOnChange(select);
}
});
Binary file not shown.

After

Width:  |  Height:  |  Size: 402 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 484 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 483 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 397 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 493 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 482 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 707 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 329 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 378 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 347 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 462 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 347 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 349 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 350 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 322 B

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 477 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 480 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 488 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 446 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 955 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 973 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 823 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 834 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 861 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 897 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 937 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1018 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 963 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 959 B

File diff suppressed because it is too large Load Diff
+323
View File
@@ -0,0 +1,323 @@
/* required styles */
.leaflet-map-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-pane,
.leaflet-overlay-pane,
.leaflet-shadow-pane,
.leaflet-marker-pane,
.leaflet-popup-pane,
.leaflet-overlay-pane svg,
.leaflet-zoom-box,
.leaflet-image-layer { /* TODO optimize classes */
position: absolute;
}
.leaflet-container {
overflow: hidden;
}
.leaflet-tile-pane, .leaflet-container {
-webkit-transform: translate3d(0,0,0);
}
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow {
-moz-user-select: none;
-webkit-user-select: none;
user-select: none;
}
.leaflet-marker-icon,
.leaflet-marker-shadow {
display: block;
}
.leaflet-clickable {
cursor: pointer;
}
.leaflet-container img {
max-width: none !important;
}
.leaflet-tile-pane { z-index: 2; }
.leaflet-objects-pane { z-index: 3; }
.leaflet-overlay-pane { z-index: 4; }
.leaflet-shadow-pane { z-index: 5; }
.leaflet-marker-pane { z-index: 6; }
.leaflet-popup-pane { z-index: 7; }
.leaflet-zoom-box {
width: 0;
height: 0;
}
.leaflet-tile {
visibility: hidden;
}
.leaflet-tile-loaded {
visibility: inherit;
}
a.leaflet-active {
outline: 2px solid orange;
}
/* Leaflet controls */
.leaflet-control {
position: relative;
z-index: 7;
}
.leaflet-top,
.leaflet-bottom {
position: absolute;
}
.leaflet-top {
top: 0;
}
.leaflet-right {
right: 0;
}
.leaflet-bottom {
bottom: 0;
}
.leaflet-left {
left: 0;
}
.leaflet-control {
float: left;
clear: both;
}
.leaflet-right .leaflet-control {
float: right;
}
.leaflet-top .leaflet-control {
margin-top: 10px;
}
.leaflet-bottom .leaflet-control {
margin-bottom: 10px;
}
.leaflet-left .leaflet-control {
margin-left: 10px;
}
.leaflet-right .leaflet-control {
margin-right: 10px;
}
.leaflet-control-zoom, .leaflet-control-layers {
-moz-border-radius: 7px;
-webkit-border-radius: 7px;
border-radius: 7px;
}
.leaflet-control-zoom {
padding: 5px;
background: rgba(0, 0, 0, 0.25);
}
.leaflet-control-zoom a {
background-color: rgba(255, 255, 255, 0.75);
}
.leaflet-control-zoom a, .leaflet-control-layers a {
background-position: 50% 50%;
background-repeat: no-repeat;
display: block;
}
.leaflet-control-zoom a {
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
width: 19px;
height: 19px;
}
.leaflet-control-zoom a:hover {
background-color: #fff;
}
.leaflet-big-buttons .leaflet-control-zoom a {
width: 27px;
height: 27px;
}
.leaflet-control-zoom-in {
background-image: url(images/zoom-in.png);
margin-bottom: 5px;
}
.leaflet-control-zoom-out {
background-image: url(images/zoom-out.png);
}
.leaflet-control-layers {
-moz-box-shadow: 0 0 7px #999;
-webkit-box-shadow: 0 0 7px #999;
box-shadow: 0 0 7px #999;
background: #f8f8f9;
}
.leaflet-control-layers a {
background-image: url(images/layers.png);
width: 36px;
height: 36px;
}
.leaflet-big-buttons .leaflet-control-layers a {
width: 44px;
height: 44px;
}
.leaflet-control-layers .leaflet-control-layers-list,
.leaflet-control-layers-expanded .leaflet-control-layers-toggle {
display: none;
}
.leaflet-control-layers-expanded .leaflet-control-layers-list {
display: block;
position: relative;
}
.leaflet-control-layers-expanded {
padding: 6px 10px 6px 6px;
font: 12px/1.5 "Helvetica Neue", Arial, Helvetica, sans-serif;
color: #333;
background: #fff;
}
.leaflet-control-layers input {
margin-top: 2px;
position: relative;
top: 1px;
}
.leaflet-control-layers label {
display: block;
}
.leaflet-control-layers-separator {
height: 0;
border-top: 1px solid #ddd;
margin: 5px -10px 5px -6px;
}
.leaflet-container .leaflet-control-attribution {
margin: 0;
padding: 0 5px;
font: 11px/1.5 "Helvetica Neue", Arial, Helvetica, sans-serif;
color: #333;
background-color: rgba(255, 255, 255, 0.7);
-moz-box-shadow: 0 0 7px #ccc;
-webkit-box-shadow: 0 0 7px #ccc;
box-shadow: 0 0 7px #ccc;
}
/* Fade animations */
.leaflet-fade-anim .leaflet-tile {
opacity: 0;
-webkit-transition: opacity 0.2s linear;
-moz-transition: opacity 0.2s linear;
-o-transition: opacity 0.2s linear;
transition: opacity 0.2s linear;
}
.leaflet-fade-anim .leaflet-tile-loaded {
opacity: 1;
}
.leaflet-fade-anim .leaflet-popup {
opacity: 0;
-webkit-transition: opacity 0.2s linear;
-moz-transition: opacity 0.2s linear;
-o-transition: opacity 0.2s linear;
transition: opacity 0.2s linear;
}
.leaflet-fade-anim .leaflet-map-pane .leaflet-popup {
opacity: 1;
}
.leaflet-zoom-anim .leaflet-tile {
-webkit-transition: none;
-moz-transition: none;
-o-transition: none;
transition: none;
}
.leaflet-zoom-anim .leaflet-objects-pane {
visibility: hidden;
}
/* Popup layout */
.leaflet-popup {
position: absolute;
text-align: center;
-webkit-transform: translate3d(0,0,0);
}
.leaflet-popup-content-wrapper {
padding: 1px;
text-align: left;
}
.leaflet-popup-content {
margin: 19px;
}
.leaflet-popup-tip-container {
margin: 0 auto;
width: 40px;
height: 16px;
position: relative;
overflow: hidden;
}
.leaflet-popup-tip {
width: 15px;
height: 15px;
padding: 1px;
margin: -8px auto 0;
-moz-transform: rotate(45deg);
-webkit-transform: rotate(45deg);
-ms-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
}
.leaflet-popup-close-button {
position: absolute;
top: 9px;
right: 9px;
width: 10px;
height: 10px;
overflow: hidden;
}
.leaflet-popup-content p {
margin: 18px 0;
}
/* Visual appearance */
.leaflet-container {
background: #ddd;
}
.leaflet-container a {
color: #0078A8;
}
.leaflet-zoom-box {
border: 2px dotted #05f;
background: white;
opacity: 0.5;
}
.leaflet-popup-content-wrapper, .leaflet-popup-tip {
background: white;
box-shadow: 0 1px 10px #888;
-moz-box-shadow: 0 1px 10px #888;
-webkit-box-shadow: 0 1px 14px #999;
}
.leaflet-popup-content-wrapper {
-moz-border-radius: 20px;
-webkit-border-radius: 20px;
border-radius: 20px;
}
.leaflet-popup-content {
font: 12px/1.4 "Helvetica Neue", Arial, Helvetica, sans-serif;
}
.leaflet-popup-close-button {
background: white url(images/popup-close.png);
}
+48
View File
@@ -0,0 +1,48 @@
.leaflet-tile {
filter: inherit;
}
.leaflet-vml-shape {
width: 1px;
height: 1px;
}
.lvml {
behavior: url(#default#VML);
display: inline-block;
position: absolute;
}
.leaflet-control {
display: inline;
}
.leaflet-popup-tip {
width: 21px;
_width: 27px;
margin: 0 auto;
_margin-top: -3px;
filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678);
-ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";
}
.leaflet-popup-tip-container {
margin-top: -1px;
}
.leaflet-popup-content-wrapper, .leaflet-popup-tip {
border: 1px solid #bbb;
}
.leaflet-control-zoom {
filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#3F000000',EndColorStr='#3F000000');
}
.leaflet-control-zoom a {
background-color: #eee;
}
.leaflet-control-zoom a:hover {
background-color: #fff;
}
.leaflet-control-layers-toggle {
}
.leaflet-control-attribution, .leaflet-control-layers {
background: white;
}
File diff suppressed because one or more lines are too long
+105
View File
@@ -0,0 +1,105 @@
/*
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU AFFERO General Public License as published by
the Free Software Foundation; either version 3 of the License, or
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
or see http://www.gnu.org/licenses/agpl.txt.
*/
// OSRM localization
// [German language support]
OSRM.Localization["de"] = {
// own language
"LANGUAGE": "Deutsch",
//gui
"GUI_START": "Start",
"GUI_END": "Ziel",
"GUI_RESET": "Reset",
"GUI_SEARCH": "Zeigen",
"GUI_REVERSE": "Umdrehen",
"GUI_START_TOOLTIP": "Startposition eingeben",
"GUI_END_TOOLTIP": "Zielposition eingeben",
"GUI_LEGAL_NOTICE": "GUI2 v"+OSRM.VERSION+" "+OSRM.DATE+" - OSRM hosting by <a href='http://algo2.iti.kit.edu/'>KIT</a> - Geocoder by <a href='http://www.osm.org/'>OSM</a>",
//config
"GUI_CONFIGURATION": "Einstellungen",
"GUI_LANGUAGE": "Sprache",
"GUI_UNITS": "Einheiten",
"GUI_KILOMETERS": "Kilometer",
"GUI_MILES": "Meilen",
"GUI_DATA_TIMESTAMP": "data",
// mapping
"GUI_MAPPING_TOOLS": "Kartenwerkzeuge",
"GUI_HIGHLIGHT_UNNAMED_ROADS": "Unbenannte Straßen hervorheben",
"GUI_SHOW_PREVIOUS_ROUTES": "Frühere Routen zeigen",
"OPEN_JOSM": "JOSM",
"OPEN_OSMBUGS": "OSM Bugs",
// geocoder
"SEARCH_RESULTS": "Suchergebnisse",
"FOUND_X_RESULTS": "%i Ergebnisse gefunden",
"TIMED_OUT": "Zeitüberschreitung",
"NO_RESULTS_FOUND": "Keine Ergebnisse gefunden",
"NO_RESULTS_FOUND_SOURCE": "Keine Ergebnisse gefunden für Start",
"NO_RESULTS_FOUND_TARGET": "Keine Ergebnisse gefunden für Ziel",
// routing
"ROUTE_DESCRIPTION": "Routenbeschreibung",
"GET_LINK_TO_ROUTE": "Generiere Link",
"GENERATE_LINK_TO_ROUTE": "Warte auf Antwort",
"LINK_TO_ROUTE_TIMEOUT": "nicht möglich",
"GPX_FILE": "GPX Datei",
"DISTANCE": "Distanz",
"DURATION": "Dauer",
"YOUR_ROUTE_IS_BEING_COMPUTED": "Ihre Route wird berechnet",
"NO_ROUTE_FOUND": "Keine Route hierher möglich",
// printing
"OVERVIEW_MAP": "Übersichtskarte",
"NO_ROUTE_SELECTED": "Keine Route ausgewählt",
// directions
"N": "Norden",
"E": "Ost",
"S": "Süden",
"W": "Westen",
"NE": "Nordost",
"SE": "Südost",
"SW": "Südwest",
"NW": "Nordwest",
// driving directions
// %s: road name
// %d: direction
// [*]: will only be printed when there actually is a road name
"DIRECTION_0":"Unbekannte Anweisung[ auf <b>%s</b>]",
"DIRECTION_1":"Geradeaus weiterfahren[ auf <b>%s</b>]",
"DIRECTION_2":"Leicht rechts abbiegen[ auf <b>%s</b>]",
"DIRECTION_3":"Rechts abbiegen[ auf <b>%s</b>]",
"DIRECTION_4":"Scharf rechts abbiegen[ auf <b>%s</b>]",
"DIRECTION_5":"Wenden[ auf <b>%s</b>]",
"DIRECTION_6":"Leicht links abbiegen[ auf <b>%s</b>]",
"DIRECTION_7":"Links abbiegen[ auf <b>%s</b>]",
"DIRECTION_8":"Scharf links abbiegen[ auf <b>%s</b>]",
"DIRECTION_10":"Fahren Sie Richtung <b>%d</b>[ auf <b>%s</b>]",
"DIRECTION_11-1":"In den Kreisverkehr einfahren und bei erster Möglichkeit[ in Richtung <b>%s</b>] verlassen",
"DIRECTION_11-2":"In den Kreisverkehr einfahren und bei zweiter Möglichkeit[ in Richtung <b>%s</b>] verlassen",
"DIRECTION_11-3":"In den Kreisverkehr einfahren und bei dritter Möglichkeit[ in Richtung <b>%s</b>] verlassen",
"DIRECTION_11-4":"In den Kreisverkehr einfahren und bei vierter Möglichkeit[ in Richtung <b>%s</b>] verlassen",
"DIRECTION_11-5":"In den Kreisverkehr einfahren und bei fünfter Möglichkeit[ in Richtung <b>%s</b>] verlassen",
"DIRECTION_11-6":"In den Kreisverkehr einfahren und bei sechster Möglichkeit[ in Richtung <b>%s</b>] verlassen",
"DIRECTION_11-7":"In den Kreisverkehr einfahren und bei siebter Möglichkeit[ in Richtung <b>%s</b>] verlassen",
"DIRECTION_11-8":"In den Kreisverkehr einfahren und bei achter Möglichkeit[ in Richtung <b>%s</b>] verlassen",
"DIRECTION_11-9":"In den Kreisverkehr einfahren und bei neunter Möglichkeit[ in Richtung <b>%s</b>] verlassen",
"DIRECTION_11-x":"In den Kreisverkehr einfahren und bei einer der vielen Möglichkeiten[ in Richtung <b>%s</b>] verlassen",
"DIRECTION_15":"Sie haben Ihr Ziel erreicht"
};
// set GUI language on load
if( OSRM.DEFAULTS.LANUGAGE_ONDEMAND_RELOADING==true )
OSRM.Localization.setLanguage("de");
+105
View File
@@ -0,0 +1,105 @@
/*
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU AFFERO General Public License as published by
the Free Software Foundation; either version 3 of the License, or
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
or see http://www.gnu.org/licenses/agpl.txt.
*/
// OSRM localization
// [Danish language support]
OSRM.Localization["dk"] = {
// own language
"LANGUAGE": "Dansk",
//gui
"GUI_START": "Start",
"GUI_END": "Destination",
"GUI_RESET": "Nulstil",
"GUI_SEARCH": "Vis",
"GUI_REVERSE": "Omvendt",
"GUI_START_TOOLTIP": "Indtast start",
"GUI_END_TOOLTIP": "Indtast destination",
"GUI_LEGAL_NOTICE": "GUI2 v"+OSRM.VERSION+" "+OSRM.DATE+" - OSRM hosting af <a href='http://algo2.iti.kit.edu/'>KIT</a> - Geocoder af <a href='http://www.osm.org/'>OSM</a>",
//config
"GUI_CONFIGURATION": "Konfiguration",
"GUI_LANGUAGE": "Sprog",
"GUI_UNITS": "Enheder",
"GUI_KILOMETERS": "Kilometer",
"GUI_MILES": "Miles",
"GUI_DATA_TIMESTAMP": "data",
// mapping
"GUI_MAPPING_TOOLS": "Kortlægnings værktøjer",
"GUI_HIGHLIGHT_UNNAMED_ROADS": "Fremhæv unavngivne veje",
"GUI_SHOW_PREVIOUS_ROUTES": "Vis tidligere ruter",
"OPEN_JOSM": "JOSM",
"OPEN_OSMBUGS": "OSM Bugs",
// geocoder
"SEARCH_RESULTS": "Søgeresultater",
"FOUND_X_RESULTS": "fandt %i resultater",
"TIMED_OUT": "Indtet svar",
"NO_RESULTS_FOUND": "Ingen resultater",
"NO_RESULTS_FOUND_SOURCE": "Ingen resultater for start",
"NO_RESULTS_FOUND_TARGET": "Ingen resultater for destination",
//routing
"ROUTE_DESCRIPTION": "Rutebeskrivelse",
"GET_LINK_TO_ROUTE": "Lav link",
"GENERATE_LINK_TO_ROUTE": "venter på link",
"LINK_TO_ROUTE_TIMEOUT": "ikke tilgængelig",
"GPX_FILE": "GPX Fil",
"DISTANCE": "Distance",
"DURATION": "Varighed",
"YOUR_ROUTE_IS_BEING_COMPUTED": "Din rute bliver beregnet",
"NO_ROUTE_FOUND": "Ingen mulig rute fundet",
//printing
"OVERVIEW_MAP": "Oversigtskort",
"NO_ROUTE_SELECTED": "Ikke valgte rute",
// directions
"N": "nord",
"E": "øst",
"S": "syd",
"W": "vest",
"NE": "nordøst",
"SE": "sydøst",
"SW": "sydvest",
"NW": "nordvest",
// driving directions
// %s: road name
// %d: direction
// [*]: will only be printed when there actually is a road name
"DIRECTION_0":"Unknown instruction[ on <b>%s</b>]",
"DIRECTION_1":"Fortsæt [ ad <b>%s</b>]",
"DIRECTION_2":"Drej svagt til højre [ ad <b>%s</b>]",
"DIRECTION_3":"Drej til højre[ ad <b>%s</b>]",
"DIRECTION_4":"Drej skarpt til højre[ ad <b>%s</b>]",
"DIRECTION_5":"U-vending[ ad <b>%s</b>]",
"DIRECTION_6":"Drej svagt til venstre[ ad <b>%s</b>]",
"DIRECTION_7":"Drej til venstre[ ad <b>%s</b>]",
"DIRECTION_8":"Drej skarpt til venstre[ ad <b>%s</b>]",
"DIRECTION_10":"Kør mod <b>%d</b>[ ad <b>%s</b>]",
"DIRECTION_11-1":"Kør ind i rundkørslen og tag første udkørsel[ ad <b>%s</b>]",
"DIRECTION_11-2":"Kør ind i rundkørslen og tag anden udkørsel[ ad <b>%s</b>]",
"DIRECTION_11-3":"Kør ind i rundkørslen og tag tredje udkørsel[ ad <b>%s</b>]",
"DIRECTION_11-4":"Kør ind i rundkørslen og tag fjerde udkørsel[ ad <b>%s</b>]",
"DIRECTION_11-5":"Kør ind i rundkørslen og tag femte udkørsel[ ad <b>%s</b>]",
"DIRECTION_11-6":"Kør ind i rundkørslen og tag sjette udkørsel[ ad <b>%s</b>]",
"DIRECTION_11-7":"Kør ind i rundkørslen og tag syvende udkørsel[ ad <b>%s</b>]",
"DIRECTION_11-8":"Kør ind i rundkørslen og tag ottende udkørsel[ ad <b>%s</b>]",
"DIRECTION_11-9":"Kør ind i rundkørslen og tag niende udkørsel[ ad <b>%s</b>]",
"DIRECTION_11-x":"Kør ind i rundkørslen og tag en af de alt for mange udkørsler[ ad <b>%s</b>]",
"DIRECTION_15":"Du er ankommet til din destination"
};
//set GUI language on load
if( OSRM.DEFAULTS.LANUGAGE_ONDEMAND_RELOADING == true )
OSRM.Localization.setLanguage("dk");
+105
View File
@@ -0,0 +1,105 @@
/*
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU AFFERO General Public License as published by
the Free Software Foundation; either version 3 of the License, or
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
or see http://www.gnu.org/licenses/agpl.txt.
*/
// OSRM localization
// [English language support]
OSRM.Localization["en"] = {
// own language
"LANGUAGE": "English",
// gui
"GUI_START": "Start",
"GUI_END": "End",
"GUI_RESET": "&nbsp;&nbsp;Reset&nbsp;&nbsp;",
"GUI_SEARCH": "&nbsp;&nbsp;Show&nbsp;&nbsp;",
"GUI_REVERSE": "Reverse",
"GUI_START_TOOLTIP": "Enter start",
"GUI_END_TOOLTIP": "Enter destination",
"GUI_LEGAL_NOTICE": "GUI2 v"+OSRM.VERSION+" "+OSRM.DATE+" - OSRM hosting by <a href='http://algo2.iti.kit.edu/'>KIT</a> - Geocoder by <a href='http://www.osm.org/'>OSM</a>",
// config
"GUI_CONFIGURATION": "Configuration",
"GUI_LANGUAGE": "Language",
"GUI_UNITS": "Units",
"GUI_KILOMETERS": "Kilometers",
"GUI_MILES": "Miles",
"GUI_DATA_TIMESTAMP": "data",
// mapping
"GUI_MAPPING_TOOLS": "Mapping Tools",
"GUI_HIGHLIGHT_UNNAMED_ROADS": "Highlight unnamed streets",
"GUI_SHOW_PREVIOUS_ROUTES": "Show previous routes",
"OPEN_JOSM": "JOSM",
"OPEN_OSMBUGS": "OSM Bugs",
// geocoder
"SEARCH_RESULTS": "Search Results",
"FOUND_X_RESULTS": "found %i results",
"TIMED_OUT": "Timed Out",
"NO_RESULTS_FOUND": "No results found",
"NO_RESULTS_FOUND_SOURCE": "No results found for start",
"NO_RESULTS_FOUND_TARGET": "No results found for end",
// routing
"ROUTE_DESCRIPTION": "Route Description",
"GET_LINK_TO_ROUTE": "Generate Link",
"GENERATE_LINK_TO_ROUTE": "waiting for link",
"LINK_TO_ROUTE_TIMEOUT": "not available",
"GPX_FILE": "GPX File",
"DISTANCE": "Distance",
"DURATION": "Duration",
"YOUR_ROUTE_IS_BEING_COMPUTED": "Your route is being computed",
"NO_ROUTE_FOUND": "No route possible",
// printing
"OVERVIEW_MAP": "Overview Map",
"NO_ROUTE_SELECTED": "No route selected",
// directions
"N": "north",
"E": "east",
"S": "south",
"W": "west",
"NE": "northeast",
"SE": "southeast",
"SW": "southwest",
"NW": "northwest",
// driving directions
// %s: road name
// %d: direction
// [*]: will only be printed when there actually is a road name
"DIRECTION_0":"Unknown instruction[ on <b>%s</b>]",
"DIRECTION_1":"Continue[ on <b>%s</b>]",
"DIRECTION_2":"Turn slight right[ on <b>%s</b>]",
"DIRECTION_3":"Turn right[ on <b>%s</b>]",
"DIRECTION_4":"Turn sharp right[ on <b>%s</b>]",
"DIRECTION_5":"U-Turn[ on <b>%s</b>]",
"DIRECTION_6":"Turn slight left[ on <b>%s</b>]",
"DIRECTION_7":"Turn left[ on <b>%s</b>]",
"DIRECTION_8":"Turn sharp left[ on <b>%s</b>]",
"DIRECTION_10":"Head <b>%d</b>[ on <b>%s</b>]",
"DIRECTION_11-1":"Enter roundabout and leave at first exit[ on <b>%s</b>]",
"DIRECTION_11-2":"Enter roundabout and leave at second exit[ on <b>%s</b>]",
"DIRECTION_11-3":"Enter roundabout and leave at third exit[ on <b>%s</b>]",
"DIRECTION_11-4":"Enter roundabout and leave at fourth exit[ on <b>%s</b>]",
"DIRECTION_11-5":"Enter roundabout and leave at fifth exit[ on <b>%s</b>]",
"DIRECTION_11-6":"Enter roundabout and leave at sixth exit[ on <b>%s</b>]",
"DIRECTION_11-7":"Enter roundabout and leave at seventh exit[ on <b>%s</b>]",
"DIRECTION_11-8":"Enter roundabout and leave at eighth exit[ on <b>%s</b>]",
"DIRECTION_11-9":"Enter roundabout and leave at nineth exit[ on <b>%s</b>]",
"DIRECTION_11-x":"Enter roundabout and leave at one of the too many exits[ on <b>%s</b>]",
"DIRECTION_15":"You have reached your destination"
};
// set GUI language on load
if( OSRM.DEFAULTS.LANUGAGE_ONDEMAND_RELOADING == true )
OSRM.Localization.setLanguage("en");

Some files were not shown because too many files have changed in this diff Show More