• Resolved yannnova

    (@yannnova)


    Hi,

    I am trying to use custom markers on the global map and I can’t find any examples and its a little outside my skill level.

    This is what I was trying was:

    jQuery(document).ready(function($) {
    	$(document).bind('em_maps_locations_hook', function( e, map, infowindow, marker ){
    		marker.setOptions({"icon": "https://domain.org/wp-content/themes/themename/images/icons/marker.png"});
    	});
    });

    I got this far from the tutorial page: https://wp-events-plugin.com/tutorials/modifying-event-location-google-maps/

    What is tripping me up is “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.” I found the above code on another thread and am sure it would work on a single event map, but it does not translate into the global map.

    Thanks for any help that can be offered.

    https://www.ads-software.com/plugins/events-manager/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support angelo_nwl

    (@angelo_nwl)

    sorry for the confusion but can you explain it again? however, did you mean to do same on the single location map ?

    Thread Starter yannnova

    (@yannnova)

    I am trying to get custom markers on the global map. The code i posted works if I use it with ’em_maps_location_hook’ for the single Location map, but if I use ’em_maps_locations_hook’ for the Global map I get an error in Console that says:

    TypeError: ‘undefined’ is not a function (evaluating ‘marker.setOptions({“icon”: “https://domain.org/wp-content/themes/themename/images/icons/marker.png”})’)

    The bit you quoted means you should use em_maps_locations_hook (which you are) but to pass only the marker info as an array, not the complete function (as you have in your code above).

    Thread Starter yannnova

    (@yannnova)

    Passing an array instead of the full function is what I am having trouble with and was hopping someone might be able to help me with.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Custom marker on global Map’ is closed to new replies.