1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 from __pyjamas__ import JS
16
17 from pyjamas.gmaps.Utils import translateGmapsObject, dictToJs
18 from pyjamas.gmaps.Geocoder import translateGeocoderResult
19
20
21 DirectionsStatus = JS("$wnd['google']['maps']['DirectionsStatus']")
22
23
24 DirectionsTravelMode = JS("$wnd['google']['maps']['DirectionsTravelMode']")
25
26
27 DirectionsUnitSystem = JS("$wnd['google']['maps']['DirectionsUnitSystem']")
28
29
30 directionsResultsFields = dictToJs(
31 {"trips": 'l', "warnings": 'l', "routes": 'l', "steps": 'l',
32 "results": 'd', "trips[]": 'd', "routes[]": 'd', "steps[]": 'd',
33
34 "start_geocode": translateGeocoderResult,
35 "end_geocode": translateGeocoderResult})
36
37
38
39
40
41
45
46
48
50 self.ds = JS("""new $wnd['google']['maps']['DirectionsService']()""")
51
52 - def route(self, request, callback):
56
57
60
61
64
65
68
69
72
73
76
77
80
81
84