GravityView Maps - How to define the map's "zoom control" position
This file contains 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
<?php | |
/** | |
* Set the Zoom control position | |
* | |
* @param array $map_settings | |
* | |
* @return array | |
*/ | |
function gravityview_maps_modify_zoom_position( $map_settings = array() ) { | |
// Only set the position if forcing zoom display. If you letting Google decide (NULL value), you can't set the control position | |
if( true === rgars( $map_settings, 'MapOptions/zoomControl' ) ) { | |
// Options include: BOTTOM_CENTER, BOTTOM_LEFT, BOTTOM_RIGHT, LEFT_BOTTOM, LEFT_CENTER, LEFT_TOP, RIGHT_BOTTOM, RIGHT_CENTER, RIGHT_TOP, TOP_CENTER, TOP_LEFT, TOP_RIGHT | |
$map_settings['MapOptions']['zoomControlOptions'] = array( | |
'position' => 'TOP_RIGHT' | |
); | |
} | |
return $map_settings; | |
} | |
add_filter( 'gravityview/maps/render/options', 'gravityview_maps_modify_zoom_position' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment