Php 在谷歌地图上创建标记

Php 在谷歌地图上创建标记,php,javascript,google-maps,Php,Javascript,Google Maps,我试图在地图上添加多个谷歌标记,我不知道为什么这段代码不起作用。我正在使用php和javascript。我检查了一下$DNB是否有元素,它有。我不确定我做错了什么 while($DNB -> fetch()) { ?> var point = new

我试图在地图上添加多个谷歌标记,我不知道为什么这段代码不起作用。我正在使用php和javascript。我检查了一下
$DNB
是否有元素,它有。我不确定我做错了什么

                        while($DNB -> fetch())
                            {
                                ?>
                                 var point  = new google.maps.LatLng(<?php echo initval( $lat)?>, <?php echo initval($lon)?>);
                                 var marker = new google.maps.Marker({position: point, map:map});
                             <?php }
while($DNB->fetch())
{
?>
var point=newgoogle.maps.LatLng(,);
var marker=new google.maps.marker({position:point,map:map});
此代码:

var point=  new GLatLng(<?php echo intval($lat) ?>],<?php echo intval($lon)?>);                             
 var marker = new google.maps.Marker({position: point, map:map});

是Google Maps API V3。选择一个,我强烈建议使用V3。查看位于

的文档,我已将GLatLng更改为GLatLong,但仍然没有标记。var myLatlng=new Google.Maps.LatLng(-25.363882131.044922);var myOptions={zoom:4,center:myLatlng,mapTypeId:Google.Maps.mapTypeId.ROADMAP}var-map=new google.maps.map(document.getElementById(“map_canvas”),myOptions);var-marker=new google.maps.marker({position:mylatng,map:map,title:“Hello World!”);请参阅此文档:我已经发布了上面的所有内容。我还运行了一个新的php文件,以确保存储了纬度和经度。可能是php问题?您可以发布一个版本的它,让我们至少可以查看javascript吗?您对GLatLng所做的不是Google Maps API V3,而是新的Google.Maps.LatLng(纬度、经度);