• Resolved martinvd16

    (@martinvd16)


    I have read through other topics related to this, but haven’t been able to resolve the issue.

    The venue maps are no longer appearing on events pages. It’s a blank grey area, which if you click on will open in Google Maps. The address is displayed below the map, but it would be handy to have the map displayed again.

    The browser console comes back with:

    Uncaught ReferenceError: L is not defined
    at (index):42

    I have the Sportspress and Sportspress for cricket plugins installed.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • @martinvd16 @roch @savvasha

    Hey Roch – I’m pretty sure this is failing bc there is a requirement for leaflet.js to be loading for openstreetmaps.
    See similar issue here :
    https://www.drupal.org/project/leaflet/issues/2186953

    The function in modules/sportspress-openstreetmap is supposed to be enquing the leaflet css and js, but it is not :

    	public function frontend_venue_scripts() {
    		global $post;
    		if( ( ( is_single() || is_tax() ) && get_post_type()=='sp_event' ) || sp_has_shortcodes( $post->post_content, array('event_full', 'event_venue') ) ) {
    			wp_enqueue_style( 'leaflet_stylesheet', SP()->plugin_url() . '/assets/css/leaflet.css', array(), '1.4.0' );
    			wp_enqueue_script( 'leaflet_js', SP()->plugin_url() . '/assets/js/leaflet.js', array(), '1.4.0' );
    		}
    	}

    @martinvd16 Is using the event template, so the condition should be met.

    • This reply was modified 3 years, 11 months ago by corrinarusso.
    Plugin Contributor Savvas

    (@savvasha)

    Hi @martinvd16 ,

    What if you disable Autooptimize plugin and clear your cache?

    Thanks,
    Savvas

    Thread Starter martinvd16

    (@martinvd16)

    @savvasha Success! That’s strange that it affected the map rendering.

    Thanks for your help!

    Plugin Contributor Savvas

    (@savvasha)

    I am glad it worked. I think you can declare which scripts you want to exclude from optimization.

    Thanks,
    Savvas

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Venue maps not appearing’ is closed to new replies.