1

Am Using google Direction Service to find map the Two Address stated Below

var start = "2115 First Avenue SE Unit 1306, Cottage Grove Place, Cedar Rapids, IA, 52402";     //Set the source/ origin
var end = "6126 Rockwell Dr. Apt 128, Keystone Place, Cedar Rapids, IA, 52402";

On select it Via Google maps Direction directly it works fine

Link :https://www.google.co.in/maps/dir/Keystone+Place-Blair's+Ferry,+6126+Rockwell+Drive+Northeast,+Cedar+Rapids,+IA+52402,+United+States/Cottage+Grove+Place,+2115+1st+Avenue+Southeast,+Cedar+Rapids,+IA+52402,+United+States/@42.0179234,-91.6739759,13z/data=!3m1!4b1!4m13!4m12!1m5!1m1!1s0x87e4f0459aacb105:0x63c416fc0edc61d6!2m2!1d-91.6475339!2d42.039779!1m5!1m1!1s0x87e4f0d795c1b96b:0xa1ccbbf6400b01aa!2m2!1d-91.6362972!2d41.9959428?hl=en

It not working as same while using Direction Service. Find below example

http://jsfiddle.net/MRHQ4/291/ (Credits to Author :Shreerang Patwardhan)

It works fine when i remove Address2 from Source and Destination

Krish KvR
  • 1,034
  • 4
  • 11
  • 18

2 Answers2

1

Unit and apartment information can cause parsing issues in the geocoder. If you can, try to remove them as best as possible. Change the addresses to

var start = "2115 First Avenue SE, Cedar Rapids, IA, 52402";     //Set the source/ origin
var end = "6126 Rockwell Dr, Cedar Rapids, IA, 52402";

and you'll see it working better.

Reduced Address Information

With Neighborhood Information

With Apt/Unit Information

Tah
  • 1,526
  • 14
  • 22
  • Yea . That works fine. Any other chance to Make it work fine with out removing to Address2 – Krish KvR Jan 27 '16 at 07:22
  • Are you talking about the (Apt/Unit) information or the Neighborhood (Cottage Grove / Keystone Place) information? – Tah Jan 27 '16 at 07:28
  • Thanks for the info.. But how does it work if we use the same address in same order when we use https://www.google.co.in/maps – Krish KvR Jan 27 '16 at 08:18
  • Check out the `Google Maps` link you posted, the address is not what you have posted. Google corrects this based on their address formatting algorithms. However, address parsing and geo coding is very costly so their APIs are limited on how much is exposed. – Tah Jan 27 '16 at 08:28
  • We have purchased Enterprise API key from google. so is it possible to make it working by perfect address parsing ? – Krish KvR Jan 27 '16 at 08:34
  • The Enterprise API key currently increases the limits of requests. It doesn't change the API. If you know the structure of the address, you can parse it into address parts and change it when you make the request. – Tah Jan 27 '16 at 09:15
  • Ok.. Thank for the info – Krish KvR Jan 27 '16 at 09:55
0

'Cottage Grove Place' and 'Keystone Place' are not the address2, these are place names (or you can say place title), just move them to start of the address (no other change) like following, and it is working fine:

var start = "Cottage Grove Place, 2115 First Avenue SE Unit 1306, Cedar Rapids, IA, 52402";     //Set the source/ origin

var end = "Keystone Place, 6126 Rockwell Dr. Apt 128, Cedar Rapids, IA, 52402";  //Set the destination

I tested and it is working fine, please review, thanks.