Home Forums WoodMart support forum Sticky header – Disappear shortcode with the Google map Reply To: Sticky header – Disappear shortcode with the Google map

#126395

Artem Temos
Keymaster

Try to customize the file woodmart/inc/shortcodes/google-map.php and replace this code https://prnt.sc/nv9v21 with this one

jQuery(document).ready(function() {
				jQuery('body').on('google_map_init', function (e,id) {
					if ( jQuery('.google-map-' + id).length > 0 ) {
						new Maplace({
							locations: [
								{
									lat: <?php echo esc_js( $lat ); ?>,
									lon: <?php echo esc_js( $lon ); ?>,
									title: '<?php echo esc_js( $title ); ?>',
									<?php if( $title != '' && empty( $content ) ): ?>
										html: <?php echo json_encode( $marker_content ); ?>, 
									<?php endif; ?>
									icon: '<?php echo esc_js( $marker_icon ); ?>',
									animation: google.maps.Animation.DROP
								}
							],
							controls_on_map: false,
							title: '<?php echo esc_js( $title ); ?>',
							map_div: '.google-map-' + id,
							start: 1,
							map_options: {
								zoom: <?php echo esc_js( $zoom ); ?>,
								scrollwheel: <?php echo 'yes' === $scroll ? 'true' : 'false'; ?>
							},
							<?php if($style_json != ''): ?>
							styles: {
								'<?php esc_html_e('Custom style', 'woodmart') ?>': <?php 
										$styles = function_exists( 'woodmart_decompress' ) ? woodmart_decompress( $style_json, true ) : '{}';
										echo rawurldecode( $styles ); ?>
							}
							<?php endif; ?>
						}).Load();
					}
				});

				

				jQuery('body').trigger('google_map_init', [<?php echo esc_js( $id ); ?>] );

			});

And also put this part to the custom JS section in Theme Settings

setTimeout(function () {
	jQuery('.whb-sticky-header .woodmart-google-map').html('').addClass('google-map-500');
	jQuery('body').trigger('google_map_init', [500]);
}, 500);

Regards