Google Map markers text not formated properly in FireFox

I'm using the Blueprints Ajax Map Viewer component to add a Google Map to one of my pages. This istoo cool! It really makes using Google Maps easy.

However I have a display problem in FireFox. The map has MapMarkers with markup. When you click on a marker the Info Window "balloon" is displayedwith the markup text. In IE, the Info Window is nicely wrapped. However, in FireFox, the text is displayed one word per line. So in IE it looks like:

My Marker

Description of my marker.

But, in FireFox

My

Marker

Description

of

my

marker.

Here's an actual example of the "markup."

<b>Downtown Danville</b>

Parking. Water. Restroom (in Caboose!). Museum.

I suspect it is a style problem, but don't know where to start to troubleshoot. Do I have to dig into the Themes? Any Ideas?

Cheers

Dan

[911 byte] By [dkible] at [2007-11-26 9:31:24]
# 1

Thank you for bringing this to the forum. One of our developers suggests replacing all spaces with non-breaking spaces ( ) and provides the following code associated with the component catalog found at http://developers.sun.com/ajax/componentscatalog.jsp:

public String button1_action() {

String userLocation = (String)this.selectValue1.getValue();

if (userLocation != null) {

GeoPoint userPoint = (GeoPoint)getSessionBean1().getGeoPoints().get(userLocation);

if (userPoint != null) {

double latitude = userPoint.getLatitude();

double longitude = userPoint.getLongitude();

this.mapViewer1_center.setLatitude(latitude);

this.mapViewer1_center.setLongitude(longitude);

renderMapViewer = true;

String m = formatMarker(userPoint.toString());

MapMarker marker = new MapMarker(latitude, longitude, m);

this.mapViewer1.setMarkers( new MapMarker[] {marker} );

//this.mapViewer1.setInfo(marker);

}

} return null;

}

private String formatMarker(String text) {

text = "<b>" + text + "</b>";

text = "Location shown:
" + text;

text = text.replaceAll(" ", " ");

return text;

}

Our tutorial will also be updated shortly. I hope this helps.

~Joe Silber

Java Studio Creator Documentation

Bishop at 2007-7-7 0:16:39 > top of Java-index,Development Tools,Java Tools...
# 2
JoeThat's just the ticket. Works great. Thanks.Unfortunately I'm now getting an unrelated (I think) javascript syntax error in IE :-(I'll do some debugging and post a new message if necessary.-Dan
dkible at 2007-7-7 0:16:39 > top of Java-index,Development Tools,Java Tools...
# 3
Btw, in the email version of your code the second string param in the replaceAll method is the code for a non-breaking space, but in the forum it shows as just a space.Should be text = text.replaceAll(" ", "&nbsp");
dkible at 2007-7-7 0:16:39 > top of Java-index,Development Tools,Java Tools...
# 4
I'm glad it works - please let us know how the debugging for IE goes.Thanks kindly for pointing out that nbsp issue - I'll make sure to escape those characters next time.
Bishop at 2007-7-7 0:16:39 > top of Java-index,Development Tools,Java Tools...
# 5
It should actually be &nbsp; (note the ending semicolon)--it showed up as just a space in the earlier posting because, of course, the forum page is a web page.
mbohm at 2007-7-7 0:16:39 > top of Java-index,Development Tools,Java Tools...
# 6
Right you are:text = text.replaceAll(" ", "&nbsp;");
dkible at 2007-7-7 0:16:39 > top of Java-index,Development Tools,Java Tools...