[OpenLayers-Users] specifying options for OL class properties--when to use quotes?

Christopher Schmidt crschmidt at metacarta.com
Wed Jul 23 12:52:48 EDT 2008


On Wed, Jul 23, 2008 at 12:42:35PM -0400, Mike Quentel wrote:
> In some of the examples, when adding a Layer, I see some properties
> (options) have quotes (single or double).  What is the general rule for
> using quotes on the properties?  
> 
> Is this correct: 
> 
> {buffer: 2, gutter: 15, sphericalMercator: true, attribution: "some
> label"}
> 
> or should it be this:
> 
> {'buffer': 2, 'gutter': 15, 'sphericalMercator': true, 'attribution':
> "some label"}

It makes no difference, except in a case here one of your 'keys' is a
javascript reserved word (like 'class' or 'function').

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list