|
| 1 | +# ol-layerswitcherimage-control |
| 2 | + |
| 3 | +> A control for switching between layers. |
| 4 | +
|
| 5 | +To see the correct thumbnail images, you may have to set the property `imagerySet` (e. g. for usage with [BingMaps](../../sources/bing/)). |
| 6 | + |
| 7 | +## Demo |
| 8 | + |
| 9 | +See [Demo page for all Map Controls](../index.md) |
| 10 | + |
| 11 | +## Properties |
| 12 | + |
| 13 | +### selection |
| 14 | + |
| 15 | +enable layer selection when click on the title |
| 16 | + |
| 17 | +- **Type**: `boolean` |
| 18 | + |
| 19 | +### displayInLayerSwitcher |
| 20 | + |
| 21 | +function that takes a layer and return a boolean if the layer is displayed in the switcher, default test the displayInLayerSwitcher layer attribute |
| 22 | + |
| 23 | +- **Type**: `function` |
| 24 | + |
| 25 | +### show_progress |
| 26 | + |
| 27 | +show a progress bar on tile layers |
| 28 | + |
| 29 | +- **Type**: `boolean` |
| 30 | +- **Default**: `false` |
| 31 | + |
| 32 | +### mouseover |
| 33 | + |
| 34 | +show the panel on mouseover |
| 35 | + |
| 36 | +- **Type**: `boolean` |
| 37 | +- **Default**: `false` |
| 38 | + |
| 39 | +### reordering |
| 40 | + |
| 41 | +allow layer reordering |
| 42 | + |
| 43 | +- **Type**: `boolean` |
| 44 | +- **Default**: `true` |
| 45 | + |
| 46 | +### trash |
| 47 | + |
| 48 | +add a trash button to delete the layer |
| 49 | + |
| 50 | +- **Type**: `boolean` |
| 51 | +- **Default**: `false` |
| 52 | + |
| 53 | +### oninfo |
| 54 | + |
| 55 | +callback on click on info button, if none no info button is shown DEPRECATED: use on(info) instead |
| 56 | + |
| 57 | +- **Type**: `function` |
| 58 | + |
| 59 | +### extent |
| 60 | + |
| 61 | +add an extent button to zoom to the extent of the layer |
| 62 | + |
| 63 | +- **Type**: `boolean` |
| 64 | + |
| 65 | +### onextent |
| 66 | + |
| 67 | +callback when click on extent, default fits view to extent |
| 68 | + |
| 69 | +- **Type**: `function` |
| 70 | + |
| 71 | +### drawDelay |
| 72 | + |
| 73 | +delay in ms to redraw the layer (usefull to prevent flickering when manipulating the layers) |
| 74 | + |
| 75 | +- **Type**: `number` |
| 76 | + |
| 77 | +### collapsed |
| 78 | + |
| 79 | +collapse the layerswitcher at beginning |
| 80 | + |
| 81 | +- **Type**: `boolean` |
| 82 | +- **Default**: `true` |
| 83 | + |
| 84 | +### layerGroup |
| 85 | + |
| 86 | +a layer group to display in the switcher, default display all layers of the map |
| 87 | + |
| 88 | +- **Type**: `ol.layerGroup` |
| 89 | + |
| 90 | +### noScroll |
| 91 | + |
| 92 | +prevent handle scrolling |
| 93 | + |
| 94 | +- **Type**: `boolean` |
| 95 | +- **Default**: `false` |
| 96 | + |
| 97 | +### onchangeCheck |
| 98 | + |
| 99 | +optional callback on click on checkbox, you can call this method for doing operations after check/uncheck a layer. |
| 100 | +Layers attributes that control the switcher. |
| 101 | + |
| 102 | +- `allwaysOnTop` {`boolean`} true to force layer stay on top of the others while reordering, default `false` |
| 103 | +- `displayInLayerSwitcher` {`boolean`} display the layer in switcher, default `true` |
| 104 | +- `noSwitcherDelete` {`boolean`} to prevent layer deletion (w. trash option = `true`), default `false` |
| 105 | + |
| 106 | +- **Type**: `function` |
0 commit comments