[−][src]Enum google_maps::prelude::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]
pub fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Display for Region
[src]
pub 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]
pub fn from(region: &Region) -> String
[src]
Converts a Region
enum to a String
that contains a
region code.
impl Hash for Region
[src]
pub fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for Region
[src]
pub fn cmp(&self, other: &Region) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<Region> for Region
[src]
pub fn eq(&self, other: &Region) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<Region> for Region
[src]
pub fn partial_cmp(&self, other: &Region) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl Serialize for Region
[src]
pub 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<&'_ str> for Region
[src]
Auto Trait Implementations
impl RefUnwindSafe for Region
[src]
impl Send for Region
[src]
impl Sync for Region
[src]
impl Unpin for Region
[src]
impl UnwindSafe for Region
[src]
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,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> 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,
pub fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[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.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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.
pub 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>,