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

Side by Side Diff: src/site/samples/google_maps/example/index.dart

Issue 1387723002: Updating the samples page to reflect the examples that have been retired. (Closed) Base URL: https://github.com/dart-lang/www.dartlang.org.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « src/site/samples/gauge/index.markdown ('k') | src/site/samples/google_maps/example/index.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
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.
4
5 library google_maps;
6
7 // This code is derived from
8 // https://developers.google.com/maps/documentation/javascript/tutorial#HelloWor ld
9 // You can view the original JavaScript example at
10 // https://developers.google.com/maps/documentation/javascript/examples/map-simp le
11
12 import 'dart:html' show querySelector;
13 import 'dart:js' show context, JsObject;
14
15 void main() {
16 // The top-level getter context provides a JsObject that represents the global
17 // object in JavaScript.
18 final google_maps = context['google']['maps'];
19
20 // new JsObject() constructs a new JavaScript object and returns a proxy
21 // to it.
22 var center = new JsObject(google_maps['LatLng'], [-34.397, 150.644]);
23
24 var mapTypeId = google_maps['MapTypeId']['ROADMAP'];
25
26 // new JsObject.jsify() recursively converts a collection of Dart objects
27 // to a collection of JavaScript objects and returns a proxy to it.
28 var mapOptions = new JsObject.jsify({
29 "center": center,
30 "zoom": 8,
31 "mapTypeId": mapTypeId
32 });
33
34 // Nodes are passed though, or transferred, not proxied.
35 new JsObject(google_maps['Map'], [querySelector('#map-canvas'), mapOptions]);
36 }
OLDNEW
« no previous file with comments | « src/site/samples/gauge/index.markdown ('k') | src/site/samples/google_maps/example/index.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698