• My maps are not displaying on the single event view, although the map shows in the “Edit Event” view.

    I noticed a JS error in the JS console as follows:
    Uncaught TypeError: Cannot read property ‘replace’ of undefined events-manager.js?ver=5.53:856

    When I click on it, it takes me to the segment of code below.

    function em_maps_load_location(el){
    	el = jQuery(el);
    	var map_id = el.attr('id').replace('em-location-map-','');
    	em_LatLng = new google.maps.LatLng( jQuery('#em-location-map-coords-'+map_id+' .lat').text(), jQuery('#em-location-map-coords-'+map_id+' .lng').text());
    	maps[map_id] = new google.maps.Map( document.getElementById('em-location-map-'+map_id), {
    	    zoom: 14,
    	    center: em_LatLng,
    	    mapTypeId: google.maps.MapTypeId.ROADMAP,
    	    mapTypeControl: false
    	});

    It shows the error on the line third line:
    var map_id = el.attr('id').replace('em-location-map-','');"

    I figured that this is because in Events->Settings->Formatting->Events->Default single event format I put the following HTML inside the {haslocation} tags:

    <div class="em-location-map">
               #_LOCATIONMAP
          </div>

    So, I experimented. When I remove the class=”em-location-map” attribute the maps load fine. So, is this a bug or is there some reason why I’m not allowed to set the class attribute in the Formatting settings? I would prefer to be able to set it so that I can control the placement of the map using CSS.

  • The topic ‘Maps not Displaying; JS Error in Events Manager’ is closed to new replies.