yenbao1340 / gmaps-utility-library-dev

Automatically exported from code.google.com/p/gmaps-utility-library-dev
0 stars 0 forks source link

Need a setLabelText function in LabeledMarker #19

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
LabeledMarker could be improved by adding a routine which would allow an 
application to 
dynamically change the text of a label. This could be in response to a change 
in a preference 
setting check box, for example.

The fix is simple, add this function to the LabeledMarker Class:

LabeledMarker.prototype.setLabelText = function( newText ) {
    this.labelText_ = newText;
    this.div_.innerHTML = newText;
}

Also related to LabeledMarker 1.1, I notice that the show() and hide() routines 
alter the visibility 
style property.  I've always felt that it is best to alter the display property 
instead for showing 
(display: anything) and hiding (display: none) -- this should improve 
performance if you have 
lots of markers because the browser, when rendering a page, will ignore a 
display:none label div 
completely instead of having to calculate the size of the space to allocate for 
each 
visibility:hidden div.

However, I'm not sure what the show and hide code for a standard marker looks 
like -- I 
suppose if this code alters the visibility property, the code for 
hiding/showing the labels should 
follow suit. Or maybe the marker code should be changed??

Original issue reported on code.google.com by garylitt...@gmail.com on 8 Jan 2008 at 8:18

GoogleCodeExporter commented 8 years ago

Original comment by lem...@gmail.com on 23 May 2008 at 4:14

GoogleCodeExporter commented 8 years ago
Second idea moved to Issue 35.

Original comment by lem...@gmail.com on 26 May 2008 at 4:54

GoogleCodeExporter commented 8 years ago

Original comment by pamela.fox on 26 Dec 2008 at 10:34