Php 谷歌地图API标记

Php 谷歌地图API标记,php,google-maps,google-maps-markers,Php,Google Maps,Google Maps Markers,我对谷歌地图API有一个问题。我需要在谷歌地图上显示200个标记。所以我这样做: $gmap->addMarkerByAddress(location,type,picture); $gmap->generate(); echo $gmap->getGoogleMap(); 为了我所有不同的标记。然后我做这个: $gmap->addMarkerByAddress(location,type,picture); $gmap->generate(); echo $

我对谷歌地图API有一个问题。我需要在谷歌地图上显示200个标记。所以我这样做:

$gmap->addMarkerByAddress(location,type,picture);
$gmap->generate();
echo $gmap->getGoogleMap();
为了我所有不同的标记。然后我做这个:

$gmap->addMarkerByAddress(location,type,picture);
$gmap->generate();
echo $gmap->getGoogleMap();
它工作得很好,但是显示地图需要很多时间。我想生成地图,然后在地图上逐个显示标记,这样用户不必等待3分钟就能看到结果。 你知道我该怎么做吗? 非常感谢

编辑: 额外代码:

$gmap = new GoogleMapAPI('thisismykey');
您可以在此处找到GoogleMapAPI的内容:frenchtoast.fr/friendsmap/examples/GoogleMapAPIclass.txt,然后是所有初始化:

$gmap->setDivId('test1'); 
$gmap->setDirectionDivId('route'); 
$gmap->setEnableWindowZoom(false); 
$gmap->setEnableAutomaticCenterZoom(true); 
$gmap->setDisplayDirectionFields(true); 
$gmap->setSize(600,600); 
$gmap->setZoom(3); 
$gmap->setDefaultHideMarker(false);
我将200个标记添加到:

$gmap->addMarkerByAddress(location,type,picture);
然后生成地图

$gmap->generate();
echo $gmap->getGoogleMap();

这里

如果使用V2,那么我会尝试使用MarkerClusterer或KML overlay查看Robert的链接,具体取决于用例

然而,迁移到V3将消除整个问题,因为200不再是太多的标记,即使添加了太多的1000+标记,API本身也会以不同的方式处理它们,以使浏览器更容易、更快。您仍然可以在V3上使用MarkerClusterer


要获得一个实时示例,请查看此演示。它是V3,但除FusionTablesLayer外,其他所有版本都在V2中提供:

一个接一个地显示它们需要更长的时间。这并不重要,因为用户可以看到结果的演变。在3分钟内它将不会是一个空白页…解决这个问题的唯一方法是你发布更多的代码。如果没有更多的代码,我无论如何也无法帮助您。您想要哪部分?上面代码引用的所有内容