Distance Matrix API overview | Google Developers

文章推薦指數: 80 %
投票人數:10人

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 Русский עברית العربيّة فارسی हिंदी বাংলা ภาษาไทย 中文–简体 中文–繁體 日本語 한국어



請為這篇文章評分?