LTileLayer
Load tiles from a map server and display them accordingly to map zoom, center and size.
Demo
vue
<LMap style="height: 350px" :zoom="8" :center="[47.21322, -1.559482]">
<!-- Base Layer -->
<LTileLayer
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
attribution="&copy; <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors"
layer-type="base"
name="OpenStreetMap"
/>
<!-- Overlay Layer -->
<LTileLayer
url="https://s3.amazonaws.com/te512.safecast.org/{z}/{x}/{y}.png"
attribution="<a href='https://blog.safecast.org/about/'>SafeCast</a> (<a href='https://creativecommons.org/licenses/by-sa/3.0/'>CC-BY-SA</a>"
:min-zoom="5"
:max-zoom="12"
/>
</LMap>
Props
Prop name | Description | Type | Required | Default |
---|---|---|---|---|
tms | If true , inverses Y axis numbering for tiles (turn this on for TMS services) | Boolean | - | false |
subdomains | Subdomains of the tile service. Can be passed in the form of one string (where each letter is a subdomain name) or an array of strings. | String|Array as String|String[] | - | 'abc' |
detectRetina | If true and user is on a retina display, it will request four tiles of half the specified size and a bigger zoom level in place of one to utilize the high resolution. | Boolean | - | false |
url | A string of the form 'https://{s}.somedomain.com/blabla/{z}/{x}/{y}{r}.png' . See more in the original Leaflet documentation | String | true | null |
Inherited props
from LGridLayer
Prop name | Description | Type | Required | Default |
---|---|---|---|---|
opacity | Opacity of the tiles | Number | - | 1.0 |
zIndex | The explicit zIndex of the tile layer | Number | - | 1 |
tileSize | Width and height of tiles in the grid. Use a number if width and height are equal, or L.point(width, height) otherwise. | Number|L.Point | - | 256 |
noWrap | Whether the layer is wrapped around the antimeridian. If true, the GridLayer will only be displayed once at low zoom levels. Has no effect when the map CRS doesn't wrap around. | Boolean | - | false |
childRender | Function | true | * | |
minZoom | The minimum zoom level down to which this layer will be displayed (inclusive) | Number | - | undefined |
maxZoom | The maximum zoom level up to which this layer will be displayed (inclusive) | Number | - | undefined |
className | A custom class name to assign to the tile layer. Empty by default. | String | - | '' |
from layer.ts
Prop name | Description | Type | Required | Default |
---|---|---|---|---|
pane | By default the layer will be added to the map's overlay pane. Overriding this option will cause the layer to be placed on another pane by default | String | - | 'overlayPane' |
attribution | String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers. | String | - | null |
name | String | - | - | |
layerType | String in ["base", "overlay"] | - | - | |
visible | Boolean | - | true |
from component.ts
Prop name | Description | Type | Required | Default |
---|---|---|---|---|
options | Leaflet options to pass to the component constructor | Object | - | {} |
Events
Event name | Type | Description |
---|---|---|
update:visible | boolean | Triggers when the visible prop needs to be updated |
ready | object | Triggers when the component is ready |