[CODE FIX] Locations Map: markers array
-
Hello, and thanks for the great plugin!
I would like to propose a slight modification of the code in the event-manager.js file (which I think was already actually what you intended to do… modifying-event-location-google-maps).in the event-manager.js file (about line 875)
maps_markers[map_id].push(marker);
you populate the array “maps_markers[map_id]”with google maps markers of locations, but it is never used within the function!
To be able to work on the map it is necessary to keep track of the added marker on it (as you did)My proposal is to edit the hook line (about line 894) in future updates:
ORIGINAL://Call a hook if exists jQuery(document).triggerHandler('em_maps_locations_hook', [maps[map_id], data, map_id);UPDATED:
//Call a hook if exists jQuery(document).triggerHandler('em_maps_locations_hook', [maps[map_id], data, map_id, maps_markers[map_id]]);As you can see in: modifying-event-location-google-maps
For the global maps, it’s the same principle, except the hook is called em_maps_locations_hook and one variable is supplied which is an array of markers.
you talk about “array of markers” and NOT “array of locations”.
it is my misunderstanding? or you have forgotten to implement it?NB.
In the ’em_maps_locations_hook’ the two arrays should be kept both, because:
– “data” is an array of locations that can NOT be used to interact with the google map (view: markers#remove), but useful to apply advanced filters (eg. EM functions…)
– “maps_markers[map_id]” is an array of google markers that can be used to interact with the google map (eg. MarkerClustering, Show/Hide Markers, etc. etc.)I look forward,
Raruto
The topic ‘[CODE FIX] Locations Map: markers array’ is closed to new replies.