diff --git a/assets/js/sp-maps.js b/assets/js/sp-maps.js index c5aa3514..2304d682 100644 --- a/assets/js/sp-maps.js +++ b/assets/js/sp-maps.js @@ -9,7 +9,7 @@ var ll = new google.maps.LatLng(latitude,longitude); var mapOptions = { scrollwheel: false, - zoom: 12, + zoom: parseInt(vars.zoom), center: ll, mapTypeId: google.maps.MapTypeId[vars.map_type] }; diff --git a/includes/admin/settings/class-sp-settings-events.php b/includes/admin/settings/class-sp-settings-events.php index 2c5cce72..e956f6db 100644 --- a/includes/admin/settings/class-sp-settings-events.php +++ b/includes/admin/settings/class-sp-settings-events.php @@ -214,6 +214,30 @@ class SP_Settings_Events extends SP_Settings_Page { array( 'type' => 'sectionend', 'id' => 'event_options' ), ), + array( + array( 'title' => __( 'Venues', 'sportspress' ), 'type' => 'title', 'desc' => '', 'id' => 'venue_options' ), + ), + + apply_filters( 'sportspress_venue_options', array( + array( + 'title' => __( 'Zoom', 'sportspress' ), + 'id' => 'sportspress_map_zoom', + 'class' => 'small-text', + 'default' => '15', + 'desc' => '0 - 21', + 'type' => 'number', + 'custom_attributes' => array( + 'min' => 0, + 'max' => 21, + 'step' => 1 + ), + ), + ) ), + + array( + array( 'type' => 'sectionend', 'id' => 'venue_options' ), + ), + array( array( 'title' => __( 'Event Results', 'sportspress' ), 'type' => 'title', 'desc' => '', 'id' => 'result_options' ), ), diff --git a/includes/class-sp-frontend-scripts.php b/includes/class-sp-frontend-scripts.php index 02a17e08..b5dd50bb 100644 --- a/includes/class-sp-frontend-scripts.php +++ b/includes/class-sp-frontend-scripts.php @@ -78,7 +78,7 @@ class SP_Frontend_Scripts { if ( is_singular( 'sp_event' ) || is_tax( 'sp_venue' ) ): wp_enqueue_script( 'google-maps', 'https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false', array(), '3.exp', true ); wp_enqueue_script( 'sp-maps', plugin_dir_url( SP_PLUGIN_FILE ) .'assets/js/sp-maps.js', array( 'jquery', 'google-maps' ), time(), true ); - wp_localize_script( 'sp-maps', 'vars', array( 'map_type' => strtoupper( get_option( 'sportspress_map_type', 'ROADMAP' ) ) ) ); + wp_localize_script( 'sp-maps', 'vars', array( 'map_type' => strtoupper( get_option( 'sportspress_map_type', 'ROADMAP' ) ), 'zoom' => get_option( 'sportspress_map_zoom', 15 ) ) ); endif; // Localize scripts