On Wednesday, October 5, 2011, Jachym Cepicky <jachym.cepi...@gmail.com>
wrote:
> Hi,
>
> it probably would be nice to have ExtJS-like possibility to initialize
objects (I would start with layers).
>
> Now, you *have* to create instance of OpenLayers.Layer and than the object
can be added to map
>
> map.addLayer(new OpenLayers.Layer.WMS(name,url, params, options));
>
> What do you think about a option, that you would have to submit
object-like definition only:
>
> map addLayer({
>        CLASS_NAME: "OpenLayers.Layer.WMS",
>        name: "my name",
>        params: {
>                        layers: "0",
>                        version: "1.3.0"
>                },
>        options: {
>                        isBaseLayer: false
>                }
>        });
>
> It should not be too complicated to put such method in OpenLayers.Map
object.
>
> What do you think, shall I write some proposal-patch, or do all agree,
that it is not needed at all?

The problem is that our layer constructors don't have the same signature.
E.g. Layer.WMS receives four args, while Layer.WMTS receives one arg only.
Until we generalize 1-arg constructors I would personally not bother adding
lazy instantiation. Just my current viewport.

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemo...@camptocamp.com
http://www.camptocamp.com
_______________________________________________
Dev mailing list
d...@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/openlayers-dev

Reply via email to