GIScience / vue2-leaflet-height-graph

Vue2Leaflet plugin to wrap Leaflet.Heightgraph control for Vue applications
MIT License
1 stars 4 forks source link

Console error when using ors-example with ors parser #1

Closed niabb closed 4 years ago

niabb commented 4 years ago

I've tried to use the ORS parser on a project of mine, without success. So I cloned this repository and npm install, changed the code of example.vue to use the ORS parser with the ORS GeoJson example: image And then I ran the example with npm run serve. In the browser (Chrome 81), I have an error in the console with no height graph displayed: image TypeError: Cannot read property 'geometries' of undefined at NewClass._createChart (L.Control.Heightgraph.min.js?4dd5:1) at NewClass.addData (L.Control.Heightgraph.min.js?4dd5:1) at VueComponent.eval (Vue2LeafletHeightGraph.umd.js?8830:262) at Array.eval (vue.runtime.esm.js?2b0e:1980) at flushCallbacks (vue.runtime.esm.js?2b0e:1906)

I will try to fix it, and will submit a PR if I succeed.

niabb commented 4 years ago

Sorry, my mistake, I was setting the parser value in the options prop, instead of using the parser prop directly. The correct syntax is: `<l-heightgraph :options="{ width: 1000, position: 'bottomleft'}" :data="route" :position="'bottomright'" parser="ors"

`