简体   繁体   English

Google Maps InfoBox在IE中无法正确显示

[英]Google Maps InfoBox Not Displaying Correctly in IE

I can only post one link so here is a reference page with corresponding links: 我只能发布一个链接,所以这里是带有相应链接的参考页:

I am using a modified version of extinfowindow for Google Maps v3 (reference link 1) to display a custom infobox window for my markers. 我正在使用extinfowindow的修改版的Google Maps v3(参考链接1)来显示我的标记的自定义信息框窗口。 While I successfully implemented the InfoBox in v3, I ran into an issue with IE during testing. 当我在v3中成功实现InfoBox时,在测试过程中遇到了IE问题。 The infobox renders correctly in all browsers but IE. 该信息框可在除IE之外的所有浏览器中正确呈现。 However, if I view the infobox HTML directly with IE, it renders correctly. 但是,如果我直接使用IE查看信息框HTML,它将正确呈现。 But, when I view the infobox within the map (click on a marker), I see this: (reference link 2). 但是,当我查看地图中的信息框(单击标记)时,会看到以下内容:(参考链接2)。 The HTML file is at (reference link 3) and should render fine in any browser when viewed directly. HTML文件位于(参考链接3),并且在任何浏览器中直接观看时都可以正常显示。 The infobox javascript I am using is at (reference link 4). 我正在使用的信息框javascript位于(参考链接4)。

I am not sure why the display only messes up when rendered on the map in IE. 我不确定为什么只在IE中的地图上渲染时才会弄乱显示。 I have changed the positioning and class/id to check for any conflicts but have had no luck. 我已经更改了位置和班级/编号以检查是否有任何冲突,但是没有运气。 The positioning and backgrounds get messed up in IE no matter what I change. 不管我如何更改,IE中的位置和背景都会变得混乱。 I am missing something? 我想念什么吗? Please let me know if I need to give any extra information. 如果需要其他任何信息,请告诉我。

MSIE often needs the correct DOCTYPE to display things with precise alignments. MSIE通常需要正确的DOCTYPE才能以精确的对齐方式显示内容。

Try using 尝试使用

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd "> <!DOCTYPE html PUBLIC“-// W3C // DTD XHTML 1.0 Strict // EN”“ http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd ”>

The solution was to use inline CSS for the info window. 解决方案是将内联CSS用于信息窗口。 When rendering the info window HTML itself, IE processed the CSS correctly. 呈现信息窗口HTML本身时,IE正确处理了CSS。 However, when rendering the info window HTML on the map canvas, IE would ignore the tags and would only render inline CSS. 但是,当在地图画布上呈现信息窗口HTML时,IE会忽略标签,而只会呈现内联CSS。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM