开发者

How to create larger map bounds with a certain padding on Google Maps(v3)?

开发者 https://www.devze.com 2023-03-17 04:18 出处:网络
I want to create map bounds that can cover a little more area than the current viewport开发者_开发百科 using a padding of xx pixel. How to do that on Google maps (v3)?I suspect you can problem just ma

I want to create map bounds that can cover a little more area than the current viewport开发者_开发百科 using a padding of xx pixel. How to do that on Google maps (v3)?


I suspect you can problem just make the div a bit oversized.. but it's going to create scrollbars.

 #map{ width: 105%, height: 105%}

I would think it makes more sense to make it just fit the viewport with 100% and 100% and it will resize dynamically with the window.


You could take each of the bounds markers, add .001 (or some suitable value) to each lat & lng, then extend the bounds.

0

精彩评论

暂无评论...
验证码 换一张
取 消