admin管理员组文章数量:1336320
I'm working on what it looked to be like a very simple feature which is causing a little bit of a headache.
I work with a GIS and we integrate it with Google Maps. One of the clients requested to be able to open a separate pop up window showing only the map. Opening the window wasn't a problem, but as I try to expand the width of the IFrame which contains the map, in order to fit the window size, the actual map image stays with the same size, and a white space fills the remaining space.
I wonder if I have to pass the new width value to some pre-rendering function or something like that... I've already tried using checkResize() but this proved not to work.
The function I'm using to darw the map IFrame goes below:
DrawMapIFrame()
{
var str = '<iframe id="mapIFrame" name="mapIFrame" width="97%" height="' + parent.mapFrameHeight + '" src="' + $_URL_FleetMonitiorMapIFrame + '?UserID=' + parent.$_UserID + '&Encoding=' + parent.$_Encoding + '&id=' + _id + '" frameborder="0" scrolling="No"></iframe>';
document.getElementById("mapIFramePlace").innerHTML = str;
}
I'm working on what it looked to be like a very simple feature which is causing a little bit of a headache.
I work with a GIS and we integrate it with Google Maps. One of the clients requested to be able to open a separate pop up window showing only the map. Opening the window wasn't a problem, but as I try to expand the width of the IFrame which contains the map, in order to fit the window size, the actual map image stays with the same size, and a white space fills the remaining space.
I wonder if I have to pass the new width value to some pre-rendering function or something like that... I've already tried using checkResize() but this proved not to work.
The function I'm using to darw the map IFrame goes below:
DrawMapIFrame()
{
var str = '<iframe id="mapIFrame" name="mapIFrame" width="97%" height="' + parent.mapFrameHeight + '" src="' + $_URL_FleetMonitiorMapIFrame + '?UserID=' + parent.$_UserID + '&Encoding=' + parent.$_Encoding + '&id=' + _id + '" frameborder="0" scrolling="No"></iframe>';
document.getElementById("mapIFramePlace").innerHTML = str;
}
Share
Improve this question
edited Aug 15, 2010 at 8:06
born to hula
asked Aug 9, 2010 at 7:01
born to hulaborn to hula
1,2866 gold badges19 silver badges36 bronze badges
1 Answer
Reset to default 8Either you need to expand the div to the size you want before creating the map, or you need to use
google.maps.event.trigger(map, 'resize')
to make the API aware that the size of the container has changed.
本文标签: javascriptGoogle Maps APIResizing generates blank white spaceStack Overflow
版权声明:本文标题:javascript - Google Maps API - Resizing generates blank white space - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742389160a2465642.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论