[問題] 關於取得google map 新的中心點問題
這是我的程式碼
$('.perview').on("click", "img", function(){
var index = $(this).parents('.perview').index();
$('.info_content').stop(true,false).animate({opacity: 0},300).animate({opacity: 1},300);
$('.info_content_bg').stop(true,false).animate({opacity: 0},300).animate({opacity: 0.2},300);
$('.info').hide().empty().append(
datas[index].vName,
'<img class="vImg1" src="'+ datas[index].vImg1 +'" width="300" height="225" />',
datas[index].vSummary,
datas[index].Add,
datas[index].Tel
).delay(300).fadeIn(500);
//問題所在地↓
var latlng_new = {
lat: datas[index].vLat,
lng: datas[index].vLng
};
map.panTo(latlng_new);
});
流程:
當我點選 .perview img 後,會讀取我datas 裡的相關資料,包括經緯度。
問題:
我創了一個經緯度陣列,
希望點選後,地圖的中心點會變更到,該點選的經緯度,
map.panTo(latlng_new); 的用法,有錯嗎?
因為他不會動....
--
Blog http://oao54bb.blogspot.com/
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 123.240.34.196
→
04/02 16:18, , 1F
04/02 16:18, 1F
→
04/02 16:18, , 2F
04/02 16:18, 2F
→
04/02 21:28, , 3F
04/02 21:28, 3F
Ajax 近期熱門文章
PTT數位生活區 即時熱門文章