Add markerclusterer from nearme to member map.
*/
public function modelAction ($actionData = false)
{
+ // Enqueue the Marker Clusterer Script
+ wp_register_script(
+ 'glm-members-admin-google-maps-marker-clusterer',
+ GLM_MEMBERS_PLUGIN_URL . 'js/googleMapsMarkerClusterer/markerclustererplus.js',
+ array(
+ 'jquery'
+ ),
+ GLM_MEMBERS_PLUGIN_VERSION
+ );
+ wp_enqueue_script('glm-members-admin-google-maps-marker-clusterer', false, array('jquery'), false, true);
$where = '';
$whereSep = '';
//});
//}
+
{if $mapItems}
+ var markers = [];
{foreach $mapItems as $m}
{if $m.lat != 0 && $m.lon != 0}
infowindow.open(map,this);
});
+ markers.push(marker);
+
// Extend the map bounds to include this marker
bounds.extend(marker.position);
{/if}
{/foreach}
+ var markerCluster = new MarkerClusterer(map, markers,
+ {
+ imagePath: '{$baseUrl}/js/googleMapsMarkerClusterer/images/m',
+ gridSize: 30,
+ maxZoom: 14,
+ minimunClusterSize: 3
+ });
+
// Fit map to bounds of all markers
map.fitBounds(bounds);