private void buildGui() {
final EntityCollectionModel model = getModel();
final List<ObjectAdapter> adapterList = model.getObject();
final GMap map = new GMap(ID_MAP);
map.setStreetViewControlEnabled(true);
map.setScaleControlEnabled(true);
map.setScrollWheelZoomEnabled(true);
map.setPanControlEnabled(true);
map.setDoubleClickZoomEnabled(true);
// centre the map on the first object that has a location.
for (ObjectAdapter adapter : adapterList) {
GLatLng latLng = asGLatLng((Locatable)adapterList.get(0).getObject());
if(latLng != null) {
map.setCenter(latLng);
break;
}
}
addOrReplace(map);