gulelat / gmaps4jsf

Automatically exported from code.google.com/p/gmaps4jsf
1 stars 0 forks source link

Marker Cluster not resetting count when updated via ajax #154

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Using the following xhtml

<h:selectOneMenu value="#{viewMapDashboard.selectedMapView}">
    <f:selectItems value="#{viewMapDashboard.mapViews}" var="mapView" itemLabel="#{mapView.name}" itemValue="#{mapView.id}"/>
    <f:ajax execute="@this" render="mapPanel dataSets"/>
</h:selectOneMenu>
<h:selectOneMenu id="dataSets" value="#{viewMapDashboard.selectedDataSet}">
    <f:selectItems value="#{viewMapDashboard.selectedMapView.dataSets}" var="mapDataSet" itemLabel="#{mapDataSet.startDate.time} - #{mapDataSet.endDate.time}" itemValue="#{mapDataSet.id}"/>
    <f:ajax execute="@this" render="mapPanel"/>
</h:selectOneMenu>
<h:panelGroup  id="mapPanel" >
    <m:map width="100%" height="100%" partiallyTriggered="true"  latitude="0.01" longitude="10.14" zoom="2" enableScrollWheelZoom="true" >
        <m:mapControl name="GSmallMapControl"/>
        <m:markerCluster>
            <ui:repeat value="#{viewMapDashboard.marks}" var="mapPoint">
                <m:marker  latitude="#{mapPoint.locationPoint.latitute}" longitude="#{mapPoint.locationPoint.longitude}"/>
            </ui:repeat>
        </m:markerCluster>
    </m:map>
</h:panelGroup>

On making a selection from one of the drop down menus (which are lists of 
static mock data currently) the marker cluster count isnt reset back to zero 
(or the markers aren;t removed) meaning it gets larger each time a selection is 
made since it adds to the previous count.

Original issue reported on code.google.com by elhob...@gmail.com on 7 Feb 2011 at 6:04

GoogleCodeExporter commented 9 years ago
Okay I'm barking up the wrong tree here... Either I've done something wrong or 
there is a bug else where.  I've now created an empty selectable set of data 
and selecting that doesn't change the markers so theres clearly something more 
obvious wrong.

Original comment by elhob...@gmail.com on 8 Feb 2011 at 2:24

GoogleCodeExporter commented 9 years ago
I've reconfirmed the existence of this bug, there was an unrelated issue in my 
code which was causing the markers not to update which i fixed but the clusters 
still increase in value, even when i switch between the empty list of markers.

Original comment by elhob...@gmail.com on 8 Feb 2011 at 3:16

GoogleCodeExporter commented 9 years ago
Can you post your code as is right now? I'll take a look

Original comment by jose.noh...@gmail.com on 28 May 2011 at 8:39

GoogleCodeExporter commented 9 years ago
I have the same issue with a similar xhtml code. Rerendering by a4j:support 
just adds markers even if they are already on the map. The total number of 
markers increases with every rerender. That can be clearly seen if 
includeExtendedComponents="true".

If the center of the map has been moved and new markers are added on new 
positions, then previously added markers are still visible on their previous 
places.

It looks like a 'resetPreviousMarkers='true' attribute is missing... I'd even 
say that such a feature should be a default behavior. Otherwise partial 
triggering is useless.

Original comment by v.g.vi...@gmail.com on 30 Jun 2011 at 6:33