The error in a Mootools script doesn't happen when there is no error
with the openInfoWindowHtml;

I've tried to change the code a bit:

$description = htmlspecialchars($advertiser->description);
$description = nl2br($description);

$content = '<h7>'.$advertiser->name.'<\/h7> <div>' .$description . '<\/
div>';

echo "var marker" . $i . " = new GMarker(new GLatLng(".$advertiser-
>googlemap_lt.",".$advertiser->googlemap_ln."), markerOptions);

map.addOverlay(marker" . $i . ");
GEvent.addListener(marker" . $i . ",'mouseover',function(){
         marker" . $i . ".openInfoWindowHtml('". $content ."');
});

GEvent.addListener(marker" . $i . ",'mouseout',function(){
});";

now after the nl2br is called the line breaks get replaced with <br />
but for some reason when I look at the code behind it looks like this:

map.addOverlay(marker1);
30GEvent.addListener(marker1,'mouseover',function(){
31 marker1.openInfoWindowHtml('<h7>Hemingway Bar<\/h7> <div>The right
combination of a neighborhood bar<br />
32and a pick-up bar,2 floors,<br />
33one is the major bar and the other is a smoking lounge.<br />
34Reines st. 2, Dizengoff Square.<br />
35054-8016580<\/div>');
36});

so there are the <br /> tags and than a line break.

Any ideas why?

thanks

(I've comment the code because it's a life site)

On May 27, 12:20 pm, Andrew Leach <[email protected]> wrote:
> On May 27, 9:03 am, shani1351 <[email protected]> wrote:
>
>
>
> > How to I suppose to handle the content I get from the db with line
> > breaks?
>
> Don't know. It's not a maps problem, and what you have quoted should
> work.
>
> I get an error in a Mootools script when it creates the booking
> calendar at the bottom, so it's difficult to debug anything. That's
> not a maps issue either.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-api?hl=en.

Reply via email to