| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #import('dart:html'); | 5 #import('dart:html'); |
| 6 #import('maps.dart'); | 6 #import('maps.dart'); |
| 7 | 7 |
| 8 DirectionsRenderer directionsDisplay; | 8 DirectionsRenderer directionsDisplay; |
| 9 DirectionsService directionsService; | 9 DirectionsService directionsService; |
| 10 | 10 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 main() { | 32 main() { |
| 33 initialize(); | 33 initialize(); |
| 34 | 34 |
| 35 var myOptions = { | 35 var myOptions = { |
| 36 'zoom': 9, | 36 'zoom': 9, |
| 37 'mapTypeId': MapTypeId.ROADMAP, | 37 'mapTypeId': MapTypeId.ROADMAP, |
| 38 'center': new LatLng(47.6097, -122.3331) | 38 'center': new LatLng(47.6097, -122.3331) |
| 39 }; | 39 }; |
| 40 var map = new GMap('#map_canvas', myOptions); | 40 var map = new GMap('#map_canvas', myOptions); |
| 41 | 41 |
| 42 directionsDisplay = new DirectionsRenderer(map); | 42 directionsDisplay = new DirectionsRenderer(map); |
| 43 directionsDisplay.setPanel('#directions_panel'); | 43 directionsDisplay.setPanel('#directions_panel'); |
| 44 directionsService = new DirectionsService(); | 44 directionsService = new DirectionsService(); |
| 45 | 45 |
| 46 var control = document.query('#control'); | 46 var control = document.query('#control'); |
| 47 control.style.display = 'block'; | 47 control.style.display = 'block'; |
| 48 | 48 |
| 49 map.controls[ControlPosition.TOP].dynamic.push('#control'); | 49 (map.controls[ControlPosition.TOP] as Dynamic).push('#control'); |
| 50 | 50 |
| 51 query('#start').on.change.add(calcRoute); | 51 query('#start').on.change.add(calcRoute); |
| 52 query('#end').on.change.add(calcRoute); | 52 query('#end').on.change.add(calcRoute); |
| 53 } | 53 } |
| OLD | NEW |