Skip to content

Instantly share code, notes, and snippets.

@wpflippercode
Created September 8, 2016 12:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wpflippercode/e9a02bc4eabb0b0098c6a6ffcfaa8ec4 to your computer and use it in GitHub Desktop.
Save wpflippercode/e9a02bc4eabb0b0098c6a6ffcfaa8ec4 to your computer and use it in GitHub Desktop.
Reset Zoom Level on Category Select in WP Google Map Pro
add_action('wp_head','fc_reset_zoom');
function fc_reset_zoom() {
echo '<script>jQuery(document).ready(function($){
$("body").on("click","select[name=\"place_category\"]",function(){
var map_obj = $(map1).data("wpgmp_maps").map;
map_obj.setZoom(5);
});
});</script>';
}
@wpflippercode
Copy link
Author

If you're using codecanyon.net/item/advanced-google-maps-plugin-for-wordpress/5211638, You can use this code to reset zoom level of the map on category click. It's very useful code if you have clicked on a location and now want to reset the map on certain zoom level.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment