This is a migrated thread and some comments may be shown as answers.

WebService for google maps

0 Answers 69 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Lorenzo Castrico
Top achievements
Rank 2
Lorenzo Castrico asked on 06 Jul 2008, 05:45 PM
Hello,
maybe i'm a bit off-topic, but i couldn't find a solution anywhere else.
I want to create a webservice that returns, using google maps api, driving distance betwen to cities.
Js code is quite simple:
  map = new GMap2(document.getElementById("map_canvas"));  
  map.setCenter(new GLatLng(42.351505,-71.094455), 15);  
  directionsPanel = document.getElementById("route");  
  directions = new GDirections(map, directionsPanel);  
  directions.load("500 Memorial Drive, Cambridge, MA to 4 Yawkey Way, Boston, MA 02215 (Fenway Park)"); 
 
i can exclude the part to show the map...
i also need to add a js event handler:
GEvent.addListener(directions, "load", onGDirectionsLoad); that retrieve the distance.

The problem is that i have no idea how to use this code inside a asmx

Is this possible ? What alternatives do i have ? WebRequest ? 

thanx

No answers yet. Maybe you can help?

Tags
Ajax
Asked by
Lorenzo Castrico
Top achievements
Rank 2
Share this question
or