• 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
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

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
 
Attractive, successful people love this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!