@Override
public void initialize(ClientMapInfo mapInfo, MapEventBus eventBus) {
this.mapInfo = mapInfo;
this.eventBus = eventBus;
crs = mapInfo.getCrs();
maxBounds = new Bbox(mapInfo.getMaxBounds().getX(), mapInfo.getMaxBounds().getY(), mapInfo.getMaxBounds()
.getWidth(), mapInfo.getMaxBounds().getHeight());
if (BboxService.equals(maxBounds, Bbox.ALL, 1e-10)) {
maxBounds = new Bbox(mapInfo.getInitialBounds().getX(), mapInfo.getInitialBounds().getY(), mapInfo
.getInitialBounds().getWidth(), mapInfo.getInitialBounds().getHeight());
if (mapInfo.getLayers() != null && mapInfo.getLayers().size() > 0) {
for (ClientLayerInfo layerInfo : mapInfo.getLayers()) {
if (layerInfo.getMaxExtent() != null) {
maxBounds = BboxService.union(maxBounds, layerInfo.getMaxExtent());
}
}
}
}
if (mapInfo.getScaleConfiguration().getZoomLevels() != null
&& mapInfo.getScaleConfiguration().getZoomLevels().size() > 0) {
zoomStrategy = new FixedStepZoomStrategy(mapInfo, maxBounds);
} else {
zoomStrategy = new FreeForAllZoomStrategy(mapInfo, maxBounds);
}
zoomStrategy.setMapSize(mapWidth, mapHeight);
initialized = true;
}