Viewing 15 replies - 1 through 15 (of 19 total)
  • Hi Sam,

    There’s no option for that at the moment in admin. That said, if you’re able to do some custom coding, it should be possible to hook into the map and switch views as it loads.

    Thread Starter sammiej

    (@sammiej)

    Hi caimin,

    I looked everywhere I could think of to change the definitions but couldn’t find the code.

    I’m no good at writing it!

    Thanks
    Sam

    Plugin Support angelo_nwl

    (@angelo_nwl)

    you need custom coding for this; please see this tutorial – https://wp-events-plugin.com/tutorials/modifying-event-location-google-maps/

    Thread Starter sammiej

    (@sammiej)

    Thanks Angelo,

    So I need to add in some jquery…where would I put it? Sorry for my ignorance!

    Sam

    Hiya,

    This helpful guide should give you what you need to add your own jQuery:
    https://matthewruddy.com/using-jquery-with-wordpress/

    Thanks,
    Phil

    Thread Starter sammiej

    (@sammiej)

    Phil,

    Thanks, I’ve created a small additional php file based on the article and put it in my Events Manager folder, but no change. On the verge of giving up…either I have the function script wrong or the script is in the wrong place!??

    Sam

    You need to add the jQuery code for the Google Maps hook (in the first link) to the functions.php file in your WordPress theme.

    Then, you need to replace the dots on line 2 of that function with the jQuery / Javascript function you want to run after a Google Map has loaded. You can’t use a PHP function for this.

    Thread Starter sammiej

    (@sammiej)

    Hi.

    Thanks for your help. I tried that but now I get

    Parse error: syntax error, unexpected T_FUNCTION in …

    The code I put in for the dots was

    maptypeID:satellite

    Obviously wrong! Any clues?

    Thanks again ??

    Can you post the whole chunk of code you’ve added to functions.php – because that error is a PHP error, rather than a Javascript one.

    Thread Starter sammiej

    (@sammiej)

    Hi Caimin

    \jQuery(document).bind(’em_maps_location_hook’, function( e, map, infowindow, marker ){
    maptype=”satellite”
    });\

    Thanks

    Plugin Support angelo_nwl

    (@angelo_nwl)

    you can try something like this

    <script>
    	jQuery(document).ready(function($){
    		jQuery(document).bind('em_maps_location_hook', function( e, map, infowindow, marker ){
    			map.setMapTypeId(google.maps.MapTypeId.SATELLITE);
    		});
     	});
    </script>
    Thread Starter sammiej

    (@sammiej)

    Hi,

    No it definitely doesn’t like the script in the functions.php file of my theme…

    S

    Plugin Support angelo_nwl

    (@angelo_nwl)

    you need to add the above in your theme header.php inside <head> html tag and below wp_head()

    eg.

    <head>
    <?php wp_head(); ?>
    <script>
    	jQuery(document).ready(function($){
    		jQuery(document).bind('em_maps_location_hook', function( e, map, infowindow, marker ){
    			map.setMapTypeId(google.maps.MapTypeId.SATELLITE);
    		});
     	});
    </script>
    </head>

    Thread Starter sammiej

    (@sammiej)

    Thanks Angelo,

    I tried that in the header.php just before the </head> but no joy. My theme has some complex php going on to facilitate a choice of headers so I think I’ll just wait and hope that it becomes an option checkbox in Events Manager at some point.

    The satellite view is more relevant for me as I run sailing holidays!

    I appreciate your help.

    Sam

    If you can post a link we might be able to see why it’s not working.

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘Satellite View fro Google Maps’ is closed to new replies.