Skip to content

Commit 211a10b

Browse files
committed
Version and readme updated
1 parent 0ed5b9f commit 211a10b

12 files changed

+67
-58
lines changed

.DS_Store

6 KB
Binary file not shown.

.babelrc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"presets": ["babel-preset-env", "stage-2"],
3-
"plugins": ["transform-class-properties"]
4-
}
2+
"presets": ["babel-preset-env", "stage-2"],
3+
"plugins": ["transform-class-properties"]
4+
}

README.md

Lines changed: 37 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -11,97 +11,107 @@ npm install --save vue2-leaflet-height-graph
1111
```
1212

1313
## Import
14+
1415
You could either import the component locally where you need it or register it globally.
1516

1617
### Local
18+
1719
In a `.vue` file:
20+
1821
```vue
1922
<script>
20-
import LControlHeightGraph from 'vue2-leaflet-height-graph'
23+
import LHeightGraph from 'vue2-leaflet-height-graph'
2124
// ...
2225
export default {
2326
// ...
24-
components: { 'l-height-graph': LControlHeightGraph }
27+
components: { 'l-height-graph': LHeightGraph }
2528
// ...
2629
}
2730
</script>
28-
<style>
29-
@import "~vue2-leaflet-height-graph/dist/Vue2LeafletHeightGraph.css";
30-
</style>
3131
// ...
3232
```
3333

3434
### Global
35+
3536
In your `main.js`:
37+
3638
```js
3739
import Vue from 'vue';
3840
import Vue2LeafletHeightGraph from 'vue2-leaflet-height-graph';
39-
import 'vue2-leaflet-heightgraph/dist/Vue2LeafletHeightGraph.css'
4041
// ...
4142
Vue.component('l-height-graph', Vue2LeafletHeightGraph);
4243
// ...
4344
```
4445

4546
## Usage
4647

47-
With the `LControlHeightGraph` component loaded into Vue, add the
48+
With the `LHeightGraph` component loaded into Vue, add the
4849
`l-height-graph` element inside an `l-map`.
4950

5051
```html
5152
<l-map>
52-
<l-height-graph
53-
:data="heightGraphData"
54-
:options="{ width: 1000, position: 'bottomleft'}"/>
53+
<l-height-graph :data="heightGraphData"/>
5554
<!-- other map components -->
5655
</l-map>
5756
```
5857

5958
## Properties
60-
The following properties can be passed to the `LControlHeightGraph` component:
59+
60+
The following properties can be passed to the `LHeightGraph` component:
6161

6262
### data
63+
6364
Takes an array of GeoJSON FeatureCollections as described
6465
in the [Leaflet.Heigthgraph Readme](https://github.com/GIScience/Leaflet.Heightgraph/#supported-data)
6566
by default.
6667

67-
Specify the `parser` property to use other Array or Object input formats.
68+
The component will assume the data is in `geoJson` format unless you specify another supported parser via options (see [options](#options) below)
6869

6970
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`.
7271

73-
Other relevant formats can be made available by contributing a parser.
72+
- `ors`: The response of the [openrouteservice directions endpoint](https://openrouteservice.org/dev/#/api-docs/v2/directions/{profile}/geojson/post)
73+
in geojson format. Don't forget to set `elevation=true`.
74+
75+
- `geojson`: data in a `geoJson` format.
76+
77+
- `noParser`: the data does not need to be parsed [see expected data structure](./src/data/no-parser-example.js)
78+
79+
Other relevant formats can be made available by contributing a parser.
7480

7581
examples: see [data folder](./src/data)
7682

7783
default: `[]`
84+
85+
### width via grid/view breakpoint
86+
87+
This component supports specifying a dynamic width based current screen resolution and as a portion of the parent width, similar to what is used in the [vuetify](https://dev.vuetifyjs.com/en/components/grids).
88+
So if can be defined the element width for mutiples scenarios, like: md8, lg10, xl6.
89+
7890
### options
91+
7992
Use the `options` property to specify any of the
8093
[Leaflet.Heightgraph options](https://github.com/GIScience/Leaflet.Heightgraph#default-options)
8194
to be set when the control is created.
8295

8396
If no options are specified the default options from Leaflet.Heightgraph are used.
97+
the wrapper has it own defaults only for:
98+
99+
- width: use the grid system as default. If width is specified it will override the grid system value and not be responsive.
100+
- parser: = `geoJson`
101+
- position: `bottomright`
84102

85103
example:
104+
86105
```js
87-
{ width: 1000, position: 'bottomleft'}
106+
{ width: 1000, position: 'bottomleft', parser: 'ors' }
88107
```
89108

90109
### position
110+
91111
String to set the position on the map. Values can be `'bottomleft'`, `'bottomright'`, `'topleft'`, `'topright'`.
92112
Fast setting for `options.position` (overwriting).
93113

94114
### expand
115+
95116
Boolean for expanding the heightgraph window on creation. Values are `true` and `false`.
96117
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'`

dist/Vue2LeafletHeightGraph.common.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/Vue2LeafletHeightGraph.common.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/Vue2LeafletHeightGraph.umd.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/Vue2LeafletHeightGraph.umd.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/Vue2LeafletHeightGraph.umd.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 17 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
{
2-
"_from": "vue2-leaflet-height-graph@^0.2.0",
3-
"_id": "vue2-leaflet-height-graph@0.2.0",
2+
"_from": "vue2-leaflet-height-graph@^0.3.0",
3+
"_id": "vue2-leaflet-height-graph@0.3.0",
44
"_inBundle": false,
55
"_integrity": "sha512-atQC+klaDwzyxRbBDtFz4WBtwYA1dJNTv/UzmJupICRkHm9I0ECZ8OIG/5BAGSBklwsqgiTKkZPYAEZK3e7JHg==",
66
"_location": "/vue2-leaflet-height-graph",
77
"_phantomChildren": {},
88
"_requested": {
99
"type": "range",
1010
"registry": true,
11-
"raw": "vue2-leaflet-height-graph@^0.2.0",
11+
"raw": "vue2-leaflet-height-graph@^0.3.0",
1212
"name": "vue2-leaflet-height-graph",
1313
"escapedName": "vue2-leaflet-height-graph",
14-
"rawSpec": "^0.2.0",
14+
"rawSpec": "^0.3.0",
1515
"saveSpec": null,
1616
"fetchSpec": "^0.3.0"
1717
},
@@ -48,9 +48,6 @@
4848
"webpack-node-externals": "^1.7.2"
4949
},
5050
"eslintConfig": {
51-
"extends": [
52-
"plugin:vue/base"
53-
],
5451
"parserOptions": {
5552
"ecmaVersion": 2019
5653
}
@@ -83,5 +80,5 @@
8380
"serve": "vue-cli-service serve",
8481
"test": "echo \"Error: no test specified\" && exit 1"
8582
},
86-
"version": "0.2.0"
83+
"version": "0.3.0"
8784
}

0 commit comments

Comments
 (0)