mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
67 lines
1.7 KiB
Plaintext
67 lines
1.7 KiB
Plaintext
// 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
|
|
|
|
[DartPackage="mojo_services"]
|
|
module mojo;
|
|
|
|
import "location/interfaces/location.mojom";
|
|
|
|
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);
|
|
};
|