Satellite View fro Google Maps
-
Hi,
Can you tell me how to change the map format to Satellite view?
Thanks
Sam
-
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.
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
Samyou need custom coding for this; please see this tutorial – http://wp-events-plugin.com/tutorials/modifying-event-location-google-maps/
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:
http://matthewruddy.com/using-jquery-with-wordpress/Thanks,
PhilPhil,
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.
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.
Hi Caimin
\jQuery(document).bind(’em_maps_location_hook’, function( e, map, infowindow, marker ){
maptype=”satellite”
});\Thanks
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>Hi,
No it definitely doesn’t like the script in the functions.php file of my theme…
S
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>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.
The topic ‘Satellite View fro Google Maps’ is closed to new replies.