If this weren't being done inside of the Constructor then I'd agree w/ you 100%. However when done at time of construction setting the property vs using the setter are exactly the same. Otherwise, what good is there in setting params in the constructor? (that was a rhetorical question).
-chad Raja_Kajiev wrote: > > I don't have the OL code by my hand right now to check it out, but if > for some reason there is a setter defined for a property it is better > to use that setter instead of changing property directly. > There may be nothing critical for, say, GeoRSS layer, but handling > Google layer may be more complicated than just "now we draw this, now > we don't": it may reflect a tile loading, zoom level selection and so > on. > So, I'm doing this just in case :) > > dixi > > 2009//2 HKChad (via Nabble) <[email protected]>: >> Why is that better? Is it another way? Sure. Is it better? Not so sure, >> Why? >> The solution I posted just shows how to set the visibility at time of >> Layer >> construction. So if you do it 'your way' and set visibility prior to >> adding >> the layer to the map, it makes no difference. Just curious as to why you >> think it's 'better'. > >> Raja_Kajiev wrote: >> IMO, better way is to use setter: >> >> ce.setVisibility(false); >> >> Barker, Doug wrote: >> Hi, >> How do I have the overlays in a map turned off when the map starts up? >> ... >> >> ________________________________ >> This email is a reply to your post @ >> http://n2.nabble.com/How-to-have-overlays-off-by-default-tp3191421p3195235.html >> You can reply by email or by visting the link above. >> >> > > > > -- > LinkedIn: http://www.linkedin.com/pub/aleksey-smirnov/13/598/3b3 > > -- View this message in context: http://n2.nabble.com/How-to-have-overlays-off-by-default-tp3191421p3215380.html Sent from the OpenLayers Users mailing list archive at Nabble.com. _______________________________________________ Users mailing list [email protected] http://openlayers.org/mailman/listinfo/users
