ZachPhillipsGary / google-maps-utility-library-v3

Automatically exported from code.google.com/p/google-maps-utility-library-v3
Apache License 2.0
0 stars 0 forks source link

Problems with MarkerWithLabel styles in Firefox #142

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi everyone,
When using Firefox (version 8.0.1 on Mac OS Lion), styles are not properly 
displayed (background-color and white-space at least, 'border' appears 
properly). This problem does not affect Chrome or Safari (in their latest 
versions). I didn't try Internet Explorer.
I'm using the following code to create a marker.

     var marker = new MarkerWithLabel({
       position: point, 
       map: map, 
       draggable: false,
       raiseOnDrag: false,
       icon: 'img/custom_icon.png',
       labelContent: 'whatever content',
       labelStyle: {'background-color': '#FFFFFF', 'color': 'black', 'border': '1px solid #000000', 'white-space': 'nowrap', 'padding': '2px', 'text-align': 'center'},
       labelAnchor: new google.maps.Point(-14, 34),
       labelInBackground: true
     });

Please note that 'position: point' and 'map: map' refer to variables properly 
declared and initialized before.

I'm using MarkerWithLabel version 1.1.5.

How can we solve this?
I know some javascript, but I can't imagine what is causing this 'error'.

Thank you all. Bye.

Original issue reported on code.google.com by sebastia...@gmail.com on 23 Nov 2011 at 12:38

GoogleCodeExporter commented 9 years ago
I believe the problem is that you're using the CSS names for the styles instead 
of the Javascript names in the labelStyle object. Javascript uses camel case 
instead of hyphenated names.

So use "backgroundColor" instead of "background-color" and "whiteSpace" instead 
of "white-space" and "textAlign" instead of "text-align".

Original comment by garylitt...@gmail.com on 27 Feb 2012 at 4:35