-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
22 changed files
with
20,122 additions
and
2 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.idea | ||
node_modules | ||
dist/demo.html |
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Changelog | ||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
<!-- | ||
## [Unreleased] - YYYY-MM-DD | ||
### Added | ||
- new feature | ||
### Changed | ||
- existing functionality | ||
### Deprecated | ||
- soon-to-be removed feature | ||
### Removed | ||
- now_removed_feature | ||
### Fixed | ||
- bug | ||
### Security | ||
- in case of vulnerabilities | ||
--> | ||
|
||
## [v0.1.0] - 2019-12-05 | ||
Initial Version of the vue2-leaflet-height-graph plugin |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2019 HeiGIT | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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,2 +1,107 @@ | ||
# vue2-leaflet-heightgraph | ||
Leaflet.Heightgraph plugin extension for vue2-leaflet package | ||
# vue2-leaflet-height-graph | ||
|
||
This is a [Vue2Leaflet](https://github.com/KoRiGaN/Vue2Leaflet) plugin to provide the | ||
[Leaflet.Heightgraph](https://github.com/GIScience/Leaflet.Heightgraph) control | ||
on [Leaflet](https://leafletjs.com/) maps in [Vue](https://vuejs.org/) applications. | ||
|
||
|
||
## Installation | ||
```bash | ||
npm install --save vue2-leaflet-height-graph | ||
``` | ||
|
||
## Import | ||
You could either import the component locally where you need it or register it globally. | ||
|
||
### Local | ||
In a `.vue` file: | ||
```vue | ||
<script> | ||
import LControlHeightGraph from 'vue2-leaflet-height-graph' | ||
// ... | ||
export default { | ||
// ... | ||
components: { 'l-height-graph': LControlHeightGraph } | ||
// ... | ||
} | ||
</script> | ||
<style> | ||
@import "~vue2-leaflet-height-graph/dist/Vue2LeafletHeightGraph.css"; | ||
</style> | ||
// ... | ||
``` | ||
|
||
### Global | ||
In your `main.js`: | ||
```js | ||
import Vue from 'vue'; | ||
import Vue2LeafletHeightGraph from 'vue2-leaflet-height-graph'; | ||
import 'vue2-leaflet-heightgraph/dist/Vue2LeafletHeightGraph.css' | ||
// ... | ||
Vue.component('l-height-graph', Vue2LeafletHeightGraph); | ||
// ... | ||
``` | ||
|
||
## Usage | ||
|
||
With the `LControlHeightGraph` component loaded into Vue, add the | ||
`l-height-graph` element inside an `l-map`. | ||
|
||
```html | ||
<l-map> | ||
<l-height-graph | ||
:data="heightGraphData" | ||
:options="{ width: 1000, position: 'bottomleft'}"/> | ||
<!-- other map components --> | ||
</l-map> | ||
``` | ||
|
||
## Properties | ||
The following properties can be passed to the `LControlHeightGraph` component: | ||
|
||
### data | ||
Takes an array of GeoJSON FeatureCollections as described | ||
in the [Leaflet.Heigthgraph Readme](https://github.com/GIScience/Leaflet.Heightgraph/#supported-data) | ||
by default. | ||
|
||
Specify the `parser` property to use other Array or Object input formats. | ||
|
||
Currently supported formats for parser values: | ||
- `'ors'`: The response of the [openrouteservice directions endpoint](https://openrouteservice.org/dev/#/api-docs/v2/directions/{profile}/geojson/post) | ||
in geojson fromat. Don't forget to set `elevation=true`. | ||
|
||
Other relevant formats can be made available by contributing a parser. | ||
|
||
examples: see [data folder](./src/data) | ||
|
||
default: `[]` | ||
### options | ||
Use the `options` property to specify any of the | ||
[Leaflet.Heightgraph options](https://github.com/GIScience/Leaflet.Heightgraph#default-options) | ||
to be set when the control is created. | ||
|
||
If no options are specified the default options from Leaflet.Heightgraph are used. | ||
|
||
example: | ||
```js | ||
{ width: 1000, position: 'bottomleft'} | ||
``` | ||
|
||
### position | ||
String to set the position on the map. Values can be `'bottomleft'`, `'bottomright'`, `'topleft'`, `'topright'`. | ||
Fast setting for `options.position` (overwriting). | ||
|
||
### expand | ||
Boolean for expanding the heightgraph window on creation. Values are `true` and `false`. | ||
Fast setting for `options.expand` (overwriting). | ||
|
||
### parser | ||
Set the name of the parser function as String to support different `data` input. | ||
|
||
Available parsers: | ||
- `'normal'` | ||
- `'ors'` | ||
|
||
If you want to support relevant elevation data, consider contributing a parser function. | ||
|
||
default: `'normal'` |
Oops, something went wrong.