- How several layers make one map.
- The properties you use on almost every layer:
title,visibility,opacity. - Where to find every other property of a layer.
A map is usually several maps on top of each other - the relief, the borders, a theme. In a query, each one is a layer: one entry of the list, between { }, separated by commas.
The query 22 lines · runs as is
// Several layers: three maps in one query, each with its own title, opacity and starting state.
// Every entry of the array is one layer. visibility: false keeps a layer listed but off -
// the reader turns it on in the layer list. opacity goes from 0 (invisible) to 1.
[
{
name: "CSR:altimetria",
title: "Elevation",
visibility: true,
opacity: 0.8,
},
{
name: "CSR:estados",
title: "States",
visibility: true,
opacity: 0.5,
},
{
name: "CSR:biomassa_baccini_bioma_am",
title: "Forest biomass (Amazon) - turn it on",
visibility: false,
},
];The properties you will use most
| Property | What it does | In the example |
|---|---|---|
name | The published map (step 3 says where names come from) | "CSR:altimetria" - elevation |
title | The name of the layer in the menus | "Elevation" |
visibility | true: drawn when the map opens. false: off, until the reader switches it on in the top menu | The biomass layer starts off |
opacity | From 0 (invisible) to 1 (opaque) | The states at 0.5 let the relief show through |
The reader decides too. The top menu lists every layer with a switch - layers that are not in a group are under Maps (step 6 makes groups) - and the panel on the left lists the layers switched on there, each with an eye button that hides it without taking it off the panel.
And the rest
A layer accepts many more properties - a thumbnail for the layer list (thumbUrl), the scale range where it is drawn (minscale, maxscale), which of its styles to use (styles). You do not need them to start. Some belong to one kind of layer only: the calculated, file and tile layers of steps 4 and 5 also get a panel of their own, with text, controls and row buttons, which a published map like these does not have. Every property is listed, with its type and an example, in the property catalogue and the API reference.
Read more
- Layer and group property catalogue - every property a layer accepts
- Where to find it - which part of the API to open
- The layer and group model - presentation properties, in one place