有没有办法在我的gwt应用程序中显示像google地图这样的地图?
我想实现一个页面,用户可以计划2-4不同的指定路线。
或者用来得到从点A到点B的距离的东西。
你能给我一些例子和小贴士吗?
发布于 2012-04-03 17:02:03
看一看http://code.google.com/p/gwt-google-apis/issues/detail?id=381#c53
在它的当前状态下,没有Widget,但您可以同时使用SimplePanel:
SimplePanel mapWidget = new SimplePanel();
// add the widget to a parent widget, then:
GoogleMap map = GoogleMap.create(mapWidget.getElement());或者,如果您使用UiBinder:
<div ui:field='mapElement'></div>@UiField DivElement mapElement;
...
GoogleMap map = GoogleMap.create(mapElement);然后,您可以使用DirectionsService获取方向,使用com.google.maps.gwt.client.geometry package计算点之间的距离。
API是从JavaScript自动生成的,它应该足够相似,以便您能够轻松地将您在web上找到的JS示例改编为GWT绑定。
https://stackoverflow.com/questions/9976693
复制相似问题