路线规划在GWT [英] Route planning in gwt
问题描述
有没有显示我的GWT应用程序映射像谷歌,地图的方式。
Is there a way to display a map like google-maps in my gwt-application.
我要实现与用户可以规划路线,以2-4不同名称的页面。
I want to implement a page with that the user can plan a route to 2-4 different designation.
还是有所收获从A点的距离到B点。
Or something to get the distance from point A to point B.
您能给我一些例子和提示。
Can you give me some examples and tips.
推荐答案
有一个看的 HTTP://$c$c.google.com/p/gwt-google-apis/issues/detail ID = 381#C53
在当前状态下,有没有小部件
,但你可以在此期间使用 SimplePanel
:
In its current state, there's no Widget
, but you could use a SimplePanel
in the mean time:
SimplePanel mapWidget = new SimplePanel();
// add the widget to a parent widget, then:
GoogleMap map = GoogleMap.create(mapWidget.getElement());
或者如果你使用UiBinder的:
or if you use UiBinder:
<div ui:field='mapElement'></div>
@UiField DivElement mapElement;
...
GoogleMap map = GoogleMap.create(mapElement);
您可以再使用<一个href=\"http://gwt-google-apis.google$c$c.com/svntrunk/javadoc/maps/3.8/com/google/maps/gwt/client/DirectionsService.html\"相对=nofollow> 为DirectionsService
规划路线,并在<一个href=\"http://gwt-google-apis.google$c$c.com/svntrunk/javadoc/maps/3.8/com/google/maps/gwt/client/geometry/Spherical.html#computeDistanceBetween%28com.google.maps.gwt.client.LatLng,%20com.google.maps.gwt.client.LatLng%29\"相对=nofollow> com.google.maps.gwt.client.geometry
包来计算两点之间的距离。
You can then use the DirectionsService
to get directions, and the com.google.maps.gwt.client.geometry
package to compute distances between points.
该API被自动从JavaScript生成的,它应该是非常相似,你就可以轻松地适应JS的例子,你在网上的GWT绑定上找到。
The API being automatically generated from JavaScript, it should be similar enough that you'll be able to easily adapt JS examples you find on the web to the GWT bindings.
这篇关于路线规划在GWT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!