我正面臨使用gmap組件的一個小問題:當我嘗試製作組件大小調整(即,在CSS的幫助下將地圖的高度和寬度都設置爲100%)時,組件將縮小並映射本身變得不可見。但是如果設置了固定的高度/寬度,那麼組件工作正常。有沒有辦法爲gmap自動調整大小?Primefaces'gmaps autoresize
0
A
回答
0
只是一個快速的想法。您正在將大小應用於實際的#map或#map_content(或其他),而不是地圖本身?
如果只是大小的地圖,並沒有包含分區,那麼0 100%還是0
0
這個問題可能是與CSS樣式。如果有人仍有意解決這個問題下面的代碼工作對我來說:
CSS:
html, body, form {
height: 100%;
margin: 0;
}
.mapClass {
width: 100%;
height: 100%;
}
XHTML:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui">
<h:head>
<link href="./resources/css/style.css" rel="stylesheet" type="text/css" />
<script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script>
</h:head>
<h:body>
<h:form>
<p:gmap widgetVar="gmtls" center="41.381542, 2.122893" zoom="15" type="hybrid" styleClass="mapClass"/>
</h:form>
</h:body>
</html>
相關問題
- 1. button autoresize
- 2. Iframe autoresize
- 3. Autoresize Webform
- 4. Autoresize UIScrollView
- 5. AUTORESIZE不工作
- 6. UIView autoresize問題
- 7. JTable autoresize,扭曲?
- 8. 試圖使用autoResize
- 9. CSS3 div background-image autoresize
- 10. AUTORESIZE UICollectionViewCell尺寸內的UITableView
- 11. Autoresize header保持在一行
- 12. 使用LayerDrawable背景Autoresize ImageButton
- 13. Div AutoResize(好像它是空的)
- 14. TinyMCE AutoResize插件,重置溢出
- 15. Android通用圖像加載器AutoResize
- 16. UITableView「autoresize」自定義UINavigationBar大小
- 17. iphone/ipad - 麻煩使用Autoresize和addSubview
- 18. Mac Autoresize NSView保持長寬比
- 19. Facebook Iframe應用Iframe Autoresize問題?
- 20. AUTORESIZE不是在廈門國際銀行
- 21. UILabel AutoResize切斷文本的頂部
- 22. 如果使用transitionfromview,則Autoresize不起作用
- 23. 如何在Xcode 4.3中使Autoresize屬性起作用?
- 24. 如何獲得UIView的autoresize規則在viewDidLoad上觸發?
- 25. JQuery UI對話框autoResize不能在Chrome中工作
- 26. 使用jQuery向服務器端生成的textarea添加autoresize
- 27. 如何使JTable都AutoResize和horizontall滾動?
- 28. Autoresize不工作在故事板應用程序
- 29. Iframe autoResize身高與評論社交插件越來越截至今日
- 30. 如何設置autoresize屬性根據iPhone中的方向進行更改?
請分享您的代碼。 – Ankit 2013-02-28 17:58:04