if (!this.containsMapView) {
throw new ProtocolException("Missed widget:map-view element.");
}
this.containsMapView = false;
MapAttributes mapAttributes = (MapAttributes) attributes;
Styles styles = mapAttributes.getStyles();
String mapStyle = "map";
if (styles.getPropertyValues().getComputedValue(
StylePropertyDetails.MCS_MAP_STYLE) == StyleKeywords.PHOTO) {
mapStyle = "photo";
} else if (styles.getPropertyValues().getComputedValue(
StylePropertyDetails.MCS_MAP_STYLE) == StyleKeywords.HYBRID) {
logger.warn("property-not-supported-yet",
new Object[]{"hybrid", "map"});
}
String pageBase = protocol.getMarinerPageContext().getVolantisBean().getPageBase();
if(pageBase.length()>0){
pageBase = "/"+pageBase;
}
StringBuffer scriptBuffer = new StringBuffer();
scriptBuffer.append("Widget.register('").append(attributes.getId())
.append("', new Widget.GoogleMap('").append(attributes.getId())
.append("',{cacheOn : true,")
.append("mode : '").append(mapStyle).append("', ")
.append(prepareICSConfig(mapAttributes.getImageAttributes()))
.append(",imageSize : ").append(StringConvertor.valueOf(this.imageSizePx))
.append(",pageBase : '").append(pageBase).append("'")
.append(getInitialLocation(mapAttributes)).append("},{")
.append(createInitializationList())
.append("}));");