Comment définir la taille et la largeur d'une carte google InfoWindow
? J'ai regardé on the api page et seulement trouvé une méthode maxWidth
.Google Map .InfoWindow Définir la hauteur et la largeur
Modifier: J'ai essayé quelques petites choses. Jusqu'à présent, aucun de ces travaux:
var markerInfoWindow = new google.maps.InfoWindow({
content: markerHTMLString,
maxHeight: 400, //Doesn't work
maxWidth: 400, //Doesn't work
width: 300, //Doesn't work
height: 300 //Doesn't work
});
disent aussi markerHTMLString
est égal à ceci:
<div class = "MarkerPopUp"><div class = "MarkerContext">Text</div></div>
J'ai essayé ces trois options aussi bien (aucun d'entre eux a travaillé)
.MarkerPopUp { height: 300px; width: 300px; }
.MarkerPopUp { height: 300px; width: 300px; } .MarkerContext { height: 300px; width: 300px; }
.MarkerContext { height: 300px; width: 300px; }
Cela aussi ne fonctionnera pas:
document.getElementById('MarkerPopUp')parentNode.style.overflow = '';
ou cette
document.getElementById('MarkerPopUp').parentNode.parentNode.style.overflow = '';
Je suis à peu près traversais chaque fil que je peux trouver et tout essayer. Simplement pour limiter certaines choses (bien qu'il puisse y avoir un autre problème)
Vous pouvez utiliser CSS, CSS inline ou modification JS. Résumées quelques solutions dans un autre thread: https://stackoverflow.com/a/48610923/4378314 – MarsAndBack