OLD | NEW |
| (Empty) |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 // All of the types that follow are simple mappings of the types defined by the | |
6 // "Google Maps JavaScript API v3" defined here: | |
7 // https://developers.google.com/maps/documentation/javascript/geocoding | |
8 | |
9 module geocoder; | |
10 | |
11 struct Location { | |
12 float latitude; | |
13 float longitude; | |
14 }; | |
15 | |
16 struct LocationType { | |
17 const string ROOFTOP = "ROOFTOP"; | |
18 const string RANGE_INTERPOLATED = "RANGE_INTERPOLATED"; | |
19 const string GEOMETRIC_CENTER = "GEOMETRIC_CENTER"; | |
20 const string APPROXIMATE = "APPROXIMATE"; | |
21 }; | |
22 | |
23 struct Bounds { | |
24 Location northeast; | |
25 Location southwest; | |
26 }; | |
27 | |
28 struct ComponentRestrictions { | |
29 string? administrative_area; | |
30 string? country; | |
31 string? locality; | |
32 string? postal_code; | |
33 string? route; | |
34 }; | |
35 | |
36 struct Options { | |
37 ComponentRestrictions? restrictions; | |
38 Location? location; | |
39 string? region; | |
40 }; | |
41 | |
42 struct Geometry { | |
43 Location location; | |
44 LocationType location_type; | |
45 Bounds viewport; | |
46 Bounds? bounds; | |
47 }; | |
48 | |
49 struct Result { | |
50 bool partial_match; | |
51 Geometry geometry; | |
52 string formatted_address; | |
53 array<string> types; | |
54 // TBD address_components | |
55 }; | |
56 | |
57 struct Status { | |
58 const string OK = "OK"; | |
59 const string ZERO_RESULTS = "ZERO_RESULTS"; | |
60 const string OVER_QUERY_LIMIT = "OVER_QUERY_LIMIT"; | |
61 const string REQUEST_DENIED = "REQUEST_DENIED"; | |
62 const string INVALID_REQUEST = "INVALID_REQUEST"; | |
63 }; | |
64 | |
65 interface Geocoder { | |
66 AddressToLocation(string address, Options? options) => (string status, array<R
esult>? results); | |
67 LocationToAddress(Location location, Options? options) => (string status, arra
y<Result>? results); | |
68 }; | |
OLD | NEW |