[−][src]Enum google_maps::Region
Specifies the region bias.
Region Biasing
You can set the Directions service to return results from a specific region
by using the region
parameter. This parameter takes a
ccTLD (country code top-level domain)
argument specifying the region bias. Most ccTLD codes are identical to ISO
3166-1 codes, with some notable exceptions. For example, the United
Kingdom's ccTLD is "uk" (.co.uk
) while its ISO 3166-1 code is "gb"
(technically for the entity of "The United Kingdom of Great Britain and
Northern Ireland").
You may utilize any domain in which the main Google Maps application has launched driving directions.
For example, a directions request for "Toledo" to "Madrid" returns
appropriate results when region
is set to es
and "Toledo" is then
interpreted as the Spanish city:
https://maps.googleapis.com/maps/api/directions/json? origin=Toledo&destination=Madrid ®ion=es &key=YOUR_API_KEY { "status": "OK", "routes": [ { "summary": "AP-41", "legs": [ { ... } ], "copyrights": "Map data ©2010 Europa Technologies, Tele Atlas", "warnings": [ ], "waypoint_order": [ ] } ] }
A directions request for "Toledo" to "Madrid" sent without a region
parameter does not return results, because "Toledo" is interpreted as the
city in Ohio and not Spain:
https://maps.googleapis.com/maps/api/directions/json? origin=Toledo&destination=Madrid &key=YOUR_API_KEY { "status": "ZERO_RESULTS", "routes": [ ] }
Map Coverage Details
The Google Maps team is constantly working to improve our international coverage. Some data, such as public transit routes, are available at a city level and do not appear in this list. Please note that data coverage can change if licensing agreements with the data providers change.
Variants
Trait Implementations
impl Clone for Region
[src]
impl Debug for Region
[src]
impl Default for Region
[src]
impl<'de> Deserialize<'de> for Region
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Display for Region
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats a Region
enum into a string that is presentable to the end
user.
impl Eq for Region
[src]
impl<'_> From<&'_ Region> for String
[src]
fn from(region: &Region) -> String
[src]
Converts a Region
enum to a String
that contains a
region code.
impl Hash for Region
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for Region
[src]
fn cmp(&self, other: &Region) -> Ordering
[src]
#[must_use]
fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]
fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]
fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<Region> for Region
[src]
impl PartialOrd<Region> for Region
[src]
fn partial_cmp(&self, other: &Region) -> Option<Ordering>
[src]
#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl Serialize for Region
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralEq for Region
[src]
impl StructuralPartialEq for Region
[src]
impl TryFrom<String> for Region
[src]
Auto Trait Implementations
impl RefUnwindSafe for Region
impl Send for Region
impl Sync for Region
impl Unpin for Region
impl UnwindSafe for Region
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,