Created
September 8, 2016 12:39
-
-
Save wpflippercode/e9a02bc4eabb0b0098c6a6ffcfaa8ec4 to your computer and use it in GitHub Desktop.
Reset Zoom Level on Category Select in WP Google Map Pro
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.