ZERO_RESULTS when using DirectionsService

1,964 views
Skip to first unread message

RamiJ

unread,
Apr 19, 2011, 12:58:15 PM4/19/11
to Google Maps JavaScript API v3
Using DirectionsService from google maps api returns ZERO_RESULTS for
src and dst out of the US, any ideas why is that?

var start = src_latlng;
var end = dst_latlng;
var request = {
origin:start,
destination:end ,
travelMode: google.maps.DirectionsTravelMode.DRIVING
};

directionsService.route(request, function(result, status)
{ ... }

However, when using http://maps.google.com, using the web site
manuall, with the same src and dst, it works!

geoco...@gmail.com

unread,
Apr 19, 2011, 1:24:54 PM4/19/11
to Google Maps JavaScript API v3
On Apr 19, 9:58 am, RamiJ <sra...@gmail.com> wrote:
> Using DirectionsService from google maps api returns ZERO_RESULTS for
> src and dst out of the US, any ideas why is that?

Not with the information you have provided. I would expect you are
doing something wrong, but what that is can't be determined from the
information provided.

Can you at least provide an example set of addresses that fail?

-- Larry


>
> var start = src_latlng;
>       var end = dst_latlng;
>       var request = {
>         origin:start,
>         destination:end ,
>         travelMode: google.maps.DirectionsTravelMode.DRIVING
>       };
>
>       directionsService.route(request, function(result, status)
> { ... }
>
> However, when usinghttp://maps.google.com, using the web site

RamiJ

unread,
Apr 19, 2011, 3:22:19 PM4/19/11
to Google Maps JavaScript API v3
Thanks;

Yes, for the example i tried:
Source = "Tel Aviv"
Dst = "Haifa"

Then calculated the latitue/longitude of these points into src_latlng
and dst_latlng variables correspondingly.

i would add the code for the full script i wrote if there was an
option for that here.


On Apr 19, 8:24 pm, "geocode...@gmail.com" <geocode...@gmail.com>
wrote:

RamiJ

unread,
Apr 19, 2011, 3:58:15 PM4/19/11
to Google Maps JavaScript API v3
A more general question? does the routing service should work for
Israel too?

Andrew Leach

unread,
Apr 19, 2011, 4:03:12 PM4/19/11
to google-map...@googlegroups.com
On 19 April 2011 20:58, RamiJ <sra...@gmail.com> wrote:
> A more general question? does the routing service should work for
> Israel too?

Not much works for Israel. There are licensing issues, apparently.
http://gmaps-samples.googlecode.com/svn/trunk/mapcoverage_filtered.html

RamiJ

unread,
Apr 19, 2011, 4:17:09 PM4/19/11
to Google Maps JavaScript API v3
1. This link shows countries from the US only, is that possible that
google maps api is authorized for the US only?

2. when browsing to http://maps.google.com i succeed to get routes in
israel. is that possible that is enabled there and disabled in the
api? i suspect i am doing something wrong with my code or need to add
some new definitions to make it work!

Thanks

Andrew Leach

unread,
Apr 19, 2011, 4:33:44 PM4/19/11
to google-map...@googlegroups.com
On 19 April 2011 21:17, RamiJ <sra...@gmail.com> wrote:
> 1. This link shows countries from the US only, is that possible that
> google maps api is authorized for the US only?

No. There are very few countries where the API is not allowed. There
are a few more countries which don't have any map information, which
is what that list shows for Israel. The API cannot provide any data
for Israel.

> 2. when browsing to http://maps.google.com i succeed to get routes in
> israel. is that possible that is enabled there and disabled in the
> api? i suspect i am doing something wrong with my code or need to add
> some new definitions to make it work!

You're right: Google Maps is allowed to show maps of Israel; the API
is not allowed to show them. You're not doing anything wrong (probably
-- we can't see what you're doing without a link).

Reply all
Reply to author
Forward
0 new messages