use of com.google.gwt.dom.client.Style.Unit in project blogwt by billy1380.
the class MapHelper method showMap.
/**
* @param element
* @param lines
* @param params
*/
public static void showMap(Element element, List<String> lines, Map<String, String> params) {
Style s = element.getStyle();
float width = floatParam(params, "width", 100);
Unit widthUnits = unitParam(params, "widthUnits", Unit.PCT);
s.setWidth(width, widthUnits);
float height = floatParam(params, "height", 200);
Unit heightUnits = unitParam(params, "heightUnits", Unit.PT);
s.setHeight(height, heightUnits);
float lat = floatParam(params, "lat", -34.397f);
float lng = floatParam(params, "lng", 150.644f);
int zoom = intParam(params, "zoom", 8);
String markerName = params.get("markerName");
showMap(element, lat, lng, zoom, markerName);
}
use of com.google.gwt.dom.client.Style.Unit in project blogwt by billy1380.
the class MapHelper method unitParam.
public static Unit unitParam(Map<String, String> params, String name, Unit defaultValue) {
String paramUnit = params.get(name);
Unit units = defaultValue;
if (paramUnit != null) {
try {
units = Unit.valueOf(paramUnit);
} catch (Exception ex) {
}
}
return units;
}