Permet la recherche d'itinéraire, le geocoding, l'échantillonnage d'altitude et la création d'images de carte statiques.
Propriétés
Propriété | Type | Description |
---|---|---|
DirectionFinder | DirectionFinderEnums | |
StaticMap | StaticMapEnums |
Méthodes
Méthode | Type renvoyé | Brève description |
---|---|---|
decodePolyline(polyline) | Number[] | Décode une chaîne de polyligne encodée dans un tableau de points. |
encodePolyline(points) | String | Encode un tableau de points dans une chaîne. |
newDirectionFinder() | DirectionFinder | Crée un objet DirectionFinder. |
newElevationSampler() | ElevationSampler | Crée un objet ElevationSampler. |
newGeocoder() | Geocoder | Crée un objet Geocoder. |
newStaticMap() | StaticMap | Crée un objet StaticMap. |
setAuthentication(clientId, signingKey) | void | Permet d'utiliser un forfait Premium API Google Maps établi en externe pour exploiter des quotas supplémentaires supplémentaires. |
Documentation détaillée
decodePolyline(polyline)
Décode une chaîne de polyligne encodée dans un tableau de points.
// Decodes a string representation of the latitudes and longitudes of Minneapolis and Milwaukee // respectively. var polyline = 'qvkpG`qhxPbgyI_zq_@'; var points = Maps.decodePolyline(polyline); for (var i = 0; i < points.length; i+= 2) { Logger.log('%s, %s', points[i], points[i+1]); }
Paramètres
Nom | Type | Description |
---|---|---|
polyline | String | Polyligne encodée à décoder. |
Renvois
Number[]
: tableau de paires latitude/longitude (lat0, long0, lat1, long1, ...).
Voir aussi
encodePolyline(points)
Encode un tableau de points dans une chaîne.
// The latitudes and longitudes of New York and Boston respectively. var points = [40.77, -73.97, 42.34, -71.04]; var polyline = Maps.encodePolyline(points);
Paramètres
Nom | Type | Description |
---|---|---|
points | Number[] | Tableau de paires latitude/longitude à encoder. |
Renvois
String
: chaîne encodée représentant ces points.
Voir aussi
newDirectionFinder()
newElevationSampler()
Crée un objet ElevationSampler.
Renvois
ElevationSampler
: nouvel objet d'échantillonnage d'altitude.
newGeocoder()
newStaticMap()
setAuthentication(clientId, signingKey)
Permet d'utiliser un forfait Premium API Google Maps établi en externe pour exploiter des quotas supplémentaires supplémentaires. Vous pouvez obtenir votre ID client et votre clé de signature sur le portail d'assistance Google Enterprise. Définissez ces valeurs sur null
pour revenir à l'utilisation des quotas par défaut.
Maps.setAuthentication('gme-123456789', 'VhSEZvOXVSdnlxTnpJcUE');
Paramètres
Nom | Type | Description |
---|---|---|
clientId | String | Un identifiant de client. |
signingKey | String | Une clé de signature privée |