Distance Matrix API overview | Google Developers
文章推薦指數: 80 %
The Distance Matrix API provides travel distance and time for a matrix of origins and destinations, and consists of rows containing duration and distance ... Google MapsPlatform Overview Products Pricing Documentation GetStarted GetStartedwithGoogleMapsPlatform APIPicker Billing&Pricing Reporting&Monitoring MapIDs FAQ SupportandResources IncidentManagement Maps MapsJavaScriptAPI MapsSDKforAndroid MapsSDKforiOS MapsStaticAPI StreetViewStaticAPI MapsEmbedAPI MapsURLs MapsElevationAPI Routes DirectionsAPI DistanceMatrixAPI RoadsAPI Solutions IndustrySolutions GamingServices TransportationandLogistics Places PlacesAPI PlacesSDKforAndroid PlacesSDKforiOS PlacesLibrary,MapsJavaScriptAPI GeocodingAPI GeolocationAPI TimeZoneAPI AdditionalResources APISecurityBestPractices MapCoverageDetails OptimizationGuide MobileOSandsoftwaresupport Launchstages Deprecations AssetTrackingPlan URLEncoding WordPressUsers Blog Community StackOverflow GitHub YouTube Discord Twitter IssueTracker English BahasaIndonesia Deutsch Español Español–AméricaLatina Français Italiano Polski Português–Brasil TiếngViệt Türkçe Русский עברית العربيّة فارسی हिंदी বাংলা ภาษาไทย 中文–简体 中文–繁體 日本語 한국어 Signin WebServices DistanceMatrixAPI GetStarted Contactsales Guides Support Google MapsPlatform Overview Products Pricing Documentation More Guides Support Blog Community More DistanceMatrixAPI Overview GetStarted Setup SetupinCloudConsole UsingAPIKeys DeveloperGuides DistanceMatrixrequestandresponse BestPractices WebServiceBestPractices ClientLibraries BillingandMonitoring UsageandBilling ReportingandMonitoring PoliciesandTerms Policies TermsofService OtherWebServiceAPIs DirectionsAPI RoutesPreferredAPI ElevationAPI GeocodingAPI GeolocationAPI PlacesAPI RoadsAPI TimeZoneAPI GetStarted GetStartedwithGoogleMapsPlatform APIPicker Billing&Pricing Reporting&Monitoring MapIDs FAQ SupportandResources IncidentManagement Maps MapsJavaScriptAPI MapsSDKforAndroid MapsSDKforiOS MapsStaticAPI StreetViewStaticAPI MapsEmbedAPI MapsURLs MapsElevationAPI Routes DirectionsAPI DistanceMatrixAPI RoadsAPI Solutions IndustrySolutions GamingServices TransportationandLogistics Places PlacesAPI PlacesSDKforAndroid PlacesSDKforiOS PlacesLibrary,MapsJavaScriptAPI GeocodingAPI GeolocationAPI TimeZoneAPI AdditionalResources APISecurityBestPractices MapCoverageDetails OptimizationGuide MobileOSandsoftwaresupport Launchstages Deprecations AssetTrackingPlan URLEncoding WordPressUsers StackOverflow GitHub YouTube Discord Twitter IssueTracker Home Products GoogleMapsPlatform Documentation WebServices DistanceMatrixAPI Sendfeedback DistanceMatrixAPIoverview Stayorganizedwithcollections Saveandcategorizecontentbasedonyourpreferences. TheDistanceMatrixAPIprovidestraveldistanceandtimeforamatrixoforigins anddestinations,andconsistsofrowscontainingdurationanddistancevalues foreachpair.DistanceMatrixisavailableinseveralforms: asastandaloneAPI aspartoftheclient-side MapsJavaScriptAPI forserver-sideuseaspartoftheClientLibrariesforGoogleMapsWebServices WhatcanyoudowiththeDistanceMatrixAPI? TheAPIreturnsinformationbasedontherecommendedroutebetweenstartandend points.Youcanrequestdistancedatafordifferenttravelmodes,requestdistance dataindifferentunitssuchkilometersormiles,andestimatetravel timeintraffic. Formoreexamples,seetheDistanceMatrixAPIdeveloperguide, whichprovidesanintroductiontousingtheAPIandreferencematerialonthe availableparameters. WhyuseDistanceMatrix? UsetheDistanceMatrixAPIwhenyoursolutionrequiresdistanceand traveltimebetweenalargelistoforigin-destinationpoints. IfyouwanttouseDistanceMatrixfunctionalityandgetserializationofrequestsand deserializationofresponses,automaticretries,andsomeclientvalidationof requests,tryoneofourclientlibraries.Ifyou'realready usingtheMapsJavaScriptAPI,usetheDistanceMatrixservice togettheDistanceMatrixAPI'sfunctionality. Note:Thisservicedoesnotreturndetailedrouteinformation.Togetthat,pass thedesiredsingleoriginanddestinationtotheDirectionsAPI. HowtouseDistanceMatrix AccesstheDistanceMatrixAPIthroughanHTTPinterface,withrequestsconstructed asaURLstring,passingoriginsanddestinations,alongwithyourAPIkey. Ifyouwanttouseoneofourclientlibrariesinsteadofthestandalone DistanceMatrixAPIortheclient-sidewebservice,downloadand installit.Learnaboutourclientlibraries. Chooseorcreateaproject,enablebilling,andenabletheDistanceMatrixAPI. SeeSetupintheCloudConsole. CreateandrestrictanAPIkey,andaddittoyourcode.SeeUseanAPIKey. ViewaDistanceMatrixrequestandresponseandtryasamplerequest. Recommendedcontent Clientlibraries-use oneofourclientlibraries,whichincludethefunctionalityofseveralAPIs includingtheDistanceMatrix. Webservicebestpractices-learnseveralbest practicesforusingandworkingwiththeDistanceMatrix. Releasenotes-seetherelease notesfortheDistanceMatrix. Quotaandbillinginformation-find thebillingunitsandcostsfortheDistanceMatrix. Policiesandrestrictions-understand therestrictionsonusingtheDistanceMatrix. FromourTermsofService Innovate,butdon'tduplicate Don'tmakeasubstituteforGoogleMaps.Ifyourapp'sprimarypurposeis navigation,abusinessdirectory,orageneralpurpose"mapsapp",it'sa substituteforGoogleMaps. Learnmore Sendfeedback Exceptasotherwisenoted,thecontentofthispageislicensedundertheCreativeCommonsAttribution4.0License,andcodesamplesarelicensedundertheApache2.0License.Fordetails,seetheGoogleDevelopersSitePolicies.JavaisaregisteredtrademarkofOracleand/oritsaffiliates. Lastupdated2022-09-21UTC. [{ "type":"thumb-down", "id":"missingTheInformationINeed", "label":"MissingtheinformationIneed" },{ "type":"thumb-down", "id":"tooComplicatedTooManySteps", "label":"Toocomplicated/toomanysteps" },{ "type":"thumb-down", "id":"outOfDate", "label":"Outofdate" },{ "type":"thumb-down", "id":"samplesCodeIssue", "label":"Samples/codeissue" },{ "type":"thumb-down", "id":"otherDown", "label":"Other" }] [{ "type":"thumb-up", "id":"easyToUnderstand", "label":"Easytounderstand" },{ "type":"thumb-up", "id":"solvedMyProblem", "label":"Solvedmyproblem" },{ "type":"thumb-up", "id":"otherUp", "label":"Other" }] Needtotellusmore? StackOverflow Askaquestionunderthegoogle-mapstag. GitHub Forkoursamplesandtrythemyourself. Discord ChatwithfellowdevelopersaboutGoogleMapsPlatform. IssueTracker Somethingwrong?Sendusabugreport! LearnMore FAQ APIPicker JavaClientLibrary PythonClientLibrary Platforms Android iOS Web WebServices ProductInfo PricingandPlans ContactSales Support TermsofService Android Chrome Firebase GoogleCloudPlatform Allproducts Terms Privacy SignupfortheGoogleDevelopersnewsletter Subscribe English BahasaIndonesia Deutsch Español Español–AméricaLatina Français Italiano Polski Português–Brasil TiếngViệt Türkçe Русский עברית العربيّة فارسی हिंदी বাংলা ภาษาไทย 中文–简体 中文–繁體 日本語 한국어
延伸文章資訊
- 1Driving Distance Matrix API Documentation - Mappls
Distance Matrix APIs. Unlock the power of location intelligence for complex routing problems. We ...
- 2Distance Matrix API | Travel Time & Distance | Bing Maps
The Bing Maps Distance Matrix API is a Microsoft-branded solution leveraging AI-powered search sc...
- 3Distance Matrix API overview | Google Developers
The Distance Matrix API provides travel distance and time for a matrix of origins and destination...
- 4Travel Time & Distance - Distance Matrix API
The Distance Matrix API returns a top-level status field with information about the request in ge...
- 5Google Maps Distance Matrix API JavaScript Explained!