noOfAttrs = (uidl != null ? uidl.getAttributeNames().size() : 0);
if (uidl == null || (noOfAttrs == 0 && uidl.getChildCount() == 0)) {
VConsole.log("Exit [getMarkerOptions]");
return null;
}
GwtMarker marker = GwtMarker.create();
String markerType = uidl.getStringAttribute("markerType");
if (uidl.hasAttribute("enabled")) {
marker.setEnabled(uidl.getBooleanAttribute("enabled"));
}
if (uidl.hasAttribute("lineColor")) {
marker.setLineColor(uidl.getStringAttribute("lineColor"));
}
if (uidl.hasAttribute("fillColor")) {
marker.setFillColor(uidl.getStringAttribute("fillColor"));
}
if (uidl.hasAttribute("lineWidth")) {
marker.setLineWidth(uidl.getIntAttribute("lineWidth"));
}
if (uidl.hasAttribute("radius")) {
marker.setRadius(uidl.getIntAttribute("radius"));
}
if (uidl.hasAttribute("symbol")) {
if (markerType.equals("image")) {
marker.setSymbol("url(." + uidl.getStringAttribute("symbol")
+ ")");
} else {
marker.setSymbol(uidl.getStringAttribute("symbol"));
}
}
// Marker states exist only in case of SymbolMarker and not ImageMarker
if (uidl.getChildCount() > 0) {
UIDL statesUIDL = uidl.getChildUIDL(0);
UIDL hoverStateUIDL = statesUIDL.getChildUIDL(0);
UIDL selectStateUIDL = statesUIDL.getChildUIDL(1);
GwtMarkerState markerHoverState = getMarkerState(hoverStateUIDL);
GwtMarkerState markerSelectState = getMarkerState(selectStateUIDL);
if (markerHoverState != null || markerSelectState != null) {
VConsole.log("Setting marker states...");
GwtMarkerStates markerStates = GwtMarkerStates.create();
if (markerHoverState != null) {
markerStates.setHover(markerHoverState);
}
if (markerSelectState != null) {
markerStates.setSelect(markerSelectState);
}
marker.setStates(markerStates);
}
}
VConsole.log("Exit [getMarkerOptions]");
return marker;
}