草庐IT

getCenter

全部标签

javascript - 谷歌地图 API 函数 map.getCenter()

当用户调整他的map时,我将GoogleMapAPI设置的缩放和位置保存在cookie中。当他们回来时,map还在​​同一个地方。该功能大部分时间都有效:varh=JSON.stringify(map.getCenter(),null,2);jQuery.cookies.set("YD44635center",h,cookieOptions);在解码端使用:locationVar=jQuery.cookies.get("YD44635center");vartemp="";//fortesting:for(varxinlocationVar){temp+=x+"\n";}alert(t