2017-03-16 100 views
-2

我使用Googe Map API。Google地圖標記位置問題

當我使用

<div id="googleMap" style="width:100%!important; min-height:400px!important; max-height:100%!important;"></div> 

標記的位置被移位到右邊。

但是當我使用

<div id="googleMap" style="width:400px!important; min-height:400px!important; max-height:100%!important;"></div> 

這是正確顯示。

我需要寬度100%和標記以查看在中心。 如何做到這一點?我猜CSS應該發揮其作用,但我不知道如何調整它。

謝謝!

+0

的可能重複[谷歌地圖DIV沒有出現在JSBin(http://stackoverflow.com/questions/20572196/google-maps-div-not-showing-up-in-jsbin) – geocodezip

回答

0

哦!我發現它非常快。

<div id="googleMap" style="min-width:400px!important; width:100%!important; min-height:400px!important; max-height:100%!important;"> 
      </div>