[OpenLayers-Users] Layer.clone()

Matt Williamson matthewdw at gmail.com
Sat Apr 26 22:41:04 EDT 2008


Chris,

Thanks for the reply. I'm willing to try and provide a patch, but I  
should probably make certain I'm making it do the right thing. So far,  
my assumptions are that a cloned layer should be identical to the  
source layer except for the following:

1. Should have a different, unique "id" property
2. Should have the "map" property cleared (as Layer.clone does, but  
Layer.Image.clone does not)

Anything else? You guys are far more familiar with the nuts and bolts  
than I am, so I don't know what other properties might need to be made  
unique or initialized.

-Matt



On Apr 26, 2008, at 6:13 PM, Christopher Schmidt wrote:

> On Sat, Apr 26, 2008 at 06:06:53PM -0600, Matt Williamson wrote:
>> Hello list,
>>
>> Questions about Layer.clone(): Is it supposed to work? I'm having
>> major problems with it. My use-case is, I have a set of pre-defined
>> layers in an included .js file, but I want users to be able to add
>> multiple maps to a page, two or more of which may use the same layer.
>
> Without doing any specific research, I will say that Layer.WMS clone
> should work, and I'm surprised it doesn't, but ingenerla that lcone is
> one of the less commonly used methods, and I'm not entirely surprised
> that it's not working for you.
>
> Patches, are of course, welcome: there are no known outstanding issues
> with loning, but we don't use it often, so I wouldn't be surprised to
> hear bugs.
>
> Regards,
> -- 
> Christopher Schmidt
> MetaCarta




More information about the Users mailing list