Map
<sl-map> | SlMap
A Map Component based on the open source library leaflet
<sl-map apikey="pk.eyJ1IjoieGVvbjIwMDMiLCJhIjoiY2t3a2N2dHA3MXF3bzJvcG1lNzFhbjYwZCJ9.AAh_q4VGHEbVHwZOi_xK5Q" ></sl-map>
Examples
Add some Pins
TODO
Add Google Maps link to Points
TODO
Importing
If you’re using the autoloader or the traditional loader, you can ignore this section. Otherwise, feel free to use any of the following snippets to cherry pick this component.
To import this component from the CDN using a script tag:
<script type="module" src="https://cdn.jsdelivr.net/npm/@viur/shoelace@1.0.8-v2.18.0/cdn/components/map/map.js"></script>
To import this component from the CDN using a JavaScript import:
import 'https://cdn.jsdelivr.net/npm/@viur/shoelace@1.0.8-v2.18.0/cdn/components/map/map.js';
To import this component using a bundler:
import '@viur/shoelace/dist/components/map/map.js';
To import this component as a React component:
import SlMap from '@viur/shoelace/dist/react/map';
Slots
Name | Description |
---|---|
(default) | The default slot. |
example
|
add Poi in this slot. |
Learn more about using slots.
Properties
Name | Description | Reflects | Type | Default |
---|---|---|---|---|
apikey
|
mapbox apikey |
|
string
|
''
|
showAddress
|
Use MapBox api for adresses |
|
boolean
|
true
|
latitude
|
Start latitude |
|
number
|
51.515
|
longitude
|
Start longitude |
|
number
|
7.465
|
updateComplete |
A read-only promise that resolves when the component has finished updating. |
Learn more about attributes and properties.
Parts
Name | Description |
---|---|
base |
The component’s map wrapper. |
Learn more about customizing CSS parts.