Skip to content

Commit 6ce3ca5

Browse files
Release v0.1.0
Initial release
1 parent 4102452 commit 6ce3ca5

22 files changed

+20122
-2
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.idea
2+
node_modules
3+
dist/demo.html

CHANGELOG.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Changelog
2+
All notable changes to this project will be documented in this file.
3+
4+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6+
7+
<!--
8+
## [Unreleased] - YYYY-MM-DD
9+
10+
### Added
11+
- new feature
12+
13+
### Changed
14+
- existing functionality
15+
16+
### Deprecated
17+
- soon-to-be removed feature
18+
19+
### Removed
20+
- now_removed_feature
21+
22+
### Fixed
23+
- bug
24+
25+
### Security
26+
- in case of vulnerabilities
27+
28+
-->
29+
30+
## [v0.1.0] - 2019-12-05
31+
Initial Version of the vue2-leaflet-height-graph plugin

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019 HeiGIT
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 107 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,107 @@
1-
# vue2-leaflet-heightgraph
2-
Leaflet.Heightgraph plugin extension for vue2-leaflet package
1+
# vue2-leaflet-height-graph
2+
3+
This is a [Vue2Leaflet](https://github.com/KoRiGaN/Vue2Leaflet) plugin to provide the
4+
[Leaflet.Heightgraph](https://github.com/GIScience/Leaflet.Heightgraph) control
5+
on [Leaflet](https://leafletjs.com/) maps in [Vue](https://vuejs.org/) applications.
6+
7+
8+
## Installation
9+
```bash
10+
npm install --save vue2-leaflet-height-graph
11+
```
12+
13+
## Import
14+
You could either import the component locally where you need it or register it globally.
15+
16+
### Local
17+
In a `.vue` file:
18+
```vue
19+
<script>
20+
import LControlHeightGraph from 'vue2-leaflet-height-graph'
21+
// ...
22+
export default {
23+
// ...
24+
components: { 'l-height-graph': LControlHeightGraph }
25+
// ...
26+
}
27+
</script>
28+
<style>
29+
@import "~vue2-leaflet-height-graph/dist/Vue2LeafletHeightGraph.css";
30+
</style>
31+
// ...
32+
```
33+
34+
### Global
35+
In your `main.js`:
36+
```js
37+
import Vue from 'vue';
38+
import Vue2LeafletHeightGraph from 'vue2-leaflet-height-graph';
39+
import 'vue2-leaflet-heightgraph/dist/Vue2LeafletHeightGraph.css'
40+
// ...
41+
Vue.component('l-height-graph', Vue2LeafletHeightGraph);
42+
// ...
43+
```
44+
45+
## Usage
46+
47+
With the `LControlHeightGraph` component loaded into Vue, add the
48+
`l-height-graph` element inside an `l-map`.
49+
50+
```html
51+
<l-map>
52+
<l-height-graph
53+
:data="heightGraphData"
54+
:options="{ width: 1000, position: 'bottomleft'}"/>
55+
<!-- other map components -->
56+
</l-map>
57+
```
58+
59+
## Properties
60+
The following properties can be passed to the `LControlHeightGraph` component:
61+
62+
### data
63+
Takes an array of GeoJSON FeatureCollections as described
64+
in the [Leaflet.Heigthgraph Readme](https://github.com/GIScience/Leaflet.Heightgraph/#supported-data)
65+
by default.
66+
67+
Specify the `parser` property to use other Array or Object input formats.
68+
69+
Currently supported formats for parser values:
70+
- `'ors'`: The response of the [openrouteservice directions endpoint](https://openrouteservice.org/dev/#/api-docs/v2/directions/{profile}/geojson/post)
71+
in geojson fromat. Don't forget to set `elevation=true`.
72+
73+
Other relevant formats can be made available by contributing a parser.
74+
75+
examples: see [data folder](./src/data)
76+
77+
default: `[]`
78+
### options
79+
Use the `options` property to specify any of the
80+
[Leaflet.Heightgraph options](https://github.com/GIScience/Leaflet.Heightgraph#default-options)
81+
to be set when the control is created.
82+
83+
If no options are specified the default options from Leaflet.Heightgraph are used.
84+
85+
example:
86+
```js
87+
{ width: 1000, position: 'bottomleft'}
88+
```
89+
90+
### position
91+
String to set the position on the map. Values can be `'bottomleft'`, `'bottomright'`, `'topleft'`, `'topright'`.
92+
Fast setting for `options.position` (overwriting).
93+
94+
### expand
95+
Boolean for expanding the heightgraph window on creation. Values are `true` and `false`.
96+
Fast setting for `options.expand` (overwriting).
97+
98+
### parser
99+
Set the name of the parser function as String to support different `data` input.
100+
101+
Available parsers:
102+
- `'normal'`
103+
- `'ors'`
104+
105+
If you want to support relevant elevation data, consider contributing a parser function.
106+
107+
default: `'normal'`

0 commit comments

Comments
 (0)