javascript - How to update markerClusterer count show on Clusterer using Gmap4Rails in rails -
I have the filter marker based on the code below
filters = [ 'Office', 'home'] $ .eec (GMAP.map.markers, function (i, marker) {if (filter.lambi and lt; 1) {Gmaps.map.showMarker (marker);} and if (filter Indexoff (Marker .type) & gt; -1) {Gmaps.map.show Marker (Marker);} and {Gmaps.map.hideMarker (Marker);}});
This code hides that marker, but the clusterer count is not updated on its map.
How to update Clusterer count on the map
Please try with this code
handler = Gmaps.build ('Google'); Handler.buildMap ({Provider: {}, Internal: {id: 'map'}}, function () {markers_json = & lt;% = raw @ json.to_json%>; Gmaps.markers = _.map ( Markers_json, function (marker_season) {marker = handler.ad marker (marker_jsan); _extension (marker, marker_jason); return marker;}) handler.bounds.exthanth (GMAPS) markers; handler. Special metatbots ( );});
Try this code to handle events
handler.clusterer.clear (); $ .eE (GMAP.markers, Function (I, Marker) {If (filter.lambi and lt; 1) {marker.show (); handler.cluster.edmark (marker)} and if (filter index Type)) & gt; -1) {handler.cluster. Ed marker); Marker.show ();} f {marker.hide (); Handler.cluster .removeMarker (marker);}});
Comments
Post a Comment