我正面临使用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. Iframe autoresize
- 2. Autoresize UIScrollView
- 3. button autoresize
- 4. Autoresize Webform
- 5. UILabel AutoResize Swift
- 6. Tinymce AutoResize问题
- 7. JTable autoresize,扭曲?
- 8. Autoresize Masking问题
- 9. AUTORESIZE不工作
- 10. CorePlot AutoResize GraphHostingView
- 11. UITabBar with autoresize
- 12. UIView autoresize问题
- 13. 试图使用autoResize
- 14. CSS3 div background-image autoresize
- 15. 使用LayerDrawable背景Autoresize ImageButton
- 16. Javascript或jQuery Autoresize脚本
- 17. Autoresize header保持在一行
- 18. tableview to other view autoresize issue:swift
- 19. AUTORESIZE UICollectionViewCell尺寸内的UITableView
- 20. Facebook Iframe应用Iframe Autoresize问题?
- 21. autoresize gridview到显示单元格
- 22. AUTORESIZE不是在厦门国际银行
- 23. UILabel AutoResize切断文本的顶部
- 24. iphone/ipad - 麻烦使用Autoresize和addSubview
- 25. Mac Autoresize NSView保持长宽比
- 26. UITableView“autoresize”自定义UINavigationBar大小
- 27. Div AutoResize(好像它是空的)
- 28. Android通用图像加载器AutoResize
- 29. TinyMCE AutoResize插件,重置溢出
- 30. 什么意思autoresize = W + H在UIScrollView?
请分享您的代码。 – Ankit 2013-02-28 17:58:04