hgj
Forum Replies Created
-
I’m sorry that I missed Robswaimeas replies. When I understood that angelo either didn’t understand or wasn’t interested in solving this puzzle I sort of lost interest myself and went on to other problems.
But like ekko848 I would be very keen to see a snippet of your working code, @robswaimea.
The code I use is this in the footer:
<script type="text/javascript"> jQuery(document).bind('em_maps_location_hook', function( e, map, infowindow, marker ){ var templateDir = "<?php echo get_template_directory_uri(); ?>"; //Set marker image and size var myIcon = new google.maps.MarkerImage(templateDir + "/images/googleicon.png", null, new google.maps.Point(0,0), new google.maps.Point(16,32), new google.maps.Size(40,48)); //Apply marker to map marker.setOptions({'icon': myIcon }); //Set map styles var styles = ["Wall text for styling"]; //Apply map styles map.setOptions({styles: styles}); }); jQuery(document).bind('em_maps_locations_hook', function( e, map, infowindow, marker ){ //Set marker image and size var templateDir = "<?php echo get_template_directory_uri(); ?>"; var myIcon = new google.maps.MarkerImage(templateDir + "/images/googleicon.png", null, new google.maps.Point(0,0), new google.maps.Point(16,32), new google.maps.Size(40,48)); //Apply marker to map marker.setOptions({'icon': myIcon }); //Set map styles var styles = ["Wall text for styling"]; //Apply map styles map.setOptions({styles: styles}); }); </script>
And as said, it works on single “location_map” ( https://www.sleipner.org/bollnas/kalender/unghastutstallning-2016/ ) but not on “locations_map” ( https://www.sleipner.org/avel/unghastvisningar )
Events Manager version 5.6.5
The locations hook doesn’t accept any marker variables, from [i]events-manager.js[/i]:
jQuery(document).triggerHandler('em_maps_locations_hook', [maps[map_id], data, map_id]);
compared to
jQuery(document).triggerHandler('em_maps_location_hook', [maps[map_id], infowindow, maps_markers[map_id], map_id]);
Correct, the
em_maps_locations_hook
doesn’t support marker styling, but theem_maps_location_hook
does.