Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

GWT GDirections

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I'm in the process of doing my thesis for college using Java and GWT. In the project I need to get a polyline that follows the shortest route between to markers. I was planning to do this using GDirections. I have the Google Maps API on the classpath and the map itself works fine, but when I try to create a GDirections object I get an error message saying that GDirections cannot be resolved to a type. I've found plenty of examples of it using Javascript but they aren't much good to me. Is there a something you have to do first before you can use GDirections? Any help would be much appreciated!

Cheers
Shane
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Shane O' Brien wrote:Hello,
I'm in the process of doing my thesis for college using Java and GWT. In the project I need to get a polyline that follows the shortest route between to markers. I was planning to do this using GDirections. I have the Google Maps API on the classpath and the map itself works fine, but when I try to create a GDirections object I get an error message saying that GDirections cannot be resolved to a type. I've found plenty of examples of it using Javascript but they aren't much good to me. Is there a something you have to do first before you can use GDirections? Any help would be much appreciated!

Cheers
Shane



hello ,

I'am preparing a thesis on gwt , my thesis is ,using salesman travelling via genetic algorithm ,that means what ı must find shortest route between to point on googlemap , ı researched some sources and ı saw that i must use javasprict :S that is so confused
 
Shane O' Brien
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found a way around it without using javascript. The code below is how I did it.



You pass the DirectionQueryOptions object your map. You then call the Directions.loadFromWaypoints method and pass it a waypoint array (I've called mine waypoints), the DirectionQueryOptions object and create a new DirectionsCallback object. In the on success method you do whatever you need to do with the result. As you can see I got the polyline from the result and then added it to the map as well as getting the length.
Hope that helps
Cheers
Shane
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic