所以我有一张我正在处理的地图,像这样动态加载:
foreach( $myposts as $post ) : setup_postdata($post); ?>
var marker<?php echo $count; ?> = new google.maps.Marker({ position: new google.maps.LatLng<?php the_field('longlat'); ?>, map: map, title:"<?php the_title(); ?>, <?php the_field('address'); ?>", icon:image });
google.maps.event.addListener(marker<?php echo $count; ?>, 'click', function()
{
alert('you clicked: <?php the_title(); ?> - <?php the_field('address'); ?>');
});
<?php $count++ ?>
<?php endforeach; ?>
我想要它做的是优雅地加载带有标题和地址的标记弹出窗口......这是来自php的这两个值:
<?php the_title(); ?> - <?php the_field('address'); ?>
目前它会这样做,但在警报中......
那么如何设置它以使其出现在标记上方的弹出窗口中?
感谢您的帮助!