[OpenLayers-Users] Options in constructors - Beginner Question
Tim Schaub
tschaub at opengeo.org
Wed Mar 11 16:53:19 EDT 2009
Hey-
Jaume Figueras wrote:
> Hi,
>
> I can't find in the docs which are the options that can be configured in
> many constructors, and also, what they mean. I can figure out from some
> examples and try and error, but I can't find them in the docs.
>
> Can you link me where the options are explained?
In general, you can set the value of any API property in a contructor's
options argument.
For example, looking at the docs for the Vector layer [1], you can see
the isBaseLayer property. If you specify an isBaseLayer property in the
options argument, this will be set on the layer.
e.g.
var layer = new OpenLayers.Layer.Vector("not required", {
isBaseLayer: true
});
layer.isBaseLayer === true; // this is true
You can also see that the Vector layer inherits from OpenLayers.Layer.
Following the link to the Layer API docs [2], you'll find a reference to
the layer's projection property. As with isBaseLayer, if you provide a
projection property in the options argument, this value will be set on
the layer.
var layer = new OpenLayers.Layer.Vector("Layer Name", {
projection: new OpenLayers.Projection("EPSG:900913")
});
I've just committed this to the OpenLayers docs for future reference.
http://doc.openlayers.org/library/syntax.html
Tim
[1] http://dev.openlayers.org/apidocs/files/OpenLayers/Layer/Vector-js.html
[2] http://dev.openlayers.org/apidocs/files/OpenLayers/Layer-js.html
>
> Now I'm searching the pointRaduis and rules, so, what is pointRadius?
>
> Thank you,
>
> Best,
>
> Jaume.
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
--
Tim Schaub
OpenGeo - http://opengeo.org
Expert service straight from the developers.
More information about the Users
mailing list