diff --git a/.nvmrc b/.nvmrc
new file mode 100644
index 0000000..4a9c19c
--- /dev/null
+++ b/.nvmrc
@@ -0,0 +1 @@
+v14.21.3
diff --git a/dist/Vue2LeafletHeightGraph.common.js b/dist/Vue2LeafletHeightGraph.common.js
index 1af6433..782de79 100644
--- a/dist/Vue2LeafletHeightGraph.common.js
+++ b/dist/Vue2LeafletHeightGraph.common.js
@@ -150,12 +150,12 @@ if (typeof window !== 'undefined') {
// Indicate to webpack that this file can be concatenated
/* harmony default export */ var setPublicPath = (null);
-// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"1d5174f1-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/Vue2LeafletHeightGraph.vue?vue&type=template&id=678cdb79&
+// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"1d42ff75-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/Vue2LeafletHeightGraph.vue?vue&type=template&id=6cb65d38&
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticStyle:{"display":"none"}})}
var staticRenderFns = []
-// CONCATENATED MODULE: ./src/Vue2LeafletHeightGraph.vue?vue&type=template&id=678cdb79&
+// CONCATENATED MODULE: ./src/Vue2LeafletHeightGraph.vue?vue&type=template&id=6cb65d38&
// EXTERNAL MODULE: external "leaflet.heightgraph"
var external_leaflet_heightgraph_ = __webpack_require__("ef37");
@@ -224,7 +224,7 @@ const buildCollections = (extras, coordinates) => {
*/
const addAttributeTypeProperty = (feature) => {
feature.properties = feature.properties || {}
- feature.properties.attributeType = feature.properties.attributeType || 'elevation'
+ feature.properties.attributeType = typeof feature.properties.attributeType === 'undefined' ? 'elevation' : feature.properties.attributeType
}
/**
@@ -303,7 +303,8 @@ function geoJson(data) {
data () {
return {
availableParsers: parser_namespaceObject,
- hgInstance: null
+ hgInstance: null,
+ controlRef: null,
}
},
props: {
@@ -327,6 +328,10 @@ function geoJson(data) {
type: Object,
default: () => {}
},
+ container: {
+ type: String | Boolean,
+ default: false
+ },
debug: {
type: Boolean,
default: false
@@ -336,25 +341,40 @@ function geoJson(data) {
if(this.debug) {
console.log('mounted')
}
- this.$nextTick(() => {
- const map = this.$parent.mapObject;
- this.hgInstance = L.control.heightgraph({...this.options,...{
- // merges quick settings with options if they are defined
- ...(this.position && {position: this.position}),
- ...(this.expand && {expand: this.expand})
- }})
- this.hgInstance.addTo(map)
- let p = Object.keys(this.availableParsers).includes(this.parser) ? this.parser : 'normal'
- let dataCollections = this.availableParsers[p](this.data)
- this.hgInstance.addData(dataCollections)
- })
+ const map = this.$parent.mapObject;
+ this.hgInstance = L.control.heightgraph({...this.options,...{
+ // merges quick settings with options if they are defined
+ ...(this.position && {position: this.position}),
+ ...(this.expand && {expand: this.expand})
+ }})
+ this.controlRef = this.hgInstance.addTo(map)
+ if(this.container) {
+ const container = this.getContainer();
+ container.innerHTML = ''
+ container.appendChild(this.controlRef.onAdd(map));
+ window.addEventListener('resize', this.onResize);
+
+
+ try {
+ document.querySelector('.leaflet-control-container .heightgraph.leaflet-control').hidden = true
+ } catch (e) {
+ console.error('Unable to hide the default height graph control')
+ }
+ } else {
+ this.hgInstance.addTo(map)
+ }
+ let p = Object.keys(this.availableParsers).includes(this.parser) ? this.parser : 'normal'
+ let dataCollections = this.availableParsers[p](this.data)
+ this.hgInstance.addData(dataCollections)
},
beforeDestroy() {
if(this.debug) {
console.log('beforeDestroy')
}
if(this.hgInstance) {
- this.hgInstance.remove()
+ window.removeEventListener('resize', this.onResize);
+ this.hgInstance.remove()
+ this.controlRef = null;
}
},
watch: {
@@ -371,7 +391,16 @@ function geoJson(data) {
}
})
}
+ },
+ methods: {
+ onResize() {
+ const { clientWidth: width, clientHeight: height } = this.getContainer();
+ this.hgInstance.resize({ width, height: this.options.height || height });
+ },
+ getContainer() {
+ return document.querySelector(this.container) || document.getElementById(this.container);
}
+ }
});
// CONCATENATED MODULE: ./src/Vue2LeafletHeightGraph.vue?vue&type=script&lang=js&
diff --git a/dist/Vue2LeafletHeightGraph.common.js.map b/dist/Vue2LeafletHeightGraph.common.js.map
index 8c8c856..68a768d 100644
--- a/dist/Vue2LeafletHeightGraph.common.js.map
+++ b/dist/Vue2LeafletHeightGraph.common.js.map
@@ -1 +1 @@
-{"version":3,"sources":["webpack://Vue2LeafletHeightGraph/webpack/bootstrap","webpack://Vue2LeafletHeightGraph/./src/Vue2LeafletHeightGraph.vue?1315","webpack://Vue2LeafletHeightGraph/./src/Vue2LeafletHeightGraph.vue?1a1e","webpack://Vue2LeafletHeightGraph/external \"current-script-polyfill\"","webpack://Vue2LeafletHeightGraph/external \"leaflet.heightgraph\"","webpack://Vue2LeafletHeightGraph/./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js","webpack://Vue2LeafletHeightGraph/./src/Vue2LeafletHeightGraph.vue?e7dd","webpack://Vue2LeafletHeightGraph/./src/utils/parser.js","webpack://Vue2LeafletHeightGraph/src/Vue2LeafletHeightGraph.vue","webpack://Vue2LeafletHeightGraph/./src/Vue2LeafletHeightGraph.vue?7fa2","webpack://Vue2LeafletHeightGraph/./node_modules/vue-loader/lib/runtime/componentNormalizer.js","webpack://Vue2LeafletHeightGraph/./src/Vue2LeafletHeightGraph.vue","webpack://Vue2LeafletHeightGraph/./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js"],"names":[],"mappings":";;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;AClFA,uC;;;;;;;;ACAA;AAAA;AAAA;AAA0X,CAAgB,+bAAG,EAAC,C;;;;;;;ACA9Y,oD;;;;;;;ACAA,gD;;;;;;;;;;;;;;;;;;;ACAA;;AAEA;AACA,MAAM,IAAuC;AAC7C,IAAI,mBAAO,CAAC,MAAyB;AACrC;;AAEA;AACA;AACA,IAAI,qBAAuB;AAC3B;AACA;;AAEA;AACe,sDAAI;;;ACdnB,0BAA0B,aAAa,0BAA0B,wBAAwB,iBAAiB,aAAa,kBAAkB;AACzI;;;;;;;;;ACDA;AACA;AACA;AACA;AACA,cAAc,WAAW,6BAA6B,6BAA6B;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc,wCAAwC;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,MAAM;AACnB;AACO;AACP;AACA;AACA;AACA,SAAS,YAAY,WAAW,yBAAyB,eAAe,gBAAgB,EAAE;AAC1F;AACA;AACA;AACA;AACA;AACO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;ACvHD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;ACnFyL,CAAgB,qIAAG,EAAC,C;;;;;ACA7M;;AAEA;AACA;AACA;;AAEe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,qBAAqB;AACrB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AC5FqG;AAC3B;AACL;AACa;;;AAGlF;AACuF;AACvF,gBAAgB,kBAAU;AAC1B,EAAE,kDAAM;AACR,EAAE,MAAM;AACR,EAAE,eAAe;AACjB;AACA;AACA;AACA;;AAEA;;AAEe,4E;;ACnBS;AACA;AACT,qGAAG;AACI","file":"Vue2LeafletHeightGraph.common.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"fb15\");\n","// extracted by mini-css-extract-plugin","import mod from \"-!../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../node_modules/css-loader/index.js??ref--6-oneOf-1-1!../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../node_modules/cache-loader/dist/cjs.js??ref--0-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./Vue2LeafletHeightGraph.vue?vue&type=style&index=0&lang=css&\"; export default mod; export * from \"-!../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../node_modules/css-loader/index.js??ref--6-oneOf-1-1!../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../node_modules/cache-loader/dist/cjs.js??ref--0-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./Vue2LeafletHeightGraph.vue?vue&type=style&index=0&lang=css&\"","module.exports = require(\"current-script-polyfill\");","module.exports = require(\"leaflet.heightgraph\");","// This file is imported into lib/wc client bundles.\n\nif (typeof window !== 'undefined') {\n if (process.env.NEED_CURRENTSCRIPT_POLYFILL) {\n require('current-script-polyfill')\n }\n\n var i\n if ((i = window.document.currentScript) && (i = i.src.match(/(.+\\/)[^/]+\\.js(\\?.*)?$/))) {\n __webpack_public_path__ = i[1] // eslint-disable-line\n }\n}\n\n// Indicate to webpack that this file can be concatenated\nexport default null\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticStyle:{\"display\":\"none\"}})}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","/**\n * Builds GeoJson Feature\n * @param extraSegment - segment with constant extra value\n * @param coordinates - coordinates array\n * @returns {{geometry: {coordinates: *, type: string}, type: string, properties: {attributeType: *}}}\n */\nconst buildFeature = (extraSegment, coordinates) => {\n const [startIdx, endIdx, attributeType] = extraSegment\n return {\n type: \"Feature\",\n geometry: {\n type: \"LineString\",\n coordinates: coordinates.slice(startIdx, endIdx + 1)\n },\n properties: {\n attributeType: attributeType\n }\n }\n}\n\n/**\n * Builds GeoJson feature collection\n * @param features - all features for\n * @param extraKey\n * @returns {{features: *, type: string, properties: {summary: *}}}\n */\nconst buildFeatureCollection = (features, extraKey) => {\n return {\n type: 'FeatureCollection',\n features: features,\n properties: {\n summary: extraKey\n }\n }\n}\n\n/**\n * Build leaflet.heightgraph data\n * @param extras - ors\n * @param coordinates - coordinates array\n * @returns {Array} height graph conformal data. See https://github.com/GIScience/Leaflet.Heightgraph#supported-data\n */\nconst buildCollections = (extras, coordinates) => {\n let collections = []\n Object.entries(extras)\n .forEach(([extraKey, extraData]) => {\n let features = []\n for (let extraSegment of extraData.values) {\n const feature = buildFeature(extraSegment, coordinates)\n features.push(feature)\n }\n const featureCollection = buildFeatureCollection(features, extraKey)\n collections.push(featureCollection)\n })\n return collections\n}\n\n/**\n * Adds the default attributeType property 'elevation' to Features if it doesn't exist.\n * @param feature\n */\nconst addAttributeTypeProperty = (feature) => {\n feature.properties = feature.properties || {}\n feature.properties.attributeType = feature.properties.attributeType || 'elevation'\n}\n\n/**\n *\n * @param orsResponse\n * @returns {Array} collections - height graph conformal data. See https://github.com/GIScience/Leaflet.Heightgraph#supported-data\n */\nexport function ors(orsResponse) {\n let collections = null\n let responseObject = typeof orsResponse === 'string' ? JSON.parse(orsResponse) : orsResponse\n // extract coordinates and extras from ors response\n let {features: [{geometry: {coordinates: coordinates}, properties: {extras: extras}}]} = responseObject\n if (extras) {\n collections = buildCollections(extras, coordinates)\n }\n return collections\n}\nexport function normal(data) {\n return data\n}\n\n/**\n * The geoJson parser should accept simple LineString geometries, Features and FeatureCollections.\n * It builds the Array of FeatureCollections containing the required 'summary' and 'attributeType' tags.\n * @param data - the geoJson object\n * @returns {Array}\n */\nexport function geoJson(data) {\n // parse to object if necessary\n data = typeof data === 'string' ? JSON.parse(data) : data\n // transforms LineString data to Feature type\n if (data.type === \"LineString\") {\n data = buildFeature(\n [\n 0,\n data.coordinates.length - 1,\n 'elevation'\n ],\n data.coordinates\n )\n }\n // transforms Feature data to FeatureCollection Type\n if (data.type === \"Feature\") {\n addAttributeTypeProperty(data)\n data = buildFeatureCollection([data], 'elevation')\n }\n // transforms FeatureCollection to array of FeatureCollections\n if (data.type === \"FeatureCollection\")\n for (let feature of data.features) {\n addAttributeTypeProperty(feature)\n }\n data.properties = data.properties || {}\n data.properties.summary = data.properties.summary || 'elevation'\n return [data]\n}\n\n// Template for a custom parser\n/*export function templateParser(yourInputData)\n DO PARSING HERE\n let heighGraphConformalData = parsing(yourInputData)\n return heighGraphConformalData\n}*/\n","\r\n \r\n
\r\n\r\n\r\n\r\n\r\n","import mod from \"-!../node_modules/cache-loader/dist/cjs.js??ref--0-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./Vue2LeafletHeightGraph.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../node_modules/cache-loader/dist/cjs.js??ref--0-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./Vue2LeafletHeightGraph.vue?vue&type=script&lang=js&\"","/* globals __VUE_SSR_CONTEXT__ */\n\n// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).\n// This module is a runtime utility for cleaner component module output and will\n// be included in the final webpack user bundle.\n\nexport default function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode /* vue-cli only */\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}\n","import { render, staticRenderFns } from \"./Vue2LeafletHeightGraph.vue?vue&type=template&id=678cdb79&\"\nimport script from \"./Vue2LeafletHeightGraph.vue?vue&type=script&lang=js&\"\nexport * from \"./Vue2LeafletHeightGraph.vue?vue&type=script&lang=js&\"\nimport style0 from \"./Vue2LeafletHeightGraph.vue?vue&type=style&index=0&lang=css&\"\n\n\n/* normalize component */\nimport normalizer from \"!../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","import './setPublicPath'\nimport mod from '~entry'\nexport default mod\nexport * from '~entry'\n"],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"sources":["webpack://Vue2LeafletHeightGraph/webpack/bootstrap","webpack://Vue2LeafletHeightGraph/./src/Vue2LeafletHeightGraph.vue?1315","webpack://Vue2LeafletHeightGraph/./src/Vue2LeafletHeightGraph.vue?1a1e","webpack://Vue2LeafletHeightGraph/external \"current-script-polyfill\"","webpack://Vue2LeafletHeightGraph/external \"leaflet.heightgraph\"","webpack://Vue2LeafletHeightGraph/./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js","webpack://Vue2LeafletHeightGraph/./src/Vue2LeafletHeightGraph.vue?7a0b","webpack://Vue2LeafletHeightGraph/./src/utils/parser.js","webpack://Vue2LeafletHeightGraph/src/Vue2LeafletHeightGraph.vue","webpack://Vue2LeafletHeightGraph/./src/Vue2LeafletHeightGraph.vue?7fa2","webpack://Vue2LeafletHeightGraph/./node_modules/vue-loader/lib/runtime/componentNormalizer.js","webpack://Vue2LeafletHeightGraph/./src/Vue2LeafletHeightGraph.vue","webpack://Vue2LeafletHeightGraph/./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js"],"names":[],"mappings":";;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;AClFA,uC;;;;;;;;ACAA;AAAA;AAAA;AAA0X,CAAgB,+bAAG,EAAC,C;;;;;;;ACA9Y,oD;;;;;;;ACAA,gD;;;;;;;;;;;;;;;;;;;ACAA;;AAEA;AACA,MAAM,IAAuC;AAC7C,IAAI,mBAAO,CAAC,MAAyB;AACrC;;AAEA;AACA;AACA,IAAI,qBAAuB;AAC3B;AACA;;AAEA;AACe,sDAAI;;;ACdnB,0BAA0B,aAAa,0BAA0B,wBAAwB,iBAAiB,aAAa,kBAAkB;AACzI;;;;;;;;;ACDA;AACA;AACA;AACA;AACA,cAAc,WAAW,6BAA6B,6BAA6B;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc,wCAAwC;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,MAAM;AACnB;AACO;AACP;AACA;AACA;AACA,SAAS,YAAY,WAAW,yBAAyB,eAAe,gBAAgB,EAAE;AAC1F;AACA;AACA;AACA;AACA;AACO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;ACvHD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AChHyL,CAAgB,qIAAG,EAAC,C;;;;;ACA7M;;AAEA;AACA;AACA;;AAEe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,qBAAqB;AACrB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AC5FqG;AAC3B;AACL;AACa;;;AAGlF;AACuF;AACvF,gBAAgB,kBAAU;AAC1B,EAAE,kDAAM;AACR,EAAE,MAAM;AACR,EAAE,eAAe;AACjB;AACA;AACA;AACA;;AAEA;;AAEe,4E;;ACnBS;AACA;AACT,qGAAG;AACI","file":"Vue2LeafletHeightGraph.common.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"fb15\");\n","// extracted by mini-css-extract-plugin","import mod from \"-!../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../node_modules/css-loader/index.js??ref--6-oneOf-1-1!../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../node_modules/cache-loader/dist/cjs.js??ref--0-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./Vue2LeafletHeightGraph.vue?vue&type=style&index=0&lang=css&\"; export default mod; export * from \"-!../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../node_modules/css-loader/index.js??ref--6-oneOf-1-1!../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../node_modules/cache-loader/dist/cjs.js??ref--0-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./Vue2LeafletHeightGraph.vue?vue&type=style&index=0&lang=css&\"","module.exports = require(\"current-script-polyfill\");","module.exports = require(\"leaflet.heightgraph\");","// This file is imported into lib/wc client bundles.\n\nif (typeof window !== 'undefined') {\n if (process.env.NEED_CURRENTSCRIPT_POLYFILL) {\n require('current-script-polyfill')\n }\n\n var i\n if ((i = window.document.currentScript) && (i = i.src.match(/(.+\\/)[^/]+\\.js(\\?.*)?$/))) {\n __webpack_public_path__ = i[1] // eslint-disable-line\n }\n}\n\n// Indicate to webpack that this file can be concatenated\nexport default null\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticStyle:{\"display\":\"none\"}})}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","/**\n * Builds GeoJson Feature\n * @param extraSegment - segment with constant extra value\n * @param coordinates - coordinates array\n * @returns {{geometry: {coordinates: *, type: string}, type: string, properties: {attributeType: *}}}\n */\nconst buildFeature = (extraSegment, coordinates) => {\n const [startIdx, endIdx, attributeType] = extraSegment\n return {\n type: \"Feature\",\n geometry: {\n type: \"LineString\",\n coordinates: coordinates.slice(startIdx, endIdx + 1)\n },\n properties: {\n attributeType: attributeType\n }\n }\n}\n\n/**\n * Builds GeoJson feature collection\n * @param features - all features for\n * @param extraKey\n * @returns {{features: *, type: string, properties: {summary: *}}}\n */\nconst buildFeatureCollection = (features, extraKey) => {\n return {\n type: 'FeatureCollection',\n features: features,\n properties: {\n summary: extraKey\n }\n }\n}\n\n/**\n * Build leaflet.heightgraph data\n * @param extras - ors\n * @param coordinates - coordinates array\n * @returns {Array} height graph conformal data. See https://github.com/GIScience/Leaflet.Heightgraph#supported-data\n */\nconst buildCollections = (extras, coordinates) => {\n let collections = []\n Object.entries(extras)\n .forEach(([extraKey, extraData]) => {\n let features = []\n for (let extraSegment of extraData.values) {\n const feature = buildFeature(extraSegment, coordinates)\n features.push(feature)\n }\n const featureCollection = buildFeatureCollection(features, extraKey)\n collections.push(featureCollection)\n })\n return collections\n}\n\n/**\n * Adds the default attributeType property 'elevation' to Features if it doesn't exist.\n * @param feature\n */\nconst addAttributeTypeProperty = (feature) => {\n feature.properties = feature.properties || {}\n feature.properties.attributeType = typeof feature.properties.attributeType === 'undefined' ? 'elevation' : feature.properties.attributeType\n}\n\n/**\n *\n * @param orsResponse\n * @returns {Array} collections - height graph conformal data. See https://github.com/GIScience/Leaflet.Heightgraph#supported-data\n */\nexport function ors(orsResponse) {\n let collections = null\n let responseObject = typeof orsResponse === 'string' ? JSON.parse(orsResponse) : orsResponse\n // extract coordinates and extras from ors response\n let {features: [{geometry: {coordinates: coordinates}, properties: {extras: extras}}]} = responseObject\n if (extras) {\n collections = buildCollections(extras, coordinates)\n }\n return collections\n}\nexport function normal(data) {\n return data\n}\n\n/**\n * The geoJson parser should accept simple LineString geometries, Features and FeatureCollections.\n * It builds the Array of FeatureCollections containing the required 'summary' and 'attributeType' tags.\n * @param data - the geoJson object\n * @returns {Array}\n */\nexport function geoJson(data) {\n // parse to object if necessary\n data = typeof data === 'string' ? JSON.parse(data) : data\n // transforms LineString data to Feature type\n if (data.type === \"LineString\") {\n data = buildFeature(\n [\n 0,\n data.coordinates.length - 1,\n 'elevation'\n ],\n data.coordinates\n )\n }\n // transforms Feature data to FeatureCollection Type\n if (data.type === \"Feature\") {\n addAttributeTypeProperty(data)\n data = buildFeatureCollection([data], 'elevation')\n }\n // transforms FeatureCollection to array of FeatureCollections\n if (data.type === \"FeatureCollection\")\n for (let feature of data.features) {\n addAttributeTypeProperty(feature)\n }\n data.properties = data.properties || {}\n data.properties.summary = data.properties.summary || 'elevation'\n return [data]\n}\n\n// Template for a custom parser\n/*export function templateParser(yourInputData)\n DO PARSING HERE\n let heighGraphConformalData = parsing(yourInputData)\n return heighGraphConformalData\n}*/\n","\r\n \r\n
\r\n\r\n\r\n\r\n\r\n","import mod from \"-!../node_modules/cache-loader/dist/cjs.js??ref--0-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./Vue2LeafletHeightGraph.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../node_modules/cache-loader/dist/cjs.js??ref--0-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./Vue2LeafletHeightGraph.vue?vue&type=script&lang=js&\"","/* globals __VUE_SSR_CONTEXT__ */\n\n// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).\n// This module is a runtime utility for cleaner component module output and will\n// be included in the final webpack user bundle.\n\nexport default function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode /* vue-cli only */\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}\n","import { render, staticRenderFns } from \"./Vue2LeafletHeightGraph.vue?vue&type=template&id=6cb65d38&\"\nimport script from \"./Vue2LeafletHeightGraph.vue?vue&type=script&lang=js&\"\nexport * from \"./Vue2LeafletHeightGraph.vue?vue&type=script&lang=js&\"\nimport style0 from \"./Vue2LeafletHeightGraph.vue?vue&type=style&index=0&lang=css&\"\n\n\n/* normalize component */\nimport normalizer from \"!../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","import './setPublicPath'\nimport mod from '~entry'\nexport default mod\nexport * from '~entry'\n"],"sourceRoot":""}
\ No newline at end of file
diff --git a/dist/Vue2LeafletHeightGraph.umd.js b/dist/Vue2LeafletHeightGraph.umd.js
index b56a56e..cbc3d87 100644
--- a/dist/Vue2LeafletHeightGraph.umd.js
+++ b/dist/Vue2LeafletHeightGraph.umd.js
@@ -159,12 +159,12 @@ if (typeof window !== 'undefined') {
// Indicate to webpack that this file can be concatenated
/* harmony default export */ var setPublicPath = (null);
-// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"1d5174f1-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/Vue2LeafletHeightGraph.vue?vue&type=template&id=678cdb79&
+// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"1d42ff75-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/Vue2LeafletHeightGraph.vue?vue&type=template&id=6cb65d38&
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticStyle:{"display":"none"}})}
var staticRenderFns = []
-// CONCATENATED MODULE: ./src/Vue2LeafletHeightGraph.vue?vue&type=template&id=678cdb79&
+// CONCATENATED MODULE: ./src/Vue2LeafletHeightGraph.vue?vue&type=template&id=6cb65d38&
// EXTERNAL MODULE: external "leaflet.heightgraph"
var external_leaflet_heightgraph_ = __webpack_require__("ef37");
@@ -233,7 +233,7 @@ const buildCollections = (extras, coordinates) => {
*/
const addAttributeTypeProperty = (feature) => {
feature.properties = feature.properties || {}
- feature.properties.attributeType = feature.properties.attributeType || 'elevation'
+ feature.properties.attributeType = typeof feature.properties.attributeType === 'undefined' ? 'elevation' : feature.properties.attributeType
}
/**
@@ -312,7 +312,8 @@ function geoJson(data) {
data () {
return {
availableParsers: parser_namespaceObject,
- hgInstance: null
+ hgInstance: null,
+ controlRef: null,
}
},
props: {
@@ -336,6 +337,10 @@ function geoJson(data) {
type: Object,
default: () => {}
},
+ container: {
+ type: String | Boolean,
+ default: false
+ },
debug: {
type: Boolean,
default: false
@@ -345,25 +350,40 @@ function geoJson(data) {
if(this.debug) {
console.log('mounted')
}
- this.$nextTick(() => {
- const map = this.$parent.mapObject;
- this.hgInstance = L.control.heightgraph({...this.options,...{
- // merges quick settings with options if they are defined
- ...(this.position && {position: this.position}),
- ...(this.expand && {expand: this.expand})
- }})
- this.hgInstance.addTo(map)
- let p = Object.keys(this.availableParsers).includes(this.parser) ? this.parser : 'normal'
- let dataCollections = this.availableParsers[p](this.data)
- this.hgInstance.addData(dataCollections)
- })
+ const map = this.$parent.mapObject;
+ this.hgInstance = L.control.heightgraph({...this.options,...{
+ // merges quick settings with options if they are defined
+ ...(this.position && {position: this.position}),
+ ...(this.expand && {expand: this.expand})
+ }})
+ this.controlRef = this.hgInstance.addTo(map)
+ if(this.container) {
+ const container = this.getContainer();
+ container.innerHTML = ''
+ container.appendChild(this.controlRef.onAdd(map));
+ window.addEventListener('resize', this.onResize);
+
+
+ try {
+ document.querySelector('.leaflet-control-container .heightgraph.leaflet-control').hidden = true
+ } catch (e) {
+ console.error('Unable to hide the default height graph control')
+ }
+ } else {
+ this.hgInstance.addTo(map)
+ }
+ let p = Object.keys(this.availableParsers).includes(this.parser) ? this.parser : 'normal'
+ let dataCollections = this.availableParsers[p](this.data)
+ this.hgInstance.addData(dataCollections)
},
beforeDestroy() {
if(this.debug) {
console.log('beforeDestroy')
}
if(this.hgInstance) {
- this.hgInstance.remove()
+ window.removeEventListener('resize', this.onResize);
+ this.hgInstance.remove()
+ this.controlRef = null;
}
},
watch: {
@@ -380,7 +400,16 @@ function geoJson(data) {
}
})
}
+ },
+ methods: {
+ onResize() {
+ const { clientWidth: width, clientHeight: height } = this.getContainer();
+ this.hgInstance.resize({ width, height: this.options.height || height });
+ },
+ getContainer() {
+ return document.querySelector(this.container) || document.getElementById(this.container);
}
+ }
});
// CONCATENATED MODULE: ./src/Vue2LeafletHeightGraph.vue?vue&type=script&lang=js&
diff --git a/dist/Vue2LeafletHeightGraph.umd.js.map b/dist/Vue2LeafletHeightGraph.umd.js.map
index b7f5509..49b9368 100644
--- a/dist/Vue2LeafletHeightGraph.umd.js.map
+++ b/dist/Vue2LeafletHeightGraph.umd.js.map
@@ -1 +1 @@
-{"version":3,"sources":["webpack://Vue2LeafletHeightGraph/webpack/universalModuleDefinition","webpack://Vue2LeafletHeightGraph/webpack/bootstrap","webpack://Vue2LeafletHeightGraph/./src/Vue2LeafletHeightGraph.vue?1315","webpack://Vue2LeafletHeightGraph/./src/Vue2LeafletHeightGraph.vue?1a1e","webpack://Vue2LeafletHeightGraph/external \"current-script-polyfill\"","webpack://Vue2LeafletHeightGraph/external \"leaflet.heightgraph\"","webpack://Vue2LeafletHeightGraph/./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js","webpack://Vue2LeafletHeightGraph/./src/Vue2LeafletHeightGraph.vue?e7dd","webpack://Vue2LeafletHeightGraph/./src/utils/parser.js","webpack://Vue2LeafletHeightGraph/src/Vue2LeafletHeightGraph.vue","webpack://Vue2LeafletHeightGraph/./src/Vue2LeafletHeightGraph.vue?7fa2","webpack://Vue2LeafletHeightGraph/./node_modules/vue-loader/lib/runtime/componentNormalizer.js","webpack://Vue2LeafletHeightGraph/./src/Vue2LeafletHeightGraph.vue","webpack://Vue2LeafletHeightGraph/./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;QCVA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;AClFA,uC;;;;;;;;ACAA;AAAA;AAAA;AAA0X,CAAgB,+bAAG,EAAC,C;;;;;;;ACA9Y,oD;;;;;;;ACAA,gD;;;;;;;;;;;;;;;;;;;ACAA;;AAEA;AACA,MAAM,IAAuC;AAC7C,IAAI,mBAAO,CAAC,MAAyB;AACrC;;AAEA;AACA;AACA,IAAI,qBAAuB;AAC3B;AACA;;AAEA;AACe,sDAAI;;;ACdnB,0BAA0B,aAAa,0BAA0B,wBAAwB,iBAAiB,aAAa,kBAAkB;AACzI;;;;;;;;;ACDA;AACA;AACA;AACA;AACA,cAAc,WAAW,6BAA6B,6BAA6B;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc,wCAAwC;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,MAAM;AACnB;AACO;AACP;AACA;AACA;AACA,SAAS,YAAY,WAAW,yBAAyB,eAAe,gBAAgB,EAAE;AAC1F;AACA;AACA;AACA;AACA;AACO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;ACvHD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;ACnFyL,CAAgB,qIAAG,EAAC,C;;;;;ACA7M;;AAEA;AACA;AACA;;AAEe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,qBAAqB;AACrB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AC5FqG;AAC3B;AACL;AACa;;;AAGlF;AACuF;AACvF,gBAAgB,kBAAU;AAC1B,EAAE,kDAAM;AACR,EAAE,MAAM;AACR,EAAE,eAAe;AACjB;AACA;AACA;AACA;;AAEA;;AAEe,4E;;ACnBS;AACA;AACT,qGAAG;AACI","file":"Vue2LeafletHeightGraph.umd.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Vue2LeafletHeightGraph\"] = factory();\n\telse\n\t\troot[\"Vue2LeafletHeightGraph\"] = factory();\n})((typeof self !== 'undefined' ? self : this), function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"fb15\");\n","// extracted by mini-css-extract-plugin","import mod from \"-!../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../node_modules/css-loader/index.js??ref--6-oneOf-1-1!../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../node_modules/cache-loader/dist/cjs.js??ref--0-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./Vue2LeafletHeightGraph.vue?vue&type=style&index=0&lang=css&\"; export default mod; export * from \"-!../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../node_modules/css-loader/index.js??ref--6-oneOf-1-1!../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../node_modules/cache-loader/dist/cjs.js??ref--0-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./Vue2LeafletHeightGraph.vue?vue&type=style&index=0&lang=css&\"","module.exports = require(\"current-script-polyfill\");","module.exports = require(\"leaflet.heightgraph\");","// This file is imported into lib/wc client bundles.\n\nif (typeof window !== 'undefined') {\n if (process.env.NEED_CURRENTSCRIPT_POLYFILL) {\n require('current-script-polyfill')\n }\n\n var i\n if ((i = window.document.currentScript) && (i = i.src.match(/(.+\\/)[^/]+\\.js(\\?.*)?$/))) {\n __webpack_public_path__ = i[1] // eslint-disable-line\n }\n}\n\n// Indicate to webpack that this file can be concatenated\nexport default null\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticStyle:{\"display\":\"none\"}})}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","/**\n * Builds GeoJson Feature\n * @param extraSegment - segment with constant extra value\n * @param coordinates - coordinates array\n * @returns {{geometry: {coordinates: *, type: string}, type: string, properties: {attributeType: *}}}\n */\nconst buildFeature = (extraSegment, coordinates) => {\n const [startIdx, endIdx, attributeType] = extraSegment\n return {\n type: \"Feature\",\n geometry: {\n type: \"LineString\",\n coordinates: coordinates.slice(startIdx, endIdx + 1)\n },\n properties: {\n attributeType: attributeType\n }\n }\n}\n\n/**\n * Builds GeoJson feature collection\n * @param features - all features for\n * @param extraKey\n * @returns {{features: *, type: string, properties: {summary: *}}}\n */\nconst buildFeatureCollection = (features, extraKey) => {\n return {\n type: 'FeatureCollection',\n features: features,\n properties: {\n summary: extraKey\n }\n }\n}\n\n/**\n * Build leaflet.heightgraph data\n * @param extras - ors\n * @param coordinates - coordinates array\n * @returns {Array} height graph conformal data. See https://github.com/GIScience/Leaflet.Heightgraph#supported-data\n */\nconst buildCollections = (extras, coordinates) => {\n let collections = []\n Object.entries(extras)\n .forEach(([extraKey, extraData]) => {\n let features = []\n for (let extraSegment of extraData.values) {\n const feature = buildFeature(extraSegment, coordinates)\n features.push(feature)\n }\n const featureCollection = buildFeatureCollection(features, extraKey)\n collections.push(featureCollection)\n })\n return collections\n}\n\n/**\n * Adds the default attributeType property 'elevation' to Features if it doesn't exist.\n * @param feature\n */\nconst addAttributeTypeProperty = (feature) => {\n feature.properties = feature.properties || {}\n feature.properties.attributeType = feature.properties.attributeType || 'elevation'\n}\n\n/**\n *\n * @param orsResponse\n * @returns {Array} collections - height graph conformal data. See https://github.com/GIScience/Leaflet.Heightgraph#supported-data\n */\nexport function ors(orsResponse) {\n let collections = null\n let responseObject = typeof orsResponse === 'string' ? JSON.parse(orsResponse) : orsResponse\n // extract coordinates and extras from ors response\n let {features: [{geometry: {coordinates: coordinates}, properties: {extras: extras}}]} = responseObject\n if (extras) {\n collections = buildCollections(extras, coordinates)\n }\n return collections\n}\nexport function normal(data) {\n return data\n}\n\n/**\n * The geoJson parser should accept simple LineString geometries, Features and FeatureCollections.\n * It builds the Array of FeatureCollections containing the required 'summary' and 'attributeType' tags.\n * @param data - the geoJson object\n * @returns {Array}\n */\nexport function geoJson(data) {\n // parse to object if necessary\n data = typeof data === 'string' ? JSON.parse(data) : data\n // transforms LineString data to Feature type\n if (data.type === \"LineString\") {\n data = buildFeature(\n [\n 0,\n data.coordinates.length - 1,\n 'elevation'\n ],\n data.coordinates\n )\n }\n // transforms Feature data to FeatureCollection Type\n if (data.type === \"Feature\") {\n addAttributeTypeProperty(data)\n data = buildFeatureCollection([data], 'elevation')\n }\n // transforms FeatureCollection to array of FeatureCollections\n if (data.type === \"FeatureCollection\")\n for (let feature of data.features) {\n addAttributeTypeProperty(feature)\n }\n data.properties = data.properties || {}\n data.properties.summary = data.properties.summary || 'elevation'\n return [data]\n}\n\n// Template for a custom parser\n/*export function templateParser(yourInputData)\n DO PARSING HERE\n let heighGraphConformalData = parsing(yourInputData)\n return heighGraphConformalData\n}*/\n","\r\n \r\n
\r\n\r\n\r\n\r\n\r\n","import mod from \"-!../node_modules/cache-loader/dist/cjs.js??ref--0-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./Vue2LeafletHeightGraph.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../node_modules/cache-loader/dist/cjs.js??ref--0-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./Vue2LeafletHeightGraph.vue?vue&type=script&lang=js&\"","/* globals __VUE_SSR_CONTEXT__ */\n\n// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).\n// This module is a runtime utility for cleaner component module output and will\n// be included in the final webpack user bundle.\n\nexport default function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode /* vue-cli only */\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}\n","import { render, staticRenderFns } from \"./Vue2LeafletHeightGraph.vue?vue&type=template&id=678cdb79&\"\nimport script from \"./Vue2LeafletHeightGraph.vue?vue&type=script&lang=js&\"\nexport * from \"./Vue2LeafletHeightGraph.vue?vue&type=script&lang=js&\"\nimport style0 from \"./Vue2LeafletHeightGraph.vue?vue&type=style&index=0&lang=css&\"\n\n\n/* normalize component */\nimport normalizer from \"!../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","import './setPublicPath'\nimport mod from '~entry'\nexport default mod\nexport * from '~entry'\n"],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"sources":["webpack://Vue2LeafletHeightGraph/webpack/universalModuleDefinition","webpack://Vue2LeafletHeightGraph/webpack/bootstrap","webpack://Vue2LeafletHeightGraph/./src/Vue2LeafletHeightGraph.vue?1315","webpack://Vue2LeafletHeightGraph/./src/Vue2LeafletHeightGraph.vue?1a1e","webpack://Vue2LeafletHeightGraph/external \"current-script-polyfill\"","webpack://Vue2LeafletHeightGraph/external \"leaflet.heightgraph\"","webpack://Vue2LeafletHeightGraph/./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js","webpack://Vue2LeafletHeightGraph/./src/Vue2LeafletHeightGraph.vue?7a0b","webpack://Vue2LeafletHeightGraph/./src/utils/parser.js","webpack://Vue2LeafletHeightGraph/src/Vue2LeafletHeightGraph.vue","webpack://Vue2LeafletHeightGraph/./src/Vue2LeafletHeightGraph.vue?7fa2","webpack://Vue2LeafletHeightGraph/./node_modules/vue-loader/lib/runtime/componentNormalizer.js","webpack://Vue2LeafletHeightGraph/./src/Vue2LeafletHeightGraph.vue","webpack://Vue2LeafletHeightGraph/./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;QCVA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;AClFA,uC;;;;;;;;ACAA;AAAA;AAAA;AAA0X,CAAgB,+bAAG,EAAC,C;;;;;;;ACA9Y,oD;;;;;;;ACAA,gD;;;;;;;;;;;;;;;;;;;ACAA;;AAEA;AACA,MAAM,IAAuC;AAC7C,IAAI,mBAAO,CAAC,MAAyB;AACrC;;AAEA;AACA;AACA,IAAI,qBAAuB;AAC3B;AACA;;AAEA;AACe,sDAAI;;;ACdnB,0BAA0B,aAAa,0BAA0B,wBAAwB,iBAAiB,aAAa,kBAAkB;AACzI;;;;;;;;;ACDA;AACA;AACA;AACA;AACA,cAAc,WAAW,6BAA6B,6BAA6B;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc,wCAAwC;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,MAAM;AACnB;AACO;AACP;AACA;AACA;AACA,SAAS,YAAY,WAAW,yBAAyB,eAAe,gBAAgB,EAAE;AAC1F;AACA;AACA;AACA;AACA;AACO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;ACvHD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AChHyL,CAAgB,qIAAG,EAAC,C;;;;;ACA7M;;AAEA;AACA;AACA;;AAEe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,qBAAqB;AACrB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AC5FqG;AAC3B;AACL;AACa;;;AAGlF;AACuF;AACvF,gBAAgB,kBAAU;AAC1B,EAAE,kDAAM;AACR,EAAE,MAAM;AACR,EAAE,eAAe;AACjB;AACA;AACA;AACA;;AAEA;;AAEe,4E;;ACnBS;AACA;AACT,qGAAG;AACI","file":"Vue2LeafletHeightGraph.umd.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Vue2LeafletHeightGraph\"] = factory();\n\telse\n\t\troot[\"Vue2LeafletHeightGraph\"] = factory();\n})((typeof self !== 'undefined' ? self : this), function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"fb15\");\n","// extracted by mini-css-extract-plugin","import mod from \"-!../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../node_modules/css-loader/index.js??ref--6-oneOf-1-1!../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../node_modules/cache-loader/dist/cjs.js??ref--0-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./Vue2LeafletHeightGraph.vue?vue&type=style&index=0&lang=css&\"; export default mod; export * from \"-!../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../node_modules/css-loader/index.js??ref--6-oneOf-1-1!../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../node_modules/cache-loader/dist/cjs.js??ref--0-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./Vue2LeafletHeightGraph.vue?vue&type=style&index=0&lang=css&\"","module.exports = require(\"current-script-polyfill\");","module.exports = require(\"leaflet.heightgraph\");","// This file is imported into lib/wc client bundles.\n\nif (typeof window !== 'undefined') {\n if (process.env.NEED_CURRENTSCRIPT_POLYFILL) {\n require('current-script-polyfill')\n }\n\n var i\n if ((i = window.document.currentScript) && (i = i.src.match(/(.+\\/)[^/]+\\.js(\\?.*)?$/))) {\n __webpack_public_path__ = i[1] // eslint-disable-line\n }\n}\n\n// Indicate to webpack that this file can be concatenated\nexport default null\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticStyle:{\"display\":\"none\"}})}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","/**\n * Builds GeoJson Feature\n * @param extraSegment - segment with constant extra value\n * @param coordinates - coordinates array\n * @returns {{geometry: {coordinates: *, type: string}, type: string, properties: {attributeType: *}}}\n */\nconst buildFeature = (extraSegment, coordinates) => {\n const [startIdx, endIdx, attributeType] = extraSegment\n return {\n type: \"Feature\",\n geometry: {\n type: \"LineString\",\n coordinates: coordinates.slice(startIdx, endIdx + 1)\n },\n properties: {\n attributeType: attributeType\n }\n }\n}\n\n/**\n * Builds GeoJson feature collection\n * @param features - all features for\n * @param extraKey\n * @returns {{features: *, type: string, properties: {summary: *}}}\n */\nconst buildFeatureCollection = (features, extraKey) => {\n return {\n type: 'FeatureCollection',\n features: features,\n properties: {\n summary: extraKey\n }\n }\n}\n\n/**\n * Build leaflet.heightgraph data\n * @param extras - ors\n * @param coordinates - coordinates array\n * @returns {Array} height graph conformal data. See https://github.com/GIScience/Leaflet.Heightgraph#supported-data\n */\nconst buildCollections = (extras, coordinates) => {\n let collections = []\n Object.entries(extras)\n .forEach(([extraKey, extraData]) => {\n let features = []\n for (let extraSegment of extraData.values) {\n const feature = buildFeature(extraSegment, coordinates)\n features.push(feature)\n }\n const featureCollection = buildFeatureCollection(features, extraKey)\n collections.push(featureCollection)\n })\n return collections\n}\n\n/**\n * Adds the default attributeType property 'elevation' to Features if it doesn't exist.\n * @param feature\n */\nconst addAttributeTypeProperty = (feature) => {\n feature.properties = feature.properties || {}\n feature.properties.attributeType = typeof feature.properties.attributeType === 'undefined' ? 'elevation' : feature.properties.attributeType\n}\n\n/**\n *\n * @param orsResponse\n * @returns {Array} collections - height graph conformal data. See https://github.com/GIScience/Leaflet.Heightgraph#supported-data\n */\nexport function ors(orsResponse) {\n let collections = null\n let responseObject = typeof orsResponse === 'string' ? JSON.parse(orsResponse) : orsResponse\n // extract coordinates and extras from ors response\n let {features: [{geometry: {coordinates: coordinates}, properties: {extras: extras}}]} = responseObject\n if (extras) {\n collections = buildCollections(extras, coordinates)\n }\n return collections\n}\nexport function normal(data) {\n return data\n}\n\n/**\n * The geoJson parser should accept simple LineString geometries, Features and FeatureCollections.\n * It builds the Array of FeatureCollections containing the required 'summary' and 'attributeType' tags.\n * @param data - the geoJson object\n * @returns {Array}\n */\nexport function geoJson(data) {\n // parse to object if necessary\n data = typeof data === 'string' ? JSON.parse(data) : data\n // transforms LineString data to Feature type\n if (data.type === \"LineString\") {\n data = buildFeature(\n [\n 0,\n data.coordinates.length - 1,\n 'elevation'\n ],\n data.coordinates\n )\n }\n // transforms Feature data to FeatureCollection Type\n if (data.type === \"Feature\") {\n addAttributeTypeProperty(data)\n data = buildFeatureCollection([data], 'elevation')\n }\n // transforms FeatureCollection to array of FeatureCollections\n if (data.type === \"FeatureCollection\")\n for (let feature of data.features) {\n addAttributeTypeProperty(feature)\n }\n data.properties = data.properties || {}\n data.properties.summary = data.properties.summary || 'elevation'\n return [data]\n}\n\n// Template for a custom parser\n/*export function templateParser(yourInputData)\n DO PARSING HERE\n let heighGraphConformalData = parsing(yourInputData)\n return heighGraphConformalData\n}*/\n","\r\n \r\n
\r\n\r\n\r\n\r\n\r\n","import mod from \"-!../node_modules/cache-loader/dist/cjs.js??ref--0-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./Vue2LeafletHeightGraph.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../node_modules/cache-loader/dist/cjs.js??ref--0-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./Vue2LeafletHeightGraph.vue?vue&type=script&lang=js&\"","/* globals __VUE_SSR_CONTEXT__ */\n\n// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).\n// This module is a runtime utility for cleaner component module output and will\n// be included in the final webpack user bundle.\n\nexport default function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode /* vue-cli only */\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}\n","import { render, staticRenderFns } from \"./Vue2LeafletHeightGraph.vue?vue&type=template&id=6cb65d38&\"\nimport script from \"./Vue2LeafletHeightGraph.vue?vue&type=script&lang=js&\"\nexport * from \"./Vue2LeafletHeightGraph.vue?vue&type=script&lang=js&\"\nimport style0 from \"./Vue2LeafletHeightGraph.vue?vue&type=style&index=0&lang=css&\"\n\n\n/* normalize component */\nimport normalizer from \"!../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","import './setPublicPath'\nimport mod from '~entry'\nexport default mod\nexport * from '~entry'\n"],"sourceRoot":""}
\ No newline at end of file
diff --git a/dist/Vue2LeafletHeightGraph.umd.min.js b/dist/Vue2LeafletHeightGraph.umd.min.js
index afd29c5..02ca3c6 100644
--- a/dist/Vue2LeafletHeightGraph.umd.min.js
+++ b/dist/Vue2LeafletHeightGraph.umd.min.js
@@ -1,2 +1,2 @@
-(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t():"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["Vue2LeafletHeightGraph"]=t():e["Vue2LeafletHeightGraph"]=t()})("undefined"!==typeof self?self:this,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s="fb15")}({ae28:function(e,t,r){},c765:function(e,t,r){"use strict";var n=r("ae28"),o=r.n(n);o.a},dc65:function(e,t){e.exports=require("current-script-polyfill")},ef37:function(e,t){e.exports=require("leaflet.heightgraph")},fb15:function(e,t,r){"use strict";r.r(t);var n,o={};(r.r(o),r.d(o,"ors",(function(){return c})),r.d(o,"normal",(function(){return f})),r.d(o,"geoJson",(function(){return d})),"undefined"!==typeof window)&&(r("dc65"),(n=window.document.currentScript)&&(n=n.src.match(/(.+\/)[^/]+\.js(\?.*)?$/))&&(r.p=n[1]));var i=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticStyle:{display:"none"}})},s=[];r("ef37");const a=(e,t)=>{const[r,n,o]=e;return{type:"Feature",geometry:{type:"LineString",coordinates:t.slice(r,n+1)},properties:{attributeType:o}}},u=(e,t)=>{return{type:"FeatureCollection",features:e,properties:{summary:t}}},p=(e,t)=>{let r=[];return Object.entries(e).forEach(([e,n])=>{let o=[];for(let r of n.values){const e=a(r,t);o.push(e)}const i=u(o,e);r.push(i)}),r},l=e=>{e.properties=e.properties||{},e.properties.attributeType=e.properties.attributeType||"elevation"};function c(e){let t=null,r="string"===typeof e?JSON.parse(e):e,{features:[{geometry:{coordinates:n},properties:{extras:o}}]}=r;return o&&(t=p(o,n)),t}function f(e){return e}function d(e){if(e="string"===typeof e?JSON.parse(e):e,"LineString"===e.type&&(e=a([0,e.coordinates.length-1,"elevation"],e.coordinates)),"Feature"===e.type&&(l(e),e=u([e],"elevation")),"FeatureCollection"===e.type)for(let t of e.features)l(t);return e.properties=e.properties||{},e.properties.summary=e.properties.summary||"elevation",[e]}var h={name:"l-control-height-graph",data(){return{availableParsers:o,hgInstance:null}},props:{position:{type:String,default:void 0},expand:{type:Boolean,default:void 0},data:{type:[Object,Array],default:()=>[]},parser:{type:String,default:"normal"},options:{type:Object,default:()=>{}},debug:{type:Boolean,default:!1}},mounted(){this.debug&&console.log("mounted"),this.$nextTick(()=>{const e=this.$parent.mapObject;this.hgInstance=L.control.heightgraph({...this.options,...this.position&&{position:this.position},...this.expand&&{expand:this.expand}}),this.hgInstance.addTo(e);let t=Object.keys(this.availableParsers).includes(this.parser)?this.parser:"normal",r=this.availableParsers[t](this.data);this.hgInstance.addData(r)})},beforeDestroy(){this.debug&&console.log("beforeDestroy"),this.hgInstance&&this.hgInstance.remove()},watch:{data:function(e,t){this.$nextTick(()=>{this.debug&&console.log("data change");try{let t=Object.keys(this.availableParsers).includes(this.parser)?this.parser:"normal";this.hgInstance.addData(this.availableParsers[t](e))}catch(t){console.error('Unable to parse data using "'+this.parser+'" parser.\n'+t)}})}}},y=h;r("c765");function g(e,t,r,n,o,i,s,a){var u,p="function"===typeof e?e.options:e;if(t&&(p.render=t,p.staticRenderFns=r,p._compiled=!0),n&&(p.functional=!0),i&&(p._scopeId="data-v-"+i),s?(u=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(s)},p._ssrRegister=u):o&&(u=a?function(){o.call(this,this.$root.$options.shadowRoot)}:o),u)if(p.functional){p._injectStyles=u;var l=p.render;p.render=function(e,t){return u.call(t),l(e,t)}}else{var c=p.beforeCreate;p.beforeCreate=c?[].concat(c,u):[u]}return{exports:e,options:p}}var b=g(y,i,s,!1,null,null,null),v=b.exports;t["default"]=v}})["default"]}));
+(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t():"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["Vue2LeafletHeightGraph"]=t():e["Vue2LeafletHeightGraph"]=t()})("undefined"!==typeof self?self:this,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="fb15")}({ae28:function(e,t,n){},c765:function(e,t,n){"use strict";var r=n("ae28"),o=n.n(r);o.a},dc65:function(e,t){e.exports=require("current-script-polyfill")},ef37:function(e,t){e.exports=require("leaflet.heightgraph")},fb15:function(e,t,n){"use strict";n.r(t);var r,o={};(n.r(o),n.d(o,"ors",(function(){return p})),n.d(o,"normal",(function(){return d})),n.d(o,"geoJson",(function(){return f})),"undefined"!==typeof window)&&(n("dc65"),(r=window.document.currentScript)&&(r=r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/))&&(n.p=r[1]));var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticStyle:{display:"none"}})},s=[];n("ef37");const a=(e,t)=>{const[n,r,o]=e;return{type:"Feature",geometry:{type:"LineString",coordinates:t.slice(n,r+1)},properties:{attributeType:o}}},l=(e,t)=>{return{type:"FeatureCollection",features:e,properties:{summary:t}}},c=(e,t)=>{let n=[];return Object.entries(e).forEach(([e,r])=>{let o=[];for(let n of r.values){const e=a(n,t);o.push(e)}const i=l(o,e);n.push(i)}),n},u=e=>{e.properties=e.properties||{},e.properties.attributeType="undefined"===typeof e.properties.attributeType?"elevation":e.properties.attributeType};function p(e){let t=null,n="string"===typeof e?JSON.parse(e):e,{features:[{geometry:{coordinates:r},properties:{extras:o}}]}=n;return o&&(t=c(o,r)),t}function d(e){return e}function f(e){if(e="string"===typeof e?JSON.parse(e):e,"LineString"===e.type&&(e=a([0,e.coordinates.length-1,"elevation"],e.coordinates)),"Feature"===e.type&&(u(e),e=l([e],"elevation")),"FeatureCollection"===e.type)for(let t of e.features)u(t);return e.properties=e.properties||{},e.properties.summary=e.properties.summary||"elevation",[e]}var h={name:"l-control-height-graph",data(){return{availableParsers:o,hgInstance:null,controlRef:null}},props:{position:{type:String,default:void 0},expand:{type:Boolean,default:void 0},data:{type:[Object,Array],default:()=>[]},parser:{type:String,default:"normal"},options:{type:Object,default:()=>{}},container:{type:String|Boolean,default:!1},debug:{type:Boolean,default:!1}},mounted(){this.debug&&console.log("mounted");const e=this.$parent.mapObject;if(this.hgInstance=L.control.heightgraph({...this.options,...this.position&&{position:this.position},...this.expand&&{expand:this.expand}}),this.controlRef=this.hgInstance.addTo(e),this.container){const t=this.getContainer();t.innerHTML="",t.appendChild(this.controlRef.onAdd(e)),window.addEventListener("resize",this.onResize);try{document.querySelector(".leaflet-control-container .heightgraph.leaflet-control").hidden=!0}catch(r){console.error("Unable to hide the default height graph control")}}else this.hgInstance.addTo(e);let t=Object.keys(this.availableParsers).includes(this.parser)?this.parser:"normal",n=this.availableParsers[t](this.data);this.hgInstance.addData(n)},beforeDestroy(){this.debug&&console.log("beforeDestroy"),this.hgInstance&&(window.removeEventListener("resize",this.onResize),this.hgInstance.remove(),this.controlRef=null)},watch:{data:function(e,t){this.$nextTick(()=>{this.debug&&console.log("data change");try{let t=Object.keys(this.availableParsers).includes(this.parser)?this.parser:"normal";this.hgInstance.addData(this.availableParsers[t](e))}catch(t){console.error('Unable to parse data using "'+this.parser+'" parser.\n'+t)}})}},methods:{onResize(){const{clientWidth:e,clientHeight:t}=this.getContainer();this.hgInstance.resize({width:e,height:this.options.height||t})},getContainer(){return document.querySelector(this.container)||document.getElementById(this.container)}}},y=h;n("c765");function g(e,t,n,r,o,i,s,a){var l,c="function"===typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=n,c._compiled=!0),r&&(c.functional=!0),i&&(c._scopeId="data-v-"+i),s?(l=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(s)},c._ssrRegister=l):o&&(l=a?function(){o.call(this,this.$root.$options.shadowRoot)}:o),l)if(c.functional){c._injectStyles=l;var u=c.render;c.render=function(e,t){return l.call(t),u(e,t)}}else{var p=c.beforeCreate;c.beforeCreate=p?[].concat(p,l):[l]}return{exports:e,options:c}}var b=g(y,i,s,!1,null,null,null),v=b.exports;t["default"]=v}})["default"]}));
//# sourceMappingURL=Vue2LeafletHeightGraph.umd.min.js.map
\ No newline at end of file
diff --git a/dist/Vue2LeafletHeightGraph.umd.min.js.map b/dist/Vue2LeafletHeightGraph.umd.min.js.map
index 282dd82..166942b 100644
--- a/dist/Vue2LeafletHeightGraph.umd.min.js.map
+++ b/dist/Vue2LeafletHeightGraph.umd.min.js.map
@@ -1 +1 @@
-{"version":3,"sources":["webpack://Vue2LeafletHeightGraph/webpack/universalModuleDefinition","webpack://Vue2LeafletHeightGraph/webpack/bootstrap","webpack://Vue2LeafletHeightGraph/./src/Vue2LeafletHeightGraph.vue?1a1e","webpack://Vue2LeafletHeightGraph/external \"current-script-polyfill\"","webpack://Vue2LeafletHeightGraph/external \"leaflet.heightgraph\"","webpack://Vue2LeafletHeightGraph/./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js","webpack://Vue2LeafletHeightGraph/./src/Vue2LeafletHeightGraph.vue?e7dd","webpack://Vue2LeafletHeightGraph/./src/utils/parser.js","webpack://Vue2LeafletHeightGraph/src/Vue2LeafletHeightGraph.vue","webpack://Vue2LeafletHeightGraph/./src/Vue2LeafletHeightGraph.vue?7fa2","webpack://Vue2LeafletHeightGraph/./node_modules/vue-loader/lib/runtime/componentNormalizer.js","webpack://Vue2LeafletHeightGraph/./src/Vue2LeafletHeightGraph.vue","webpack://Vue2LeafletHeightGraph/./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js"],"names":["root","factory","exports","module","define","amd","self","this","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","require","window","document","currentScript","src","match","render","_vm","_h","$createElement","_c","_self","staticStyle","staticRenderFns","buildFeature","extraSegment","coordinates","startIdx","endIdx","attributeType","type","geometry","slice","properties","buildFeatureCollection","features","extraKey","summary","buildCollections","extras","collections","entries","forEach","extraData","values","feature","push","featureCollection","addAttributeTypeProperty","ors","orsResponse","responseObject","JSON","parse","normal","data","geoJson","length","normalizeComponent","scriptExports","functionalTemplate","injectStyles","scopeId","moduleIdentifier","shadowMode","hook","options","_compiled","functional","_scopeId","context","$vnode","ssrContext","parent","__VUE_SSR_CONTEXT__","_registeredComponents","add","_ssrRegister","$root","$options","shadowRoot","_injectStyles","originalRender","h","existing","beforeCreate","concat","component"],"mappings":"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","file":"Vue2LeafletHeightGraph.umd.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Vue2LeafletHeightGraph\"] = factory();\n\telse\n\t\troot[\"Vue2LeafletHeightGraph\"] = factory();\n})((typeof self !== 'undefined' ? self : this), function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"fb15\");\n","import mod from \"-!../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../node_modules/css-loader/index.js??ref--6-oneOf-1-1!../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../node_modules/cache-loader/dist/cjs.js??ref--0-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./Vue2LeafletHeightGraph.vue?vue&type=style&index=0&lang=css&\"; export default mod; export * from \"-!../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../node_modules/css-loader/index.js??ref--6-oneOf-1-1!../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../node_modules/cache-loader/dist/cjs.js??ref--0-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./Vue2LeafletHeightGraph.vue?vue&type=style&index=0&lang=css&\"","module.exports = require(\"current-script-polyfill\");","module.exports = require(\"leaflet.heightgraph\");","// This file is imported into lib/wc client bundles.\n\nif (typeof window !== 'undefined') {\n if (process.env.NEED_CURRENTSCRIPT_POLYFILL) {\n require('current-script-polyfill')\n }\n\n var i\n if ((i = window.document.currentScript) && (i = i.src.match(/(.+\\/)[^/]+\\.js(\\?.*)?$/))) {\n __webpack_public_path__ = i[1] // eslint-disable-line\n }\n}\n\n// Indicate to webpack that this file can be concatenated\nexport default null\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticStyle:{\"display\":\"none\"}})}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","/**\n * Builds GeoJson Feature\n * @param extraSegment - segment with constant extra value\n * @param coordinates - coordinates array\n * @returns {{geometry: {coordinates: *, type: string}, type: string, properties: {attributeType: *}}}\n */\nconst buildFeature = (extraSegment, coordinates) => {\n const [startIdx, endIdx, attributeType] = extraSegment\n return {\n type: \"Feature\",\n geometry: {\n type: \"LineString\",\n coordinates: coordinates.slice(startIdx, endIdx + 1)\n },\n properties: {\n attributeType: attributeType\n }\n }\n}\n\n/**\n * Builds GeoJson feature collection\n * @param features - all features for\n * @param extraKey\n * @returns {{features: *, type: string, properties: {summary: *}}}\n */\nconst buildFeatureCollection = (features, extraKey) => {\n return {\n type: 'FeatureCollection',\n features: features,\n properties: {\n summary: extraKey\n }\n }\n}\n\n/**\n * Build leaflet.heightgraph data\n * @param extras - ors\n * @param coordinates - coordinates array\n * @returns {Array} height graph conformal data. See https://github.com/GIScience/Leaflet.Heightgraph#supported-data\n */\nconst buildCollections = (extras, coordinates) => {\n let collections = []\n Object.entries(extras)\n .forEach(([extraKey, extraData]) => {\n let features = []\n for (let extraSegment of extraData.values) {\n const feature = buildFeature(extraSegment, coordinates)\n features.push(feature)\n }\n const featureCollection = buildFeatureCollection(features, extraKey)\n collections.push(featureCollection)\n })\n return collections\n}\n\n/**\n * Adds the default attributeType property 'elevation' to Features if it doesn't exist.\n * @param feature\n */\nconst addAttributeTypeProperty = (feature) => {\n feature.properties = feature.properties || {}\n feature.properties.attributeType = feature.properties.attributeType || 'elevation'\n}\n\n/**\n *\n * @param orsResponse\n * @returns {Array} collections - height graph conformal data. See https://github.com/GIScience/Leaflet.Heightgraph#supported-data\n */\nexport function ors(orsResponse) {\n let collections = null\n let responseObject = typeof orsResponse === 'string' ? JSON.parse(orsResponse) : orsResponse\n // extract coordinates and extras from ors response\n let {features: [{geometry: {coordinates: coordinates}, properties: {extras: extras}}]} = responseObject\n if (extras) {\n collections = buildCollections(extras, coordinates)\n }\n return collections\n}\nexport function normal(data) {\n return data\n}\n\n/**\n * The geoJson parser should accept simple LineString geometries, Features and FeatureCollections.\n * It builds the Array of FeatureCollections containing the required 'summary' and 'attributeType' tags.\n * @param data - the geoJson object\n * @returns {Array}\n */\nexport function geoJson(data) {\n // parse to object if necessary\n data = typeof data === 'string' ? JSON.parse(data) : data\n // transforms LineString data to Feature type\n if (data.type === \"LineString\") {\n data = buildFeature(\n [\n 0,\n data.coordinates.length - 1,\n 'elevation'\n ],\n data.coordinates\n )\n }\n // transforms Feature data to FeatureCollection Type\n if (data.type === \"Feature\") {\n addAttributeTypeProperty(data)\n data = buildFeatureCollection([data], 'elevation')\n }\n // transforms FeatureCollection to array of FeatureCollections\n if (data.type === \"FeatureCollection\")\n for (let feature of data.features) {\n addAttributeTypeProperty(feature)\n }\n data.properties = data.properties || {}\n data.properties.summary = data.properties.summary || 'elevation'\n return [data]\n}\n\n// Template for a custom parser\n/*export function templateParser(yourInputData)\n DO PARSING HERE\n let heighGraphConformalData = parsing(yourInputData)\n return heighGraphConformalData\n}*/\n","\r\n \r\n
\r\n\r\n\r\n\r\n\r\n","import mod from \"-!../node_modules/cache-loader/dist/cjs.js??ref--0-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./Vue2LeafletHeightGraph.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../node_modules/cache-loader/dist/cjs.js??ref--0-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./Vue2LeafletHeightGraph.vue?vue&type=script&lang=js&\"","/* globals __VUE_SSR_CONTEXT__ */\n\n// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).\n// This module is a runtime utility for cleaner component module output and will\n// be included in the final webpack user bundle.\n\nexport default function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode /* vue-cli only */\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}\n","import { render, staticRenderFns } from \"./Vue2LeafletHeightGraph.vue?vue&type=template&id=678cdb79&\"\nimport script from \"./Vue2LeafletHeightGraph.vue?vue&type=script&lang=js&\"\nexport * from \"./Vue2LeafletHeightGraph.vue?vue&type=script&lang=js&\"\nimport style0 from \"./Vue2LeafletHeightGraph.vue?vue&type=style&index=0&lang=css&\"\n\n\n/* normalize component */\nimport normalizer from \"!../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","import './setPublicPath'\nimport mod from '~entry'\nexport default mod\nexport * from '~entry'\n"],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"sources":["webpack://Vue2LeafletHeightGraph/webpack/universalModuleDefinition","webpack://Vue2LeafletHeightGraph/webpack/bootstrap","webpack://Vue2LeafletHeightGraph/./src/Vue2LeafletHeightGraph.vue?1a1e","webpack://Vue2LeafletHeightGraph/external \"current-script-polyfill\"","webpack://Vue2LeafletHeightGraph/external \"leaflet.heightgraph\"","webpack://Vue2LeafletHeightGraph/./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js","webpack://Vue2LeafletHeightGraph/./src/Vue2LeafletHeightGraph.vue?7a0b","webpack://Vue2LeafletHeightGraph/./src/utils/parser.js","webpack://Vue2LeafletHeightGraph/src/Vue2LeafletHeightGraph.vue","webpack://Vue2LeafletHeightGraph/./src/Vue2LeafletHeightGraph.vue?7fa2","webpack://Vue2LeafletHeightGraph/./node_modules/vue-loader/lib/runtime/componentNormalizer.js","webpack://Vue2LeafletHeightGraph/./src/Vue2LeafletHeightGraph.vue","webpack://Vue2LeafletHeightGraph/./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js"],"names":["root","factory","exports","module","define","amd","self","this","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","require","window","document","currentScript","src","match","render","_vm","_h","$createElement","_c","_self","staticStyle","staticRenderFns","buildFeature","extraSegment","coordinates","startIdx","endIdx","attributeType","type","geometry","slice","properties","buildFeatureCollection","features","extraKey","summary","buildCollections","extras","collections","entries","forEach","extraData","values","feature","push","featureCollection","addAttributeTypeProperty","ors","orsResponse","responseObject","JSON","parse","normal","data","geoJson","length","normalizeComponent","scriptExports","functionalTemplate","injectStyles","scopeId","moduleIdentifier","shadowMode","hook","options","_compiled","functional","_scopeId","context","$vnode","ssrContext","parent","__VUE_SSR_CONTEXT__","_registeredComponents","add","_ssrRegister","$root","$options","shadowRoot","_injectStyles","originalRender","h","existing","beforeCreate","concat","component"],"mappings":"CAAA,SAA2CA,EAAMC,GAC1B,kBAAZC,SAA0C,kBAAXC,OACxCA,OAAOD,QAAUD,IACQ,oBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,kBAAZC,QACdA,QAAQ,0BAA4BD,IAEpCD,EAAK,0BAA4BC,KARnC,CASoB,qBAATK,KAAuBA,KAAOC,MAAO,WAChD,O,YCTE,IAAIC,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUR,QAGnC,IAAIC,EAASK,EAAiBE,GAAY,CACzCC,EAAGD,EACHE,GAAG,EACHV,QAAS,IAUV,OANAW,EAAQH,GAAUI,KAAKX,EAAOD,QAASC,EAAQA,EAAOD,QAASO,GAG/DN,EAAOS,GAAI,EAGJT,EAAOD,QA0Df,OArDAO,EAAoBM,EAAIF,EAGxBJ,EAAoBO,EAAIR,EAGxBC,EAAoBQ,EAAI,SAASf,EAASgB,EAAMC,GAC3CV,EAAoBW,EAAElB,EAASgB,IAClCG,OAAOC,eAAepB,EAASgB,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEV,EAAoBgB,EAAI,SAASvB,GACX,qBAAXwB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAepB,EAASwB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAepB,EAAS,aAAc,CAAE0B,OAAO,KAQvDnB,EAAoBoB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQnB,EAAoBmB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,kBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFAxB,EAAoBgB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,IACtD,EAAPE,GAA4B,iBAATF,EAAmB,IAAI,IAAIM,KAAON,EAAOnB,EAAoBQ,EAAEe,EAAIE,EAAK,SAASA,GAAO,OAAON,EAAMM,IAAQC,KAAK,KAAMD,IAC9I,OAAOF,GAIRvB,EAAoB2B,EAAI,SAASjC,GAChC,IAAIgB,EAAShB,GAAUA,EAAO4B,WAC7B,WAAwB,OAAO5B,EAAO,YACtC,WAA8B,OAAOA,GAEtC,OADAM,EAAoBQ,EAAEE,EAAQ,IAAKA,GAC5BA,GAIRV,EAAoBW,EAAI,SAASiB,EAAQC,GAAY,OAAOjB,OAAOkB,UAAUC,eAAe1B,KAAKuB,EAAQC,IAGzG7B,EAAoBgC,EAAI,GAIjBhC,EAAoBA,EAAoBiC,EAAI,Q,2DClFrD,yBAA0Y,EAAG,G,mBCA7YvC,EAAOD,QAAUyC,QAAQ,4B,mBCAzBxC,EAAOD,QAAUyC,QAAQ,wB,6CCOnBhC,E,gIALgB,qBAAXiC,UAEP,EAAQ,SAILjC,EAAIiC,OAAOC,SAASC,iBAAmBnC,EAAIA,EAAEoC,IAAIC,MAAM,8BAC1D,IAA0BrC,EAAE,KAKjB,ICdXsC,EAAS,WAAa,IAAIC,EAAI3C,KAAS4C,EAAGD,EAAIE,eAAmBC,EAAGH,EAAII,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACE,YAAY,CAAC,QAAU,WAC7HC,EAAkB,G,UCKtB,MAAMC,EAAe,CAACC,EAAcC,KAChC,MAAOC,EAAUC,EAAQC,GAAiBJ,EAC1C,MAAO,CACHK,KAAM,UACNC,SAAU,CACND,KAAM,aACNJ,YAAaA,EAAYM,MAAML,EAAUC,EAAS,IAEtDK,WAAY,CACRJ,cAAeA,KAWrBK,EAAyB,CAACC,EAAUC,KACtC,MAAO,CACHN,KAAM,oBACNK,SAAUA,EACVF,WAAY,CACRI,QAASD,KAWfE,EAAmB,CAACC,EAAQb,KAC9B,IAAIc,EAAc,GAWlB,OAVApD,OAAOqD,QAAQF,GACdG,QAAQ,EAAEN,EAAUO,MACjB,IAAIR,EAAW,GACf,IAAK,IAAIV,KAAgBkB,EAAUC,OAAQ,CACvC,MAAMC,EAAUrB,EAAaC,EAAcC,GAC3CS,EAASW,KAAKD,GAElB,MAAME,EAAoBb,EAAuBC,EAAUC,GAC3DI,EAAYM,KAAKC,KAEdP,GAOLQ,EAA4BH,IAC9BA,EAAQZ,WAAaY,EAAQZ,YAAc,GAC3CY,EAAQZ,WAAWJ,cAA4D,qBAArCgB,EAAQZ,WAAWJ,cAAgC,YAAcgB,EAAQZ,WAAWJ,eAQ3H,SAASoB,EAAIC,GAChB,IAAIV,EAAc,KACdW,EAAwC,kBAAhBD,EAA2BE,KAAKC,MAAMH,GAAeA,GAE5Ef,WAAYJ,UAAWL,YAAaA,GAAcO,YAAaM,OAAQA,MAAaY,EAIzF,OAHIZ,IACAC,EAAcF,EAAiBC,EAAQb,IAEpCc,EAEJ,SAASc,EAAOC,GACnB,OAAOA,EASJ,SAASC,EAAQD,GAoBpB,GAlBAA,EAAuB,kBAATA,EAAoBH,KAAKC,MAAME,GAAQA,EAEnC,eAAdA,EAAKzB,OACLyB,EAAO/B,EACH,CACI,EACA+B,EAAK7B,YAAY+B,OAAS,EAC1B,aAEJF,EAAK7B,cAIK,YAAd6B,EAAKzB,OACLkB,EAAyBO,GACzBA,EAAOrB,EAAuB,CAACqB,GAAO,cAGxB,sBAAdA,EAAKzB,KACL,IAAK,IAAIe,KAAWU,EAAKpB,SACrBa,EAAyBH,GAIjC,OAFIU,EAAKtB,WAAasB,EAAKtB,YAAc,GACrCsB,EAAKtB,WAAWI,QAAUkB,EAAKtB,WAAWI,SAAW,YAClD,CAACkB,GC5GZ,OACI,KAAJ,yBACI,OACI,MAAR,CACY,iBAAZ,EACY,WAAZ,KACY,WAAZ,OAGI,MAAJ,CACQ,SAAR,CACY,KAAZ,OACY,aAAZ,GAEQ,OAAR,CACY,KAAZ,QACY,aAAZ,GAEQ,KAAR,CACY,KAAZ,eACY,QAAZ,QAEQ,OAAR,CACY,KAAZ,OACY,QAAZ,UAEQ,QAAR,CACY,KAAZ,OACY,QAAZ,QAEQ,UAAR,CACU,KAAV,eACU,SAAV,GAEQ,MAAR,CACY,KAAZ,QACY,SAAZ,IAGI,UACJ,YACY,QAAZ,eAEQ,MAAR,yBAOQ,GANA,KAAR,qDAEA,2CACA,oCAEQ,KAAR,oCACA,gBACU,MAAV,sBACU,EAAV,aACU,EAAV,sCACU,OAAV,yCAGU,IACE,SAAZ,mFACA,SACY,QAAZ,+DAGU,KAAV,oBAEM,IAAN,gFACA,sCACQ,KAAR,uBAEI,gBACJ,YACY,QAAZ,qBAEA,kBACU,OAAV,4CACU,KAAV,oBACY,KAAZ,kBAGI,MAAJ,CACQ,KAAR,cACY,KAAZ,eACA,uCACgB,IACI,IAApB,gFACoB,KAApB,gDACA,SACoB,QAApB,qCACA,0BACA,QAKE,QAAF,CACI,WACE,MAAN,kDACM,KAAN,4DAEI,eACE,OAAN,mFC7GyM,I,UCM1L,SAASG,EACtBC,EACA3C,EACAO,EACAqC,EACAC,EACAC,EACAC,EACAC,GAGA,IAqBIC,EArBAC,EAAmC,oBAAlBP,EACjBA,EAAcO,QACdP,EAiDJ,GA9CI3C,IACFkD,EAAQlD,OAASA,EACjBkD,EAAQ3C,gBAAkBA,EAC1B2C,EAAQC,WAAY,GAIlBP,IACFM,EAAQE,YAAa,GAInBN,IACFI,EAAQG,SAAW,UAAYP,GAI7BC,GACFE,EAAO,SAAUK,GAEfA,EACEA,GACChG,KAAKiG,QAAUjG,KAAKiG,OAAOC,YAC3BlG,KAAKmG,QAAUnG,KAAKmG,OAAOF,QAAUjG,KAAKmG,OAAOF,OAAOC,WAEtDF,GAA0C,qBAAxBI,sBACrBJ,EAAUI,qBAGRb,GACFA,EAAahF,KAAKP,KAAMgG,GAGtBA,GAAWA,EAAQK,uBACrBL,EAAQK,sBAAsBC,IAAIb,IAKtCG,EAAQW,aAAeZ,GACdJ,IACTI,EAAOD,EACH,WAAcH,EAAahF,KAAKP,KAAMA,KAAKwG,MAAMC,SAASC,aAC1DnB,GAGFI,EACF,GAAIC,EAAQE,WAAY,CAGtBF,EAAQe,cAAgBhB,EAExB,IAAIiB,EAAiBhB,EAAQlD,OAC7BkD,EAAQlD,OAAS,SAAmCmE,EAAGb,GAErD,OADAL,EAAKpF,KAAKyF,GACHY,EAAeC,EAAGb,QAEtB,CAEL,IAAIc,EAAWlB,EAAQmB,aACvBnB,EAAQmB,aAAeD,EACnB,GAAGE,OAAOF,EAAUnB,GACpB,CAACA,GAIT,MAAO,CACLhG,QAAS0F,EACTO,QAASA,GClFb,IAAIqB,EAAY,EACd,EACAvE,EACAO,GACA,EACA,KACA,KACA,MAIa,EAAAgE,E,QCjBA,kB","file":"Vue2LeafletHeightGraph.umd.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Vue2LeafletHeightGraph\"] = factory();\n\telse\n\t\troot[\"Vue2LeafletHeightGraph\"] = factory();\n})((typeof self !== 'undefined' ? self : this), function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"fb15\");\n","import mod from \"-!../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../node_modules/css-loader/index.js??ref--6-oneOf-1-1!../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../node_modules/cache-loader/dist/cjs.js??ref--0-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./Vue2LeafletHeightGraph.vue?vue&type=style&index=0&lang=css&\"; export default mod; export * from \"-!../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../node_modules/css-loader/index.js??ref--6-oneOf-1-1!../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../node_modules/cache-loader/dist/cjs.js??ref--0-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./Vue2LeafletHeightGraph.vue?vue&type=style&index=0&lang=css&\"","module.exports = require(\"current-script-polyfill\");","module.exports = require(\"leaflet.heightgraph\");","// This file is imported into lib/wc client bundles.\n\nif (typeof window !== 'undefined') {\n if (process.env.NEED_CURRENTSCRIPT_POLYFILL) {\n require('current-script-polyfill')\n }\n\n var i\n if ((i = window.document.currentScript) && (i = i.src.match(/(.+\\/)[^/]+\\.js(\\?.*)?$/))) {\n __webpack_public_path__ = i[1] // eslint-disable-line\n }\n}\n\n// Indicate to webpack that this file can be concatenated\nexport default null\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticStyle:{\"display\":\"none\"}})}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","/**\n * Builds GeoJson Feature\n * @param extraSegment - segment with constant extra value\n * @param coordinates - coordinates array\n * @returns {{geometry: {coordinates: *, type: string}, type: string, properties: {attributeType: *}}}\n */\nconst buildFeature = (extraSegment, coordinates) => {\n const [startIdx, endIdx, attributeType] = extraSegment\n return {\n type: \"Feature\",\n geometry: {\n type: \"LineString\",\n coordinates: coordinates.slice(startIdx, endIdx + 1)\n },\n properties: {\n attributeType: attributeType\n }\n }\n}\n\n/**\n * Builds GeoJson feature collection\n * @param features - all features for\n * @param extraKey\n * @returns {{features: *, type: string, properties: {summary: *}}}\n */\nconst buildFeatureCollection = (features, extraKey) => {\n return {\n type: 'FeatureCollection',\n features: features,\n properties: {\n summary: extraKey\n }\n }\n}\n\n/**\n * Build leaflet.heightgraph data\n * @param extras - ors\n * @param coordinates - coordinates array\n * @returns {Array} height graph conformal data. See https://github.com/GIScience/Leaflet.Heightgraph#supported-data\n */\nconst buildCollections = (extras, coordinates) => {\n let collections = []\n Object.entries(extras)\n .forEach(([extraKey, extraData]) => {\n let features = []\n for (let extraSegment of extraData.values) {\n const feature = buildFeature(extraSegment, coordinates)\n features.push(feature)\n }\n const featureCollection = buildFeatureCollection(features, extraKey)\n collections.push(featureCollection)\n })\n return collections\n}\n\n/**\n * Adds the default attributeType property 'elevation' to Features if it doesn't exist.\n * @param feature\n */\nconst addAttributeTypeProperty = (feature) => {\n feature.properties = feature.properties || {}\n feature.properties.attributeType = typeof feature.properties.attributeType === 'undefined' ? 'elevation' : feature.properties.attributeType\n}\n\n/**\n *\n * @param orsResponse\n * @returns {Array} collections - height graph conformal data. See https://github.com/GIScience/Leaflet.Heightgraph#supported-data\n */\nexport function ors(orsResponse) {\n let collections = null\n let responseObject = typeof orsResponse === 'string' ? JSON.parse(orsResponse) : orsResponse\n // extract coordinates and extras from ors response\n let {features: [{geometry: {coordinates: coordinates}, properties: {extras: extras}}]} = responseObject\n if (extras) {\n collections = buildCollections(extras, coordinates)\n }\n return collections\n}\nexport function normal(data) {\n return data\n}\n\n/**\n * The geoJson parser should accept simple LineString geometries, Features and FeatureCollections.\n * It builds the Array of FeatureCollections containing the required 'summary' and 'attributeType' tags.\n * @param data - the geoJson object\n * @returns {Array}\n */\nexport function geoJson(data) {\n // parse to object if necessary\n data = typeof data === 'string' ? JSON.parse(data) : data\n // transforms LineString data to Feature type\n if (data.type === \"LineString\") {\n data = buildFeature(\n [\n 0,\n data.coordinates.length - 1,\n 'elevation'\n ],\n data.coordinates\n )\n }\n // transforms Feature data to FeatureCollection Type\n if (data.type === \"Feature\") {\n addAttributeTypeProperty(data)\n data = buildFeatureCollection([data], 'elevation')\n }\n // transforms FeatureCollection to array of FeatureCollections\n if (data.type === \"FeatureCollection\")\n for (let feature of data.features) {\n addAttributeTypeProperty(feature)\n }\n data.properties = data.properties || {}\n data.properties.summary = data.properties.summary || 'elevation'\n return [data]\n}\n\n// Template for a custom parser\n/*export function templateParser(yourInputData)\n DO PARSING HERE\n let heighGraphConformalData = parsing(yourInputData)\n return heighGraphConformalData\n}*/\n","\r\n \r\n
\r\n\r\n\r\n\r\n\r\n","import mod from \"-!../node_modules/cache-loader/dist/cjs.js??ref--0-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./Vue2LeafletHeightGraph.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../node_modules/cache-loader/dist/cjs.js??ref--0-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./Vue2LeafletHeightGraph.vue?vue&type=script&lang=js&\"","/* globals __VUE_SSR_CONTEXT__ */\n\n// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).\n// This module is a runtime utility for cleaner component module output and will\n// be included in the final webpack user bundle.\n\nexport default function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode /* vue-cli only */\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}\n","import { render, staticRenderFns } from \"./Vue2LeafletHeightGraph.vue?vue&type=template&id=6cb65d38&\"\nimport script from \"./Vue2LeafletHeightGraph.vue?vue&type=script&lang=js&\"\nexport * from \"./Vue2LeafletHeightGraph.vue?vue&type=script&lang=js&\"\nimport style0 from \"./Vue2LeafletHeightGraph.vue?vue&type=style&index=0&lang=css&\"\n\n\n/* normalize component */\nimport normalizer from \"!../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","import './setPublicPath'\nimport mod from '~entry'\nexport default mod\nexport * from '~entry'\n"],"sourceRoot":""}
\ No newline at end of file
diff --git a/package-lock.json b/package-lock.json
index 6eed873..fc4c363 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1658,6 +1658,70 @@
"postcss": "^7.0.0"
}
},
+ "@mapbox/geojson-rewind": {
+ "version": "0.5.2",
+ "resolved": "https://registry.npmjs.org/@mapbox/geojson-rewind/-/geojson-rewind-0.5.2.tgz",
+ "integrity": "sha512-tJaT+RbYGJYStt7wI3cq4Nl4SXxG8W7JDG5DMJu97V25RnbNg3QtQtf+KD+VLjNpWKYsRvXDNmNrBgEETr1ifA==",
+ "requires": {
+ "get-stream": "^6.0.1",
+ "minimist": "^1.2.6"
+ },
+ "dependencies": {
+ "get-stream": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz",
+ "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg=="
+ },
+ "minimist": {
+ "version": "1.2.8",
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
+ "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA=="
+ }
+ }
+ },
+ "@mapbox/geojson-types": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/@mapbox/geojson-types/-/geojson-types-1.0.2.tgz",
+ "integrity": "sha512-e9EBqHHv3EORHrSfbR9DqecPNn+AmuAoQxV6aL8Xu30bJMJR1o8PZLZzpk1Wq7/NfCbuhmakHTPYRhoqLsXRnw=="
+ },
+ "@mapbox/jsonlint-lines-primitives": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/@mapbox/jsonlint-lines-primitives/-/jsonlint-lines-primitives-2.0.2.tgz",
+ "integrity": "sha512-rY0o9A5ECsTQRVhv7tL/OyDpGAoUB4tTvLiW1DSzQGq4bvTPhNw1VpSNjDJc5GFZ2XuyOtSWSVN05qOtcD71qQ=="
+ },
+ "@mapbox/mapbox-gl-supported": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/@mapbox/mapbox-gl-supported/-/mapbox-gl-supported-1.5.0.tgz",
+ "integrity": "sha512-/PT1P6DNf7vjEEiPkVIRJkvibbqWtqnyGaBz3nfRdcxclNSnSdaLU5tfAgcD7I8Yt5i+L19s406YLl1koLnLbg=="
+ },
+ "@mapbox/point-geometry": {
+ "version": "0.1.0",
+ "resolved": "https://registry.npmjs.org/@mapbox/point-geometry/-/point-geometry-0.1.0.tgz",
+ "integrity": "sha512-6j56HdLTwWGO0fJPlrZtdU/B13q8Uwmo18Ck2GnGgN9PCFyKTZ3UbXeEdRFh18i9XQ92eH2VdtpJHpBD3aripQ=="
+ },
+ "@mapbox/tiny-sdf": {
+ "version": "1.2.5",
+ "resolved": "https://registry.npmjs.org/@mapbox/tiny-sdf/-/tiny-sdf-1.2.5.tgz",
+ "integrity": "sha512-cD8A/zJlm6fdJOk6DqPUV8mcpyJkRz2x2R+/fYcWDYG3oWbG7/L7Yl/WqQ1VZCjnL9OTIMAn6c+BC5Eru4sQEw=="
+ },
+ "@mapbox/unitbezier": {
+ "version": "0.0.0",
+ "resolved": "https://registry.npmjs.org/@mapbox/unitbezier/-/unitbezier-0.0.0.tgz",
+ "integrity": "sha512-HPnRdYO0WjFjRTSwO3frz1wKaU649OBFPX3Zo/2WZvuRi6zMiRGui8SnPQiQABgqCf8YikDe5t3HViTVw1WUzA=="
+ },
+ "@mapbox/vector-tile": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/@mapbox/vector-tile/-/vector-tile-1.3.1.tgz",
+ "integrity": "sha512-MCEddb8u44/xfQ3oD+Srl/tNcQoqTw3goGk2oLsrFxOTc3dUp+kAnby3PvAeeBYSMSjSPD1nd1AJA6W49WnoUw==",
+ "requires": {
+ "@mapbox/point-geometry": "~0.1.0"
+ }
+ },
+ "@mapbox/whoots-js": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/@mapbox/whoots-js/-/whoots-js-3.1.0.tgz",
+ "integrity": "sha512-Es6WcD0nO5l+2BOQS4uLfNPYQaNDfbot3X1XUoloz+x0mPDS3eeORZJl06HXjwBG1fOGwCRnzK88LMdxKRrd6Q=="
+ },
"@mrmlnc/readdir-enhanced": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz",
@@ -2515,8 +2579,7 @@
"@types/color-name": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz",
- "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==",
- "dev": true
+ "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ=="
},
"@types/connect": {
"version": "3.4.33",
@@ -2714,15 +2777,6 @@
"integrity": "sha512-Jus9s4CDbqwocc5pOAnh8ShfrnMcPHuJYzVcSUU7lrh8Ni5HuIqX3oilL86p3dlTrk0LzHRCgA/GQ7uNCw6l2Q==",
"dev": true
},
- "@types/mini-css-extract-plugin": {
- "version": "0.9.1",
- "resolved": "https://registry.npmjs.org/@types/mini-css-extract-plugin/-/mini-css-extract-plugin-0.9.1.tgz",
- "integrity": "sha512-+mN04Oszdz9tGjUP/c1ReVwJXxSniLd7lF++sv+8dkABxVNthg6uccei+4ssKxRHGoMmPxdn7uBdJWONSJGTGQ==",
- "dev": true,
- "requires": {
- "@types/webpack": "*"
- }
- },
"@types/minimatch": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz",
@@ -3653,6 +3707,56 @@
"integrity": "sha512-O9TdcR0NDwtCB8CoRSOtPd8KlqQGT9/PZRicvKMTt8F3q5G1zIgKeEEbWlez5Il8wKLnGDOpVOHpQSCIykTs5A==",
"dev": true
},
+ "ansi-styles": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+ "dev": true,
+ "requires": {
+ "color-convert": "^2.0.1"
+ }
+ },
+ "chalk": {
+ "version": "4.1.2",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+ "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
+ "dev": true,
+ "requires": {
+ "ansi-styles": "^4.1.0",
+ "supports-color": "^7.1.0"
+ }
+ },
+ "has-flag": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
+ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
+ "dev": true
+ },
+ "loader-utils": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz",
+ "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==",
+ "dev": true,
+ "requires": {
+ "big.js": "^5.2.2",
+ "emojis-list": "^3.0.0",
+ "json5": "^2.1.2"
+ },
+ "dependencies": {
+ "emojis-list": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz",
+ "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==",
+ "dev": true
+ },
+ "json5": {
+ "version": "2.2.3",
+ "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz",
+ "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==",
+ "dev": true
+ }
+ }
+ },
"pnp-webpack-plugin": {
"version": "1.6.4",
"resolved": "https://registry.npmjs.org/pnp-webpack-plugin/-/pnp-webpack-plugin-1.6.4.tgz",
@@ -3661,6 +3765,26 @@
"requires": {
"ts-pnp": "^1.1.6"
}
+ },
+ "supports-color": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
+ "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
+ "dev": true,
+ "requires": {
+ "has-flag": "^4.0.0"
+ }
+ },
+ "vue-loader-v16": {
+ "version": "npm:vue-loader@16.8.3",
+ "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.8.3.tgz",
+ "integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
+ "dev": true,
+ "requires": {
+ "chalk": "^4.1.0",
+ "hash-sum": "^2.0.0",
+ "loader-utils": "^2.0.0"
+ }
}
}
},
@@ -3912,7 +4036,6 @@
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz",
"integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==",
- "dev": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
@@ -3922,7 +4045,6 @@
"version": "4.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz",
"integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==",
- "dev": true,
"requires": {
"@types/color-name": "^1.1.1",
"color-convert": "^2.0.1"
@@ -3931,14 +4053,12 @@
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
- "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
- "dev": true
+ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ=="
},
"supports-color": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz",
"integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==",
- "dev": true,
"requires": {
"has-flag": "^4.0.0"
}
@@ -3971,7 +4091,6 @@
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
- "dev": true,
"requires": {
"color-name": "~1.1.4"
}
@@ -3979,8 +4098,7 @@
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
- "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
- "dev": true
+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
},
"copy-webpack-plugin": {
"version": "5.1.1",
@@ -4195,8 +4313,7 @@
"hash-sum": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/hash-sum/-/hash-sum-2.0.0.tgz",
- "integrity": "sha512-WdZTbAByD+pHfl/g9QSsBIIwy8IT+EsPiKDs0KNX+zSHhdDLFKdZu0BQHljvO+0QI/BasbMSUa8wYNCZTvhslg==",
- "dev": true
+ "integrity": "sha512-WdZTbAByD+pHfl/g9QSsBIIwy8IT+EsPiKDs0KNX+zSHhdDLFKdZu0BQHljvO+0QI/BasbMSUa8wYNCZTvhslg=="
},
"icss-utils": {
"version": "4.1.1",
@@ -4755,12 +4872,10 @@
}
},
"vue-loader-v16": {
- "version": "npm:vue-loader@16.0.0-beta.4",
+ "version": "npm:vue-loader-v16@16.0.0-beta.4",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.0.0-beta.4.tgz",
"integrity": "sha512-uh/+SIwoN+hny0+GqxdkTuEmt1NV4wb8etF5cKkB1YVMv29ck0byrmkt8IIYadQ3r/fiYsr2brGJqP+hytQwuw==",
- "dev": true,
"requires": {
- "@types/mini-css-extract-plugin": "^0.9.1",
"chalk": "^3.0.0",
"hash-sum": "^2.0.0",
"loader-utils": "^1.2.3",
@@ -6686,8 +6801,7 @@
"big.js": {
"version": "5.2.2",
"resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz",
- "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==",
- "dev": true
+ "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ=="
},
"binary-extensions": {
"version": "1.13.1",
@@ -8817,6 +8931,11 @@
"integrity": "sha512-WwOrosiQTvyms+Ti5ZC5vGEK0Vod3FTt1ca+payZqvKuGJF+dq7bG63DstxtN0dpm6FxY27a/zS3Wten+gEtGw==",
"dev": true
},
+ "csscolorparser": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/csscolorparser/-/csscolorparser-1.0.3.tgz",
+ "integrity": "sha512-umPSgYwZkdFoUrH5hIq5kf0wPSXiro51nPw0j2K/c83KflkPSTBGMz6NJvMB+07VlL0y7VPo6QJcDjcgKTTm3w=="
+ },
"cssesc": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/cssesc/-/cssesc-2.0.0.tgz",
@@ -9734,6 +9853,11 @@
"stream-shift": "^1.0.0"
}
},
+ "earcut": {
+ "version": "2.2.4",
+ "resolved": "https://registry.npmjs.org/earcut/-/earcut-2.2.4.tgz",
+ "integrity": "sha512-/pjZsA1b4RPHbeWZQn66SWS8nZZWLQQ23oE3Eam7aroEFGEvwKAsJfZ9ytiEMycfzXWpca4FA9QIOehf7PocBQ=="
+ },
"easy-stack": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/easy-stack/-/easy-stack-1.0.0.tgz",
@@ -9806,8 +9930,7 @@
"emojis-list": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz",
- "integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k=",
- "dev": true
+ "integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k="
},
"encodeurl": {
"version": "1.0.2",
@@ -11484,6 +11607,11 @@
"integrity": "sha512-r8EC6NO1sngH/zdD9fiRDLdcgnbayXah+mLgManTaIZJqEC1MZstmnox8KpnI2/fxQwrp5OpCOYWLp4rBl4Jcg==",
"dev": true
},
+ "geojson-vt": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/geojson-vt/-/geojson-vt-3.2.1.tgz",
+ "integrity": "sha512-EvGQQi/zPrDA6zr6BnJD/YhwAkBP8nnJ9emh3EnHQKVMfg/MRVtPbMYdgVy/IaEmn4UfagD2a6fafPDL5hbtwg=="
+ },
"get-caller-file": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
@@ -11643,6 +11771,11 @@
"git-up": "^4.0.0"
}
},
+ "gl-matrix": {
+ "version": "3.4.3",
+ "resolved": "https://registry.npmjs.org/gl-matrix/-/gl-matrix-3.4.3.tgz",
+ "integrity": "sha512-wcCp8vu8FT22BnvKVPjXa/ICBWRq/zjFfdofZy1WSpQZpphblv12/bOQLBC1rMM7SGOFS9ltVmKOHil5+Ml7gA=="
+ },
"glob": {
"version": "7.1.6",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz",
@@ -11890,6 +12023,11 @@
}
}
},
+ "grid-index": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/grid-index/-/grid-index-1.1.0.tgz",
+ "integrity": "sha512-HZRwumpOGUrHyxO5bqKZL0B0GlUpwtCAzZ42sgxUPniu33R1LSFH5yrIcBCHjkctCAh3mtWKcKd9J4vDDdeVHA=="
+ },
"growly": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/growly/-/growly-1.3.0.tgz",
@@ -12431,8 +12569,7 @@
"ieee754": {
"version": "1.1.13",
"resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz",
- "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==",
- "dev": true
+ "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg=="
},
"iferr": {
"version": "0.1.5",
@@ -13363,7 +13500,6 @@
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz",
"integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==",
- "dev": true,
"requires": {
"minimist": "^1.2.0"
},
@@ -13371,8 +13507,7 @@
"minimist": {
"version": "1.2.5",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
- "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==",
- "dev": true
+ "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw=="
}
}
},
@@ -13397,6 +13532,11 @@
"verror": "1.10.0"
}
},
+ "kdbush": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/kdbush/-/kdbush-3.0.0.tgz",
+ "integrity": "sha512-hRkd6/XW4HTsA9vjVpY9tuXJYLSlelnkTmVFu4M9/7MIYQtFcHpbugAU7UbOfjOiVSVYl2fqgBuJ32JUmRo5Ew=="
+ },
"keyv": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/keyv/-/keyv-3.0.0.tgz",
@@ -13452,11 +13592,11 @@
"integrity": "sha512-CPkhyqWUKZKFJ6K8umN5/D2wrJ2+/8UIpXppY7QDnUZW5bZL5+SEI2J7GBpwh4LIupOKqbNSQXgqmrEJopHVNQ=="
},
"leaflet.heightgraph": {
- "version": "1.3.2",
- "resolved": "https://registry.npmjs.org/leaflet.heightgraph/-/leaflet.heightgraph-1.3.2.tgz",
- "integrity": "sha512-GdNQdkxJziBItFwWPN8teeg4UUzQWEizh5w7VU9JJ8VNMSfqVCvk/D4aOFL6OhTAamUbFSYn6FWQAuyOJvQlSg==",
+ "version": "git+https://github.com/boldtrn/Leaflet.Heightgraph.git#e9216f8b480ba63bebf5d4a8aa254fab63ef63de",
+ "from": "git+https://github.com/boldtrn/Leaflet.Heightgraph.git#e9216f8",
"requires": {
- "leaflet": "^1.6.0"
+ "leaflet": "^1.6.0",
+ "mapbox-gl": "1.13.0"
}
},
"leven": {
@@ -13697,7 +13837,6 @@
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.2.3.tgz",
"integrity": "sha512-fkpz8ejdnEMG3s37wGL07iSBDg99O9D5yflE9RGNH3hRdx9SOwYfnGYdZOUIZitN8E+E2vkq3MUMYMvPYl5ZZA==",
- "dev": true,
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^2.0.0",
@@ -13968,6 +14107,36 @@
"object-visit": "^1.0.0"
}
},
+ "mapbox-gl": {
+ "version": "1.13.0",
+ "resolved": "https://registry.npmjs.org/mapbox-gl/-/mapbox-gl-1.13.0.tgz",
+ "integrity": "sha512-g8zlzuJxYJqbOPXT19/UBYpVrcefBQ06F/Cbj0fyEfFnFesDcU3cFTxd75/FZ6Upx2ZEjCsD61CHxrcxZidVpA==",
+ "requires": {
+ "@mapbox/geojson-rewind": "^0.5.0",
+ "@mapbox/geojson-types": "^1.0.2",
+ "@mapbox/jsonlint-lines-primitives": "^2.0.2",
+ "@mapbox/mapbox-gl-supported": "^1.5.0",
+ "@mapbox/point-geometry": "^0.1.0",
+ "@mapbox/tiny-sdf": "^1.1.1",
+ "@mapbox/unitbezier": "^0.0.0",
+ "@mapbox/vector-tile": "^1.3.1",
+ "@mapbox/whoots-js": "^3.1.0",
+ "csscolorparser": "~1.0.3",
+ "earcut": "^2.2.2",
+ "geojson-vt": "^3.2.1",
+ "gl-matrix": "^3.2.1",
+ "grid-index": "^1.1.0",
+ "minimist": "^1.2.5",
+ "murmurhash-js": "^1.0.0",
+ "pbf": "^3.2.1",
+ "potpack": "^1.0.1",
+ "quickselect": "^2.0.0",
+ "rw": "^1.3.3",
+ "supercluster": "^7.1.0",
+ "tinyqueue": "^2.0.3",
+ "vt-pbf": "^3.1.1"
+ }
+ },
"md5.js": {
"version": "1.3.5",
"resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz",
@@ -14017,7 +14186,6 @@
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/merge-source-map/-/merge-source-map-1.1.0.tgz",
"integrity": "sha512-Qkcp7P2ygktpMPh2mCQZaf3jhN6D3Z/qVZHSdWvQ+2Ef5HgRAPBO57A77+ENm0CPx2+1Ce/MYKi3ymqdfuqibw==",
- "dev": true,
"requires": {
"source-map": "^0.6.1"
}
@@ -14183,8 +14351,7 @@
"minimist": {
"version": "1.2.5",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
- "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==",
- "dev": true
+ "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw=="
},
"minipass": {
"version": "2.9.0",
@@ -14309,6 +14476,11 @@
"integrity": "sha1-iZ8R2WhuXgXLkbNdXw5jt3PPyQE=",
"dev": true
},
+ "murmurhash-js": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/murmurhash-js/-/murmurhash-js-1.0.0.tgz",
+ "integrity": "sha512-TvmkNhkv8yct0SVBSy+o8wYzXjE4Zz3PCesbfs8HiCXXdcTuocApFv11UWlNFWKYsP2okqrhb7JNlSm9InBhIw=="
+ },
"mute-stream": {
"version": "0.0.8",
"resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz",
@@ -15294,6 +15466,15 @@
}
}
},
+ "pbf": {
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/pbf/-/pbf-3.3.0.tgz",
+ "integrity": "sha512-XDF38WCH3z5OV/OVa8GKUNtLAyneuzbCisx7QUCF8Q6Nutx0WnJrQe5O+kOtBlLfRNUws98Y58Lblp+NJG5T4Q==",
+ "requires": {
+ "ieee754": "^1.1.12",
+ "resolve-protobuf-schema": "^2.1.0"
+ }
+ },
"pbkdf2": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.1.tgz",
@@ -16010,6 +16191,11 @@
"integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==",
"dev": true
},
+ "potpack": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/potpack/-/potpack-1.0.2.tgz",
+ "integrity": "sha512-choctRBIV9EMT9WGAZHn3V7t0Z2pMQyl0EZE6pFc/6ml3ssw7Dlf/oAOvFwjm1HVsqfQN8GfeFyJ+d8tRzqueQ=="
+ },
"prelude-ls": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz",
@@ -16092,6 +16278,11 @@
"integrity": "sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk=",
"dev": true
},
+ "protocol-buffers-schema": {
+ "version": "3.6.0",
+ "resolved": "https://registry.npmjs.org/protocol-buffers-schema/-/protocol-buffers-schema-3.6.0.tgz",
+ "integrity": "sha512-TdDRD+/QNdrCGCE7v8340QyuXd4kIWIgapsE2+n/SaGiSSbomYl4TjHlvIoCWRpE7wFt02EpB35VVA2ImcBVqw=="
+ },
"protocols": {
"version": "1.4.7",
"resolved": "https://registry.npmjs.org/protocols/-/protocols-1.4.7.tgz",
@@ -16243,6 +16434,11 @@
"integrity": "sha512-w7fLxIRCRT7U8Qu53jQnJyPkYZIaR4n5151KMfcJlO/A9397Wxb1amJvROTK6TOnp7PfoAmg/qXiNHI+08jRfA==",
"dev": true
},
+ "quickselect": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/quickselect/-/quickselect-2.0.0.tgz",
+ "integrity": "sha512-RKJ22hX8mHe3Y6wH/N3wCM6BWtjaxIyyUIkpHOvfFnxdI4yD4tBXEBKSbriGujF6jnSVkJrffuo6vxACiSSxIw=="
+ },
"randombytes": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz",
@@ -16683,6 +16879,14 @@
"integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=",
"dev": true
},
+ "resolve-protobuf-schema": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/resolve-protobuf-schema/-/resolve-protobuf-schema-2.1.0.tgz",
+ "integrity": "sha512-kI5ffTiZWmJaS/huM8wZfEMer1eRd7oJQhDuxeCLe3t7N7mX3z94CN0xPxBQxFYQTSNz9T0i+v6inKqSdK8xrQ==",
+ "requires": {
+ "protocol-buffers-schema": "^3.3.1"
+ }
+ },
"resolve-url": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz",
@@ -16796,6 +17000,11 @@
"aproba": "^1.1.1"
}
},
+ "rw": {
+ "version": "1.3.3",
+ "resolved": "https://registry.npmjs.org/rw/-/rw-1.3.3.tgz",
+ "integrity": "sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ=="
+ },
"rxjs": {
"version": "6.6.0",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.0.tgz",
@@ -17404,8 +17613,7 @@
"source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
- "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
- "dev": true
+ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="
},
"source-map-resolve": {
"version": "0.5.2",
@@ -17992,6 +18200,14 @@
}
}
},
+ "supercluster": {
+ "version": "7.1.5",
+ "resolved": "https://registry.npmjs.org/supercluster/-/supercluster-7.1.5.tgz",
+ "integrity": "sha512-EulshI3pGUM66o6ZdH3ReiFcvHpM3vAigyK+vcxdjpJyEbIIrtbmBdY23mGgnI24uXiGFvrGq9Gkum/8U7vJWg==",
+ "requires": {
+ "kdbush": "^3.0.0"
+ }
+ },
"supports-color": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
@@ -18574,6 +18790,11 @@
"dev": true,
"optional": true
},
+ "tinyqueue": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/tinyqueue/-/tinyqueue-2.0.3.tgz",
+ "integrity": "sha512-ppJZNDuKGgxzkHihX8v9v9G5f+18gzaTfrukGrq6ueg0lmH4nqVnA2IPG0AEH3jKEk2GRJCUhDoqpoiw3PHLBA=="
+ },
"tmp": {
"version": "0.0.33",
"resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz",
@@ -19287,6 +19508,16 @@
"integrity": "sha512-sLI2L0uGov3wKVb9EB+vIQBl9tVP90nqRvxSoJ35vI3NjxE8jfsE5DSOhWgSunHSZmKS4OCi2jrtfxK7uyp2ww==",
"dev": true
},
+ "vt-pbf": {
+ "version": "3.1.3",
+ "resolved": "https://registry.npmjs.org/vt-pbf/-/vt-pbf-3.1.3.tgz",
+ "integrity": "sha512-2LzDFzt0mZKZ9IpVF2r69G9bXaP2Q2sArJCmcCgvfTdCCZzSyz4aCLoQyUilu37Ll56tCblIZrXFIjNUpGIlmA==",
+ "requires": {
+ "@mapbox/point-geometry": "0.1.0",
+ "@mapbox/vector-tile": "^1.3.1",
+ "pbf": "^3.2.1"
+ }
+ },
"vue": {
"version": "2.6.11",
"resolved": "https://registry.npmjs.org/vue/-/vue-2.6.11.tgz",
diff --git a/package.json b/package.json
index 2a077a5..271d0e3 100644
--- a/package.json
+++ b/package.json
@@ -34,15 +34,15 @@
"vue2-leaflet": "^2.5.2"
},
"dependencies": {
- "leaflet.heightgraph": "^1.3.2"
+ "leaflet.heightgraph": "https://github.com/boldtrn/Leaflet.Heightgraph#e9216f8"
},
"devDependencies": {
- "leaflet": "^1.6.0",
"@types/leaflet": "^1.5.17",
"@vue/cli": "^4.4.6",
+ "@vue/cli-plugin-eslint": "^4.4.6",
"@vue/cli-service": "^3.12.1",
"@vue/cli-service-global": "^4.4.6",
- "@vue/cli-plugin-eslint": "^4.4.6",
+ "leaflet": "^1.6.0",
"vue-template-compiler": "^2.6.11",
"vue2-leaflet": "^2.5.2",
"webpack-node-externals": "^1.7.2"
diff --git a/public/index.html b/public/index.html
new file mode 100644
index 0000000..a1195ad
--- /dev/null
+++ b/public/index.html
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+ Your App
+
+
+
+
+
diff --git a/src/Vue2LeafletHeightGraph.vue b/src/Vue2LeafletHeightGraph.vue
index a947a5c..6e9db68 100644
--- a/src/Vue2LeafletHeightGraph.vue
+++ b/src/Vue2LeafletHeightGraph.vue
@@ -12,7 +12,8 @@
data () {
return {
availableParsers: parsers,
- hgInstance: null
+ hgInstance: null,
+ controlRef: null,
}
},
props: {
@@ -36,6 +37,10 @@
type: Object,
default: () => {}
},
+ container: {
+ type: String | Boolean,
+ default: false
+ },
debug: {
type: Boolean,
default: false
@@ -45,25 +50,40 @@
if(this.debug) {
console.log('mounted')
}
- this.$nextTick(() => {
- const map = this.$parent.mapObject;
- this.hgInstance = L.control.heightgraph({...this.options,...{
- // merges quick settings with options if they are defined
- ...(this.position && {position: this.position}),
- ...(this.expand && {expand: this.expand})
- }})
- this.hgInstance.addTo(map)
- let p = Object.keys(this.availableParsers).includes(this.parser) ? this.parser : 'normal'
- let dataCollections = this.availableParsers[p](this.data)
- this.hgInstance.addData(dataCollections)
- })
+ const map = this.$parent.mapObject;
+ this.hgInstance = L.control.heightgraph({...this.options,...{
+ // merges quick settings with options if they are defined
+ ...(this.position && {position: this.position}),
+ ...(this.expand && {expand: this.expand})
+ }})
+ this.controlRef = this.hgInstance.addTo(map)
+ if(this.container) {
+ const container = this.getContainer();
+ container.innerHTML = ''
+ container.appendChild(this.controlRef.onAdd(map));
+ window.addEventListener('resize', this.onResize);
+
+
+ try {
+ document.querySelector('.leaflet-control-container .heightgraph.leaflet-control').hidden = true
+ } catch (e) {
+ console.error('Unable to hide the default height graph control')
+ }
+ } else {
+ this.hgInstance.addTo(map)
+ }
+ let p = Object.keys(this.availableParsers).includes(this.parser) ? this.parser : 'normal'
+ let dataCollections = this.availableParsers[p](this.data)
+ this.hgInstance.addData(dataCollections)
},
beforeDestroy() {
if(this.debug) {
console.log('beforeDestroy')
}
if(this.hgInstance) {
- this.hgInstance.remove()
+ window.removeEventListener('resize', this.onResize);
+ this.hgInstance.remove()
+ this.controlRef = null;
}
},
watch: {
@@ -80,7 +100,16 @@
}
})
}
+ },
+ methods: {
+ onResize() {
+ const { clientWidth: width, clientHeight: height } = this.getContainer();
+ this.hgInstance.resize({ width, height: this.options.height || height });
+ },
+ getContainer() {
+ return document.querySelector(this.container) || document.getElementById(this.container);
}
+ }
}
diff --git a/src/utils/parser.js b/src/utils/parser.js
index 66d5146..37c537c 100644
--- a/src/utils/parser.js
+++ b/src/utils/parser.js
@@ -61,7 +61,7 @@ const buildCollections = (extras, coordinates) => {
*/
const addAttributeTypeProperty = (feature) => {
feature.properties = feature.properties || {}
- feature.properties.attributeType = feature.properties.attributeType || 'elevation'
+ feature.properties.attributeType = typeof feature.properties.attributeType === 'undefined' ? 'elevation' : feature.properties.attributeType
}
/**