<?php
/**
* Events Calendar Pro: Change default coordinates for Map View starting center
* and for when there are no event results found.
*
* Change the coordinates to your liking. See the link below for a helpful tool.
* Note that these coordinates only affect the CENTER of the map and not its
* zoom level, no matter how tight your min/max pairs are.
*
* @link https://gist.github.com/cliffordp/52d0bfb6d1537a19d158deb351dd9fa7
* @link https://www.mapdevelopers.com/draw-rectangle.php Find the coordinates of a box on a map. Selecting "DublinCore" output will be most helpful.
* @link https://theeventscalendar.com/support/forums/topic/africa-really/
*/
function custom_map_view_starting_coordinates( $data, $owner, $object ) {
if ( 'tribe-events-pro' === $object ) {
// TODO: Tweak as needed to focus in on the desired geography (these ones are zoomed into New York City)
$data['geocenter'] = array(
'min_lat' => 40.477399, // south limit
'max_lat' => 40.917577, // north limit
'min_lng' => - 73.700272, // east limit
'max_lng' => - 74.25909, // west limit
);
}
return $data;
}
add_filter( 'tribe_events_pro_localize_script', 'custom_map_view_starting_coordinates', 10, 3 );