Further notes:
The ValueChangedEvent had no old value, just new value of a
MarkerValue? My handling method doesnt have to do anything... the
dragging redraws the polygon.
I had to change my object (lat/long are Doubles) to MarkerValues as
well as otherwise getting IllegalArgumentException or this property
not on this object when trying to take in strings/objects.
The ending jsf:
<ui:repeat var="loc" value="#{spatialMarkers}">
<m:marker latitude="#{loc.latitude}" longitude="#{loc.longitude}"
draggable="true" submitOnValueChange="true" valueChangeListener="#
{mapsearch.markerDragged}"/>
</ui:repeat>
<c:if test="#{spatialMarkers != null}">
<c:if test="#{fn:length(spatialMarkers) == 2}">
<m:polyline lineWidth="2">
<c:forEach var="loc" items="#{spatialMarkers}">
<m:point latitude="#{loc.latitude}" longitude="#
{loc.longitude}" />
</c:forEach>
</m:polyline>
</c:if>
<c:if test="#{fn:length(spatialMarkers) > 2}">
<m:polygon lineWidth="2">
<c:forEach var="loc" items="#{spatialMarkers}">
<m:point latitude="#{loc.latitude}" longitude="#
{loc.longitude}" />
</c:forEach>
</m:polygon>
</c:if>
</c:if>
#{spatialMarkers} is a list of MarkerValue instances populated tba
(next step). Using seam its just a @Out(required=true)
List<MarkerValue> spatialMarkers; to implement.
The markerDragged method exists just to allow the event firing and
value rebinding to take place.
Two markers will draw a line, three will draw an open polygon (shaded
region). A separate close event will close the polygon.