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

Unified Diff: examples/js/maps/geocoder.mojom

Issue 848213003: JS Mojo Geocoder Demo (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « examples/js/maps/demo.js ('k') | examples/js/maps/geocoder_service.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: examples/js/maps/geocoder.mojom
diff --git a/examples/js/maps/geocoder.mojom b/examples/js/maps/geocoder.mojom
new file mode 100644
index 0000000000000000000000000000000000000000..d7cbe4cffa68578f011560da9d983c4c3e2894aa
--- /dev/null
+++ b/examples/js/maps/geocoder.mojom
@@ -0,0 +1,68 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// All of the types that follow are simple mappings of the types defined by the
+// "Google Maps JavaScript API v3" defined here:
+// https://developers.google.com/maps/documentation/javascript/geocoding
+
+module geocoder;
+
+struct Location {
+ float latitude;
+ float longitude;
+};
+
+struct LocationType {
+ const string ROOFTOP = "ROOFTOP";
+ const string RANGE_INTERPOLATED = "RANGE_INTERPOLATED";
+ const string GEOMETRIC_CENTER = "GEOMETRIC_CENTER";
+ const string APPROXIMATE = "APPROXIMATE";
+};
+
+struct Bounds {
+ Location northeast;
+ Location southwest;
+};
+
+struct ComponentRestrictions {
+ string? administrative_area;
+ string? country;
+ string? locality;
+ string? postal_code;
+ string? route;
+};
+
+struct Options {
+ ComponentRestrictions? restrictions;
+ Location? location;
+ string? region;
+};
+
+struct Geometry {
+ Location location;
+ LocationType location_type;
+ Bounds viewport;
+ Bounds? bounds;
+};
+
+struct Result {
+ bool partial_match;
+ Geometry geometry;
+ string formatted_address;
+ array<string> types;
+ // TBD address_components
+};
+
+struct Status {
+ const string OK = "OK";
+ const string ZERO_RESULTS = "ZERO_RESULTS";
+ const string OVER_QUERY_LIMIT = "OVER_QUERY_LIMIT";
+ const string REQUEST_DENIED = "REQUEST_DENIED";
+ const string INVALID_REQUEST = "INVALID_REQUEST";
+};
+
+interface Geocoder {
+ AddressToLocation(string address, Options? options) => (string status, array<Result>? results);
+ LocationToAddress(Location location, Options? options) => (string status, array<Result>? results);
+};
« no previous file with comments | « examples/js/maps/demo.js ('k') | examples/js/maps/geocoder_service.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698