Reputation: 33
I noticed that in the last few months google maps has changed its API and the info window that shows up when one clicks on a marker is rendered differently now.
https://developers.google.com/maps/documentation/javascript/examples/infowindow-simple
There is a weird div that appears during inspection:
Would like the info window the margin on top of the text to be removed and to like this (as it was before the recent changes in google maps):
Upvotes: 0
Views: 52
Reputation: 7338
This is the new info window header content section.
Check the InfoWindow options docs here: Docs
So you have could hide the header content by setting headerDisabled
to true.
but this would hide the closed button.
const infowindow = new google.maps.InfoWindow({
content: contentString,
ariaLabel: "Uluru",
headerDisabled: true
});
Second option is to use the headerContent
to render a header.
var header = document.createElement('h1');
header.append("Uluru")
const infowindow = new google.maps.InfoWindow({
content: contentString,
ariaLabel: "Uluru",
//headerDisabled: true
headerContent: header
});
Upvotes: 1
Reputation: 1447
There are probably more than one anwser. This first that came to my mind would be to make .gm-style-iw-chr absolute:
.gm-style-iw-chr {
position: absolute;
right: 0;
}
Upvotes: 1