Viewing 15 replies - 16 through 30 (of 51 total)
  • Thread Starter mrppp

    (@mrppp)

    if it helps, using itheme2,https://themify.me/themes/itheme2

    This is an example

    Thread Starter mrppp

    (@mrppp)

    yep that’s what i get, even on a page with only a map.

    This happens on my website, for example on the page locations.

    It works well at the moment, because I have the plugin WP Business Manager by Evrim ?abuk disabled. As soon as I enable it, the problem occurs.

    On my website, https://www.fuckmynose.com/tricking-sessions/
    I have the same problem, using the theme Enfold by Kriesi.

    Thread Starter mrppp

    (@mrppp)

    well it tricked me lol
    “WELCOME TO THE FIRST REAL TIME TRICKING MAP EVER”

    I’m having trouble replicating this problem. Does it go away for you if you use the default theme?

    Thread Starter mrppp

    (@mrppp)

    for me it goes away if i use default theme i.e itheme2 rather than activating child theme

    Thread Starter mrppp

    (@mrppp)

    ok found out my cause.
    In my theme, it has a page builder. If i turn that off it works, turn on it does not.
    If i use main theme i can turn page builder on and it works?????

    looking further in the page builder it has a map module, turn just this off and it works. so all good. in the module it has if it helps

    <?php
    /**
     * Module Name: Map
     * Description: Display Map
     */
    
    ///////////////////////////////////////
    // Enqueue Script
    ///////////////////////////////////////
    add_action( 'wp_enqueue_scripts', 'themify_builder_map_scripts' );
    function themify_builder_map_scripts() {
    	global $version;
    	//Register map scripts
    	wp_register_script('themify-builder-map-script', 'https://maps.google.com/maps/api/js?sensor=false', array(), $version, true);
    	wp_enqueue_script('themify-builder-map-script');
    }
    
    ///////////////////////////////////////
    // Module Options
    ///////////////////////////////////////
    $zoom_opt = array();
    for ( $i=1; $i < 17 ; $i++ ) {
     array_push( $zoom_opt, $i );
    }
    $this->modules['map'] = array(
    	'name' => __('Map', 'themify'),
    	'options' => array(
    		array(
    			'id' => 'mod_title_map',
    			'type' => 'text',
    			'label' => __('Module Title', 'themify'),
    			'class' => 'large'
    		),
    		array(
    			'id' => 'address_map',
    			'type' => 'textarea',
    			'value' => '',
    			'class' => 'fullwidth',
    			'label' => __('Address', 'themify')
    		),
    		array(
    			'id' => 'zoom_map',
    			'type' => 'selectbasic',
    			'label' => __('Zoom', 'themify'),
    			'default' => 8,
    			'options' => $zoom_opt
    		),
    		array(
    			'id' => 'w_map',
    			'type' => 'text',
    			'class' => 'xsmall',
    			'label' => __('Width', 'themify'),
    			'unit' => array(
    				'id' => 'unit_w',
    				'selected' => '%',
    				'options' => array(
    					array( 'id' => 'pixel_unit_w', 'value' => 'px'),
    					array( 'id' => 'percent_unit_w', 'value' => '%')
    				)
    			),
    			'value' => 100
    		),
    		array(
    			'id' => 'h_map',
    			'type' => 'text',
    			'label' => __('Height', 'themify'),
    			'class' => 'xsmall',
    			'unit' => array(
    				'id' => 'unit_h',
    				'options' => array(
    					array( 'id' => 'pixel_unit_h', 'value' => 'px')
    				)
    			),
    			'value' => 300
    		),
    		array(
    			'id' => 'multifield',
    			'type' => 'multifield',
    			'label' => __('Border', 'themify'),
    			'options' => array(
    				'select' => array(
    					'id' => 'b_style_map',
    					'options' => array('solid', 'dotted', 'dashed')
    				),
    				'text' => array(
    					'id' => 'b_width_map',
    					'help' => 'px'
    				),
    				'colorpicker' => array(
    					'id' => 'b_color_map',
    					'class' => 'small'
    				)
    			)
    		),
    		array(
    			'id' => 'css_map',
    			'type' => 'text',
    			'label' => __('Additional CSS Class', 'themify'),
    			'class' => 'large',
    			'help' => __('Add additional CSS class(es) for custom styling', 'themify'),
    			'separated' => 'top',
    			'break' => true
    		)
    	)
    );
    
    ?>

    in template

    <?php
    /**
     * Template Map
     *
     * Access original fields: $mod_settings
     * @author Themify
     */
    
    $fields_default = array(
    	'mod_title_map' => '',
    	'address_map' => '',
    	'zoom_map' => 15,
    	'w_map' => '100%',
    	'unit_w' => '',
    	'h_map' => '300px',
    	'unit_h' => '',
    	'b_style_map' => '',
    	'b_width_map' => '',
    	'b_color_map' => '',
    	'css_map' => ''
    );
    
    if ( isset( $mod_settings['address_map'] ) )
    	$mod_settings['address_map'] = preg_replace( '/\s+/', ' ', trim( $mod_settings['address_map'] ) );
    
    $fields_args = wp_parse_args( $mod_settings, $fields_default );
    extract( $fields_args, EXTR_SKIP );
    
    $class = $css_map . ' module-' . $mod_name;
    $style = '';
    
    // specify border
    if ( isset( $mod_settings['b_width_map'] ) ) {
    	$style .= 'border: ';
    	$style .= ( isset($mod_settings['b_style_map'] ) ) ? $mod_settings['b_style_map'] : '';
    	$style .= ( isset($mod_settings['b_width_map'] ) ) ? ' '.$mod_settings['b_width_map'].'px' : '';
    	$style .= ( isset($mod_settings['b_color_map'] ) ) ? ' #'.$mod_settings['b_color_map'] : '';
    	$style .= ';';
    }
    
    $style .= 'width:';
    $style .= ( isset( $mod_settings['w_map'] ) ) ? $mod_settings['w_map'].$mod_settings['unit_w'] : '100%';
    $style .= ';';
    $style .= 'height:';
    $style .= ( isset( $mod_settings['h_map'] ) ) ? $mod_settings['h_map'].$mod_settings['unit_h'] : '300px';
    $style .= ';';
    ?>
    <!-- module map -->
    <div id="<?php echo $module_ID; ?>" class="module <?php echo $class; ?>">
    	<?php if( $mod_title_map != '' ): ?>
    	<h3 class="module-title"><?php echo $mod_title_map; ?></h3>
    	<?php endif; ?>
    	<?php
    	if ( ! empty( $address_map ) ) { ?>
    	<?php $num = rand(0,10000); ?>
    		<script type="text/javascript">
    			jQuery(document).ready(function() {
    				ThemifyBuilderModuleJs.initialize("<?php echo $address_map; ?>", <?php echo $num; ?>, <?php echo $zoom_map; ?>);
    			});
    		</script>
    		<div id="themify_map_canvas_<?php echo $num; ?>" style="<?php echo $style; ?>" class="map-container">?</div>
    	<?php
    	}
    	?>
    </div>
    <!-- /module map -->

    Thread Starter mrppp

    (@mrppp)

    SO activating child theme turn that off and all is good

    also solved other issue i had with this

    <?php wp_head(); ?> <!--remove if you already have this-->
    <script type="text/javascript">
    jQuery(document).ready(function($){
      jQuery(document).bind('em_maps_location_hook', function( e, map, infowindow, marker ){
       setTimeout(function(){ infowindow.close(); }, 1000);
      });
    });
    </script>

    I think I found the problem in my case:

    I have a plugin that calls Google API in header in seems that Events Manager calls it again, so when I deactivated the plugin I have in header, the map for events manager is there again.

    Any idea about how to call just once the Google API?

    Another problem, the map doesn’t show when I want to create an event…!

    I have the same issue in the WP admin (when I edit / add an event):

    Uncaught ReferenceError: map is not defined events-manager.js

    Here:

    if( !em_maps_loaded ){
    	google.maps.event.addListenerOnce(map, 'idle', function(){ if( !em_maps_loaded ) em_maps(); });

    (I have the problem since the update)

    Thread Starter mrppp

    (@mrppp)

    i would start by activating Twenty Twelve theme see if issue goes.

    Thanks for your fast answer!

    I’ve just activated Twenty Twelve and the problem persists (in the backend too, same error).

    The problem is that it blocks some other elements (like featured image).

    Where should this “map” variable be defined?

Viewing 15 replies - 16 through 30 (of 51 total)
  • The topic ‘map issue’ is closed to new replies.