Fixed
Status Update
Comments
al...@gmail.com <al...@gmail.com> #2
Any chance this could be reviewed by anyone? This is a very reproducible bug that
has frustrating and unintuitive user interface repercussions. I wrote the 2kb proof
bug using only code found on the official Google Example documents.
has frustrating and unintuitive user interface repercussions. I wrote the 2kb proof
bug using only code found on the official Google Example documents.
lo...@gmail.com <lo...@gmail.com> #3
I've been struggling with this issue for a while and I was hopping it had been fixed
by now, but apparently not. In my experience it has little to do with whether the
content is a string or a Node and has more to do with the complexity of the HTML
passed in as content. The more involved the HTML is, the less likely the infoWindow
is to render correctly the first time it is opened. And I don't know if this is the
case for everybody else, but for me the infoWindow always renders correctly the
second time I open it.
The workaround I use to deal with this problem is to enclose the HTML content in a
<div> CSS-styled with 'visibility: hidden;'. The first time the infoWindow's
domready is triggered, I trigger a 'content_changed' event. On subsequent infoWindow
domready events, I restyle the <div> with 'visibility: visible;':
// .css for infowindowcontent:
// .infowindowcontent {visibility: hidden;}
var html = '<div class="infowindowcontent">' + complexhtml + '</div>';
var infowindow = new google.maps.InfoWindow({
content: html
});
infowindow.set("redrawn", false);
google.maps.event.addListener(infowindow, "domready", function() {
if (infowindow.get("redrawn")) {
jQuery('.infowindowcontent').css('visibility', 'visible');
}
else {
google.maps.event.trigger(infowindow, 'content_changed');
infowindow.set("redrawn", true);
}
});
Works every time--no more partially rendered infoWindows. Hope this helps.
by now, but apparently not. In my experience it has little to do with whether the
content is a string or a Node and has more to do with the complexity of the HTML
passed in as content. The more involved the HTML is, the less likely the infoWindow
is to render correctly the first time it is opened. And I don't know if this is the
case for everybody else, but for me the infoWindow always renders correctly the
second time I open it.
The workaround I use to deal with this problem is to enclose the HTML content in a
<div> CSS-styled with 'visibility: hidden;'. The first time the infoWindow's
domready is triggered, I trigger a 'content_changed' event. On subsequent infoWindow
domready events, I restyle the <div> with 'visibility: visible;':
// .css for infowindowcontent:
// .infowindowcontent {visibility: hidden;}
var html = '<div class="infowindowcontent">' + complexhtml + '</div>';
var infowindow = new google.maps.InfoWindow({
content: html
});
infowindow.set("redrawn", false);
google.maps.event.addListener(infowindow, "domready", function() {
if (infowindow.get("redrawn")) {
jQuery('.infowindowcontent').css('visibility', 'visible');
}
else {
google.maps.event.trigger(infowindow, 'content_changed');
infowindow.set("redrawn", true);
}
});
Works every time--no more partially rendered infoWindows. Hope this helps.
to...@gmail.com <to...@gmail.com> #4
This bug report relates solely to different rendering of content while set through a
string and a Node. If there are other cases when infoWindow borders are rendered
incorrectly, please report them as a individual bugs.
Here are links for the very same content, buggy - set through a node, and 2 working
ones set through a string (2nd one includes even the grouping div, to make sure that
is not the cause for different rendering):
http://www.artprodesign.com/gmaps-example1
http://www.artprodesign.com/gmaps-example1-string1.html
http://www.artprodesign.com/gmaps-example1-string2.html
string and a Node. If there are other cases when infoWindow borders are rendered
incorrectly, please report them as a individual bugs.
Here are links for the very same content, buggy - set through a node, and 2 working
ones set through a string (2nd one includes even the grouping div, to make sure that
is not the cause for different rendering):
Description
<p>, <h3>, ......... then bottom margin is too small (practically non-existent)
<div>, <span> ...... then bottom margin is too large
<br />, <hr /> ..... then the margins work correctly
When the content is set through string (e.g. obtained through innerHTML
property), rather than through element (e.g. obtained by cloneNode method),
all seems fine.
Some links: