我有一个菜单,在该菜单中,单击任何应打开的页面时,它们是不同的位置,该页面应具有与页面相关的详细信息以及在地图上显示该位置的Google地图。但我创建了一个页面,该页面根据其位置显示了不同地点的不同数据id
。所以任何人都可以帮助我弄清楚如何使用它id
来显示不同地方的不同Google地图。
把它放在标题中...
<script>
$(document).ready(function(){
$("AddressView").each(function(){
var embed ="<iframe style='margin-left:10px' width='215' height='215' frameborder='0' scrolling='no' marginheight='0' marginwidth='0' src='https://maps.google.com/maps?&q="+ encodeURIComponent( $(this).text() ) +"&output=embed&iwloc'></iframe>";
$(this).html(embed);
});
});
</script>
并将其放置在您想要在体内显示地图的位置...
<AddressView>
<?php echo (preg_replace('/\s+/', '', $POSTCODEVAR)); ?>
</AddressView>
根据需要更改样式。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句