嘿伙计们,我很难让我的谷歌地图使用自动缩放和自定义标记。在谷歌浏览器控制台中我得到
too much recursion
...(0,0);Ba(T[I],function(){return"("+this.x+", "+this.y+")"});T[I].b=function(a){r...
main.js (ligne 24)
too much recursion
...nged")}var Lf={};function If(a){return Lf[a]||(Lf[a]=a[Bb](0,1).toUpperCase()+a[...
main.js (ligne 25)
main.js 文件由 Google 在此处托管http://maps.gstatic.com/intl/fr_ALL/mapfiles/api-3/10/19/main.js
我真的不明白这个问题
<?php
print ('
<script type="text/javascript">
$(function(){
var map;
var markersArray = [];
var image = \'img/\';
var bounds = new google.maps.LatLngBounds();
var loc;
var mapOptions = { mapTypeId: google.maps.MapTypeId.ROADMAP };
map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);
');
$l=1;
foreach($carte as $value){
if ($carte[$l][lat]&&$carte[$l][lon]){
/*echo '
loc = new google.maps.LatLng("'.$carte[$l][lat].'","'.$carte[$l][lon].'");
bounds.extend(loc);
addMarker(loc, \'Event A\', "active");
';*/
echo '
loc = new google.maps.LatLng("'.$carte[$l][lat].'","'.$carte[$l][lon].'");
bounds.extend(loc);
addMarker(loc, \''.htmlentities($carte[$l][nom], ENT_QUOTES).str_replace('<br />', '', htmlentities($carte[$l][addresse], ENT_QUOTES)).'\', "active", "'.$l.'");
';
}
$l++;
}
print ('
map.fitBounds(bounds);
map.panToBounds(bounds);
function addMarker(location, name, active) {
var marker = new google.maps.Marker({
position: location,
map: map,
title: name,
status: active
});
}
});
</script>');
?>
我在这里做了一个 js fiddle http://jsfiddle.net/KwayW/48/
此时将不胜感激任何帮助