-
Notifications
You must be signed in to change notification settings - Fork 229
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
example and properties of osm source
- Loading branch information
1 parent
a6b6bfe
commit 58c4fdb
Showing
1 changed file
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,60 @@ | ||
# vl-source-osm | ||
|
||
> Source layer ready to load OpenStreetMaps tiles | ||
`vl-source-osm` is a convenience layer built on top of [vl-source-xyz](/docs/component/xyz-source.md) ready to load tiles from OpenStreetMaps. | ||
|
||
## ES6 Module | ||
|
||
```javascript | ||
import { OsmSource } from 'vuelayers' | ||
|
||
Vue.use(OsmSource) | ||
``` | ||
|
||
## Usage | ||
|
||
Loading a simple OSM base layer. | ||
|
||
<vuep template="#usage-example"></vuep> | ||
|
||
<script v-pre type="text/x-template" id="usage-example"> | ||
<template> | ||
<vl-map :load-tiles-while-animating="true" :load-tiles-while-interacting="true" style="height: 400px"> | ||
<vl-view :zoom.sync="zoom" :center.sync="center" :rotation.sync="rotation"></vl-view> | ||
|
||
<vl-layer-tile id="osm"> | ||
<vl-source-osm></vl-source-osm> | ||
</vl-layer-tile> | ||
</vl-map> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
data () { | ||
return { | ||
zoom: 2, | ||
center: [0, 0], | ||
rotation: 0, | ||
} | ||
}, | ||
} | ||
</script> | ||
</script> | ||
|
||
## Properties | ||
|
||
### attributions | ||
|
||
- **Type**: `string, array` | ||
- **Default**: `© <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.` | ||
|
||
### max-zoom | ||
|
||
- **Type**: `number` | ||
- **Default**: `19` | ||
|
||
### url | ||
|
||
- **Type**: `string` | ||
- **Default**: `https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png` |