nmn22601 nmn22601 - 4 months ago 18
HTML Question

google map infowindow description needs line breaks

I am having trouble getting to show linebreaks in the description area of my infowindow. I have tried adding

<br/>
in the description but that does not
work.

Here is what I have

var bubbleText = '<div class="bubble-container shadow"><div class="img-container"><img src="placeholder1.png" alt="Location image"/></div><div class="info-container"><h2>' + kmlLayerEvent.featureData.name + '</h2><p>' + kmlLayerEvent.featureData.description.split("<br />")[0] + '</p><a href="' + re_result[0] + '" target="_blank">View Brochure</a></div></div>';


http://capitalretailproperties.com/map/map.php

Answer

instead of <br /> use <br>

replace

 + kmlLayerEvent.featureData.description.split("<br />")[0] + 

with

 + kmlLayerEvent.featureData.description.split("<br>")[0] + 
Comments