Skip to content

Commit 45b256d

Browse files
committed
Update Vue2Leaflet version
- Update both node_example and browser_example
1 parent e69321c commit 45b256d

File tree

9 files changed

+99
-91
lines changed

9 files changed

+99
-91
lines changed

examples/browser-example/index.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@
88

99
<body>
1010
<div id="app">
11-
<v-map :center="[-23.752961, -57.854357]" :zoom="6" style="height: 500px;" :options="mapOptions">
12-
<v-choropleth-layer :data="pyDepartmentsData" title-key="department_name" id-key="department_id" :value="value"
11+
<l-map :center="[-23.752961, -57.854357]" :zoom="6" style="height: 500px;" :options="mapOptions">
12+
<l-choropleth-layer :data="pyDepartmentsData" title-key="department_name" id-key="department_id" :value="value"
1313
:extra-values="extraValues" geojson-id-key="dpto" :geojson="geojson" :color-scale="colorScale">
1414
<template slot-scope="props">
15-
<v-info-control :item="props.currentItem" :unit="props.unit" title="Department" placeholder="Hover over a department" position="topright">
16-
</v-info-control>
17-
<v-reference-chart title="Girls school enrolment" :color-scale="colorScale" :min="props.min" :max="props.max" position="bottomleft">
18-
</v-reference-chart>
15+
<l-info-control :item="props.currentItem" :unit="props.unit" title="Department" placeholder="Hover over a department" position="topright">
16+
</l-info-control>
17+
<l-reference-chart title="Girls school enrolment" :color-scale="colorScale" :min="props.min" :max="props.max" position="bottomleft">
18+
</l-reference-chart>
1919
</template>
20-
</choropleth-layer>
21-
</v-map>
20+
</l-choropleth-layer>
21+
</l-map>
2222
</div>
2323
<script src="https://unpkg.com/vue"></script>
24-
<script src="https://unpkg.com/leaflet@1.0.3/dist/leaflet.js"></script>
24+
<script src="https://unpkg.com/leaflet@1.3.1/dist/leaflet.js"></script>
2525
<script src="./vue2-leaflet.min.js"></script>
2626
<script src="./vue-choropleth.min.js"></script>
2727
<script src="./index.js"></script>

examples/browser-example/index.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.

examples/browser-example/vue-choropleth.min.js

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

examples/browser-example/vue2-leaflet.min.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.

examples/node-example/src/App.vue

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<template>
22
<div id="app">
3-
<v-map :center="[-23.752961, -57.854357]" :zoom="6" style="height: 500px;" :options="mapOptions">
4-
<v-choropleth-layer :data="pyDepartmentsData" titleKey="department_name" idKey="department_id" :value="value" :extraValues="extraValues" geojsonIdKey="dpto" :geojson="paraguayGeojson" :colorScale="colorScale">
3+
<l-map :center="[-23.752961, -57.854357]" :zoom="6" style="height: 500px;" :options="mapOptions">
4+
<l-choropleth-layer :data="pyDepartmentsData" titleKey="department_name" idKey="department_id" :value="value" :extraValues="extraValues" geojsonIdKey="dpto" :geojson="paraguayGeojson" :colorScale="colorScale">
55
<template slot-scope="props">
6-
<v-info-control :item="props.currentItem" :unit="props.unit" title="Department" placeholder="Hover over a department"/>
7-
<v-reference-chart title="Girls school enrolment" :colorScale="colorScale" :min="props.min" :max="props.max" position="topright"/>
6+
<l-info-control :item="props.currentItem" :unit="props.unit" title="Department" placeholder="Hover over a department"/>
7+
<l-reference-chart title="Girls school enrolment" :colorScale="colorScale" :min="props.min" :max="props.max" position="topright"/>
88
</template>
9-
</v-choropleth-layer>
10-
</v-map>
9+
</l-choropleth-layer>
10+
</l-map>
1111
</div>
1212
</template>
1313

@@ -17,15 +17,15 @@ import { InfoControl, ReferenceChart, ChoroplethLayer } from 'vue-choropleth'
1717
import { geojson } from './data/py-departments-geojson'
1818
import paraguayGeojson from './data/paraguay.json'
1919
import { pyDepartmentsData } from './data/py-departments-data'
20-
import Vue2Leaflet from 'vue2-leaflet';
20+
import {LMap} from 'vue2-leaflet';
2121
2222
export default {
2323
name: "app",
2424
components: {
25-
'v-map': Vue2Leaflet.Map,
26-
'v-info-control': InfoControl,
27-
'v-reference-chart': ReferenceChart,
28-
'v-choropleth-layer': ChoroplethLayer
25+
LMap,
26+
'l-info-control': InfoControl,
27+
'l-reference-chart': ReferenceChart,
28+
'l-choropleth-layer': ChoroplethLayer
2929
},
3030
data() {
3131
return {
@@ -42,7 +42,8 @@ export default {
4242
}],
4343
mapOptions: {
4444
attributionControl: false
45-
}
45+
},
46+
currentStrokeColor: '3d3213'
4647
}
4748
},
4849
}

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"dependencies": {
2424
"chroma-js": "^1.3.4",
2525
"leaflet": "^1.1.0",
26-
"vue2-leaflet": "^0.0.58"
26+
"vue2-leaflet": "1.0.2"
2727
},
2828
"devDependencies": {
2929
"babel-core": "^6.26.3",

src/components/ChoroplethLayer.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<template>
22
<div>
3-
<v-geojson-layer :geojson="geojsonData.geojson" :options="geojsonOptions" ref="geolayer"></v-geojson-layer>
3+
<l-geo-json :geojson="geojsonData.geojson" :options="geojsonOptions" ref="geolayer"></l-geo-json>
44
<slot :currentItem="currentItem" :unit="value.metric" :min="min" :max="max"></slot>
55
</div>
66
</template>
77
<script>
88
9-
import Vue2Leaflet from "vue2-leaflet"
9+
import {LGeoJson} from "vue2-leaflet"
1010
import { getMin, getMax, normalizeValue, getColor, validNumber } from "../util"
1111
1212
function mouseover({ target }) {
@@ -123,7 +123,7 @@ export default {
123123
}
124124
},
125125
components: {
126-
"v-geojson-layer": Vue2Leaflet.GeoJSON
126+
LGeoJson
127127
},
128128
methods: {
129129
deferredMountedTo(parent) {

src/plugin.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ var ReferenceChart = require("./components/ReferenceChart")
44

55
module.exports = {
66
install: function(Vue, options) {
7-
Vue.component("v-choropleth-layer", ChoroplethLayer)
8-
Vue.component("v-info-control", InfoControl)
9-
Vue.component("v-reference-chart", ReferenceChart)
7+
Vue.component("l-choropleth-layer", ChoroplethLayer)
8+
Vue.component("l-info-control", InfoControl)
9+
Vue.component("l-reference-chart", ReferenceChart)
1010
}
1111
}

0 commit comments

Comments
 (0)