我正面临使用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