Update maps
This commit is contained in:
@@ -2,22 +2,33 @@
|
||||
/**
|
||||
* Venue Map
|
||||
*
|
||||
* @author ThemeBoy
|
||||
* @package SportsPress/Templates
|
||||
* @author ThemeBoy
|
||||
* @package SportsPress/Templates
|
||||
* @version 0.8
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
if ( ! isset( $meta ) )
|
||||
return;
|
||||
return;
|
||||
|
||||
$address = sp_array_value( $meta, 'sp_address', null );
|
||||
$address = urlencode( $address );
|
||||
$latitude = sp_array_value( $meta, 'sp_latitude', null );
|
||||
$longitude = sp_array_value( $meta, 'sp_longitude', null );
|
||||
$zoom = get_option( 'sportspress_map_zoom', 15 );
|
||||
$maptype = get_option( 'sportspress_map_type', 'roadmap' );
|
||||
$maptype = strtolower( $maptype );
|
||||
if ( 'satellite' !== $maptype ) $maptype = 'roadmap';
|
||||
|
||||
if ( $latitude != null && $longitude != null ):
|
||||
?>
|
||||
<div class="sp-google-map<?php if ( is_tax( 'sp_venue' ) ): ?> sp-venue-map<?php endif; ?>" data-address="<?php echo $address; ?>" data-latitude="<?php echo $latitude; ?>" data-longitude="<?php echo $longitude; ?>"></div>
|
||||
<?php
|
||||
?>
|
||||
<iframe
|
||||
class="sp-google-map<?php if ( is_tax( 'sp_venue' ) ): ?> sp-venue-map<?php endif; ?>"
|
||||
width="600"
|
||||
height="320"
|
||||
frameborder="0" style="border:0"
|
||||
src="https://www.google.com/maps/embed/v1/place?key=AIzaSyAWyt_AG0k_Pgz4LuegtHwesA_OMRnSSAE&q=<?php echo $address; ?>&center=<?php echo $latitude; ?>,<?php echo $longitude; ?>&zoom=<?php echo $zoom; ?>" allowfullscreen>
|
||||
</iframe>
|
||||
<?php
|
||||
endif;
|
||||
|
||||
Reference in New Issue
Block a user