e作者uni1021 (小李)
看板Ajax
标题[问题] google map api 撷取当下的设定
时间Mon Jul 9 22:33:37 2018
google map 在初始化的时候
会设定 center 和 zoom
此时是抓使用者预设的值
重新整理页面的时候
还是会抓取原本的设定的值
想请问的是
当使用者在使用google map的时候
会滑动google map 和 map 放大缩小
有没有方法能记录当下地图的 center 和 zoom
使得最後refresh page之後
能保持最後停留的位置 以及远近
而不回到初始状态
谢谢
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 39.8.227.226
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/Ajax/M.1531146819.A.1F1.html
※ 编辑: uni1021 (39.8.227.226), 07/09/2018 22:34:13
1F:推 shadowjohn: 用localstorage,取bound後的getZoom 07/09 23:44
2F:→ shadowjohn: 重整後,取该内容,有值就用该值,没有用预设 07/09 23:44