2010-07-09 2 views

답변

38

다음 URL 매개 변수를 사용할 수 있습니다. URL은 당신이 꽤, 당신은 웹 응용 프로그램에 입력 할 수 있습니다 어떤 많은 즉 이름이 될 수 있습니다에서 통과 http://maps.google.com/maps?saddr=new+york&daddr=baltimore

값 것이다

목적지 주소에 대한 시작 주소

daddr에 대한

saddr 장소/위도/등. 또한 공백에 + 문자를 사용해야합니다.

+0

에 대한 응답으로 내 업데이 트를 참조하십시오 당신이 2 개 이상의 장소에 방향을 원하는 경우 .... 예를 들면 있도록 newyork에서 볼티모어로, 그 다음으로 philadelphia 또는 다른 임의의 방향으로 이동합니다. –

+4

그래서 daddr은 항상 2 번으로 지정됩니다. 웨이 포인트를 추가하려면 "+ to : anything"을 추가하십시오. 예를 들어 http://maps.google.com/maps?saddr=new+york&daddr=baltimore+to:philadelphia+to:cleveland –

24


다른 Google지도 기능에 대한 몇 가지 표준 HTML 링크입니다. 새로운 구문을 사용하면 여러 목적지 방향에 대한 링크를 가질 수 있습니다 (단, 쿼리 매개 변수로는 불가능합니다). 아래 마지막 예제를 참조하십시오.

//Spaces can be changed to "+" or encoded as "%20". 

//Linking to a location (No directions) 
https://www.google.com/maps?q=760+West+Genesee+Street+Syracuse+NY+13204 

//No starting point (User input required to generate directions). 
https://www.google.com/maps?daddr=760+West+Genesee+Street+Syracuse+NY+13204 

//With a set location as starting point (Automatically generates directions with no user input required). 
https://www.google.com/maps?saddr=760+West+Genesee+Street+Syracuse+NY+13204&daddr=314+Avery+Avenue+Syracuse+NY+13204 

//With "My Location" as starting point (Automatically generates directions with no user input required). 
https://www.google.com/maps?saddr=My+Location&daddr=760+West+Genesee+Street+Syracuse+NY+13204 

//Current Location to Latitude and Longitude 
https://www.google.com/maps?saddr=My+Location&daddr=43.12345,-76.12345 

//Query search of a Latitude and Longitude 
//Also shows setting a default zoom level 
https://www.google.com/maps?ll=43.12345,-76.12345&q=food&z=14 

//String search as destination 
https://www.google.com/maps?saddr=My+Location&daddr=Pinckney+Hugo+Group 

//Multiple destination directions (using new syntax). Check my linked post above for the most up-to-date versions. 
https://www.google.com/maps/dir/760+W+Genesee+St+Syracuse+NY+13204/314+Avery+Ave+Syracuse+NY+13204/9090+Destiny+USA+Dr+Syracuse+NY+13204 
+0

은 https : // 대신 http://maps.google.com을 사용하는 것이 좋습니다. /www.google.com –

관련 문제