Using google distance matrix on server side

288 views
Skip to first unread message

shilpa

unread,
Jan 27, 2012, 2:10:27 AM1/27/12
to Google Maps JavaScript API v3
Hi

I am developing a web application wherein i need to find the closest
bus-stop from a users location and mark it on a map. I have the list
of bus-stops on my server. I am using Google's Distance Matrix service
which returns me the distance between my source and multiple bus
stops. Then, by comparing the distance i get the nearest bus-stop. But
this is all happening on client side. I wanted my server to do the
decision.

Is it possible for my server to directly communicate with the Google
maps server and get the distance?

Rossko

unread,
Jan 27, 2012, 7:12:54 AM1/27/12
to Google Maps JavaScript API v3
> Is it possible for my server to directly communicate with the Google
> maps server and get the distance?

Sure, its an HTTP service just as it describes in the documentation.
Don't forget you must use it in conjunction with a map.

shilpa

unread,
Jan 29, 2012, 10:50:12 AM1/29/12
to Google Maps JavaScript API v3, 03 Priyanka Vishwakarma
Okay. But im using ASP.net for server side scripting and the Google
maps Api is in javascript.
So how do i call the getDistanceMatrix() method from my asp.net page?
I mean that i want my server to make the getDistanceMatrix() request
and the response should be returned to my server only.


Thanks.

Andrew Leach

unread,
Jan 29, 2012, 3:01:46 PM1/29/12
to google-map...@googlegroups.com
On 29 January 2012 15:50, shilpa <salian....@gmail.com> wrote:
> Okay. But im using ASP.net for server side scripting and the Google
> maps Api is in javascript.
> So how do i call the getDistanceMatrix() method from my asp.net page?

First step is to read the documentation. The Javascript method is
available as a web service.
http://code.google.com/apis/maps/documentation/distancematrix/

Reply all
Reply to author
Forward
0 new messages