【发布时间】:2013-12-21 10:59:38
【问题描述】:
我是gwt 的新手,我有一个带有gwt map 小部件和标记位置的页面。首次加载页面时,会显示标记标注,其中只有一个 X 表示错误。
当我关闭标注并重新打开它时,会显示正确的数据。
这是gwt代码:
LatLng location = new LatLng(39.565537, -79.426603);
// Init the map options
final MapOptions options = new MapOptions();
// Zoom level. Required
options.setZoom(12);
options.setCenter(location);
// Map type. Required.
options.setMapTypeId(new MapTypeId().getRoadmap());
// Enable maps drag feature. Disabled by default.
options.setDraggable(true);
// Enable and add default navigation control. Disabled by default.
options.setNavigationControl(true);
// Enable and add map type control. Disabled by default.
options.setMapTypeControl(true);
// Create map with options & set as control
final MapWidget retval = new MapWidget(options);
marker.setPosition(location);
marker.setMap(retval.getMap());
String html = "<br />Y Device location at " + loc.updateTime;
if (loc.dmTime != null) {
html += "<br />Y Received at " + loc.dmTime;
}
infoWindow.setContent(html);
infoWindow.setPosition(location);
infoWindow.open(retval.getMap(), marker);
marker.setTitle("Whatever");
Event.addListener(marker, "click", new EventCallback() {
@Override
public void callback() {
infoWindow.open(retval.getMap(), marker);
}
});
return retval;
第一次加载页面时,我需要做什么才能使其正确显示?
【问题讨论】:
标签: java gwt google-maps-api-3