diff --git a/includes/admin/class-sp-admin-taxonomies.php b/includes/admin/class-sp-admin-taxonomies.php index 6311710d..6452b3bf 100644 --- a/includes/admin/class-sp-admin-taxonomies.php +++ b/includes/admin/class-sp-admin-taxonomies.php @@ -112,63 +112,10 @@ class SP_Admin_Taxonomies { $latitude = '40.7324319'; $longitude = '-73.82480799999996'; endif; + if ( ! class_exists( 'SportsPress_GoogleMaps' ) ) { + do_action ( 'sp_venue_add_openstreetmap', $latitude, $longitude, $address ); + } ?> -
-

-

-
-
@@ -196,14 +143,11 @@ class SP_Admin_Taxonomies { $latitude = is_numeric( esc_attr( $term_meta['sp_latitude'] ) ) ? esc_attr( $term_meta['sp_latitude'] ) : ''; $longitude = is_numeric( esc_attr( $term_meta['sp_longitude'] ) ) ? esc_attr( $term_meta['sp_longitude'] ) : ''; $address = esc_attr( $term_meta['sp_address'] ) ? esc_attr( $term_meta['sp_address'] ) : ''; - $zoom = 15; + + if ( ! class_exists( 'SportsPress_GoogleMaps' ) ) { + do_action ( 'sp_venue_edit_openstreetmap', $latitude, $longitude, $address ); + } ?> - - -

-

- - @@ -222,64 +166,6 @@ class SP_Admin_Taxonomies { - - define_constants(); + + // Actions + add_action( 'sp_venue_add_openstreetmap', array( $this, 'add_venue_openstreetmap' ), 10, 3 ); + add_action( 'sp_venue_edit_openstreetmap', array( $this, 'edit_venue_openstreetmap' ), 10, 3 ); + add_action( 'sp_venue_show_openstreetmap', array( $this, 'show_venue_openstreetmap' ), 10, 4 ); + + // Filters + //add_filter( 'sportspress_openstreetmap', array( $this, 'add_options' ) ); + //add_filter( 'sportspress_equation_alter', array( $this, 'alter_equation' ), 10, 2 ); + + } + + /** + * Define constants. + */ + private function define_constants() { + if ( !defined( 'SP_OPENSTREETMAP_VERSION' ) ) + define( 'SP_OPENSTREETMAP_VERSION', '2.7' ); + + if ( !defined( 'SP_OPENSTREETMAP_URL' ) ) + define( 'SP_OPENSTREETMAP_URL', plugin_dir_url( __FILE__ ) ); + + if ( !defined( 'SP_OPENSTREETMAP_DIR' ) ) + define( 'SP_OPENSTREETMAP_DIR', plugin_dir_path( __FILE__ ) ); + } + + /** + * Integrate OpenStreetMap (Add Venue) + * + * @return mix + */ + public function add_venue_openstreetmap( $latitude, $longitude, $address ) { + ?> +
+

+

+
+ + + + +

+

+ + + + + +
+ + -
- -