List<ReferencedEnvelope> layerBounds = new ArrayList<ReferencedEnvelope>(mapContent
.layers().size());
ReferencedEnvelope aggregatedBounds = computePerLayerQueryBounds(mapContent, layerBounds,
null);
if (aggregatedBounds != null) {
LookAt la = lookAtFactory.buildLookAt(aggregatedBounds, lookAtOptions, false);
container.setAbstractView(la);
}
final List<MapLayerInfo> layers = request.getLayers();
final List<Style> styles = request.getStyles();
for (int i = 0; i < layers.size(); i++) {
MapLayerInfo layerInfo = layers.get(i);
NetworkLink nl = container.createAndAddNetworkLink();
nl.setName(layerInfo.getName());
nl.setVisibility(true);
nl.setOpen(true);
// look at for this layer
Envelope requestBox = context.getRequestBoxWGS84();
if (requestBox != null) {
LookAt la = lookAtFactory.buildLookAt(requestBox, lookAtOptions, false);
nl.setAbstractView(la);
}
// set bbox to null so its not included in the request, google
// earth will append it for us