File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 26
26
steps : true
27
27
} ,
28
28
polylinePrecision : 5 ,
29
- useHints : true
29
+ useHints : true ,
30
+ suppressDemoServerWarning : false
30
31
} ,
31
32
32
33
initialize : function ( options ) {
33
34
L . Util . setOptions ( this , options ) ;
34
35
this . _hints = {
35
36
locations : { }
36
37
} ;
38
+
39
+ if ( ! this . options . suppressDemoServerWarning &&
40
+ this . options . serviceUrl . indexOf ( '//router.project-osrm.org' ) >= 0 ) {
41
+ console . warn ( 'You are using OSRM\'s demo server. ' +
42
+ 'Please note that it is **NOT SUITABLE FOR PRODUCTION USE**.\n' +
43
+ 'Refer to the demo server\'s usage policy: ' +
44
+ 'https://github.com/Project-OSRM/osrm-backend/wiki/Api-usage-policy\n\n' +
45
+ 'To change, set the serviceUrl option.\n\n' +
46
+ 'Please do not report issues with this server to neither ' +
47
+ 'Leaflet Routing Machine or OSRM - it\'s for\n' +
48
+ 'demo only, and will sometimes not be available, or work in ' +
49
+ 'unexpected ways.\n\n' +
50
+ 'Please set up your own OSRM server, or use a paid service ' +
51
+ 'provider for production.' ) ;
52
+ }
37
53
} ,
38
54
39
55
route : function ( waypoints , callback , context , options ) {
You can’t perform that action at this time.
0 commit comments