Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(232)

Side by Side Diff: samples/maps/maps.dart

Issue 10919146: Get rid of a lot of () for getters. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « samples/maps/js.dart ('k') | samples/markdown/ast.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 // A very incomplete Dart layer over the Google Maps JS API, v3. 5 // A very incomplete Dart layer over the Google Maps JS API, v3.
6 // See https://developers.google.com/maps/documentation/javascript/reference 6 // See https://developers.google.com/maps/documentation/javascript/reference
7 // for the underlying JS API. 7 // for the underlying JS API.
8 8
9 #library('maps'); 9 #library('maps');
10 #import('dart:html'); 10 #import('dart:html');
(...skipping 19 matching lines...) Expand all
30 30
31 GMap(this._selector, options) { 31 GMap(this._selector, options) {
32 js.invoke(''' 32 js.invoke('''
33 function (selector, options) { 33 function (selector, options) {
34 var element = document.querySelector(selector); 34 var element = document.querySelector(selector);
35 var map = new google.maps.Map(element, options); 35 var map = new google.maps.Map(element, options);
36 element._dart_map = map; 36 element._dart_map = map;
37 }''', [_selector, options]); 37 }''', [_selector, options]);
38 } 38 }
39 39
40 List<MVCArray> get controls() => new MVCMapControlArrayList(this); 40 List<MVCArray> get controls => new MVCMapControlArrayList(this);
41 41
42 serialize() => 42 serialize() =>
43 encode('function (selector) { return document.querySelector(selector)._dar t_map; }', 43 encode('function (selector) { return document.querySelector(selector)._dar t_map; }',
44 [_selector]); 44 [_selector]);
45 } 45 }
46 46
47 class LatLng extends js.Serializable { 47 class LatLng extends js.Serializable {
48 final num _lat; 48 final num _lat;
49 final num _lng; 49 final num _lng;
50 50
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 } 160 }
161 161
162 // TODO(vsm): Properly implement List. 162 // TODO(vsm): Properly implement List.
163 class MVCMapControlArrayList implements List<MVCArray> { 163 class MVCMapControlArrayList implements List<MVCArray> {
164 GMap _map; 164 GMap _map;
165 165
166 MVCMapControlArrayList(this._map); 166 MVCMapControlArrayList(this._map);
167 167
168 operator[](key) => new MVCMapControlArray(_map, key); 168 operator[](key) => new MVCMapControlArray(_map, key);
169 } 169 }
OLDNEW
« no previous file with comments | « samples/maps/js.dart ('k') | samples/markdown/ast.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698