@abi-software/flatmapvuer 0.3.12-fixes-0 → 0.3.13-beta-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -96,6 +96,13 @@ return /******/ (function(modules) { // webpackBootstrap
96
96
  /************************************************************************/
97
97
  /******/ ({
98
98
 
99
+ /***/ "0654":
100
+ /***/ (function(module, exports, __webpack_require__) {
101
+
102
+ // extracted by mini-css-extract-plugin
103
+
104
+ /***/ }),
105
+
99
106
  /***/ "06f1":
100
107
  /***/ (function(module, exports, __webpack_require__) {
101
108
 
@@ -772,24 +779,6 @@ module.exports = require("core-js/modules/es.string.search.js");
772
779
 
773
780
  module.exports = require("core-js/modules/es.array.push.js");
774
781
 
775
- /***/ }),
776
-
777
- /***/ "2804":
778
- /***/ (function(module, exports, __webpack_require__) {
779
-
780
- // extracted by mini-css-extract-plugin
781
-
782
- /***/ }),
783
-
784
- /***/ "2a5c":
785
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
786
-
787
- "use strict";
788
- /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_MultiFlatmapVuer_vue_vue_type_style_index_0_id_a7b93f3a_prod_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("d3e9");
789
- /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_MultiFlatmapVuer_vue_vue_type_style_index_0_id_a7b93f3a_prod_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_MultiFlatmapVuer_vue_vue_type_style_index_0_id_a7b93f3a_prod_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_0__);
790
- /* unused harmony reexport * */
791
-
792
-
793
782
  /***/ }),
794
783
 
795
784
  /***/ "2a5e":
@@ -7652,6 +7641,13 @@ function objToArray(obj) {
7652
7641
 
7653
7642
  /***/ }),
7654
7643
 
7644
+ /***/ "813c":
7645
+ /***/ (function(module, exports, __webpack_require__) {
7646
+
7647
+ // extracted by mini-css-extract-plugin
7648
+
7649
+ /***/ }),
7650
+
7655
7651
  /***/ "831f":
7656
7652
  /***/ (function(module, exports) {
7657
7653
 
@@ -8623,6 +8619,17 @@ tag.install = function (Vue) {
8623
8619
 
8624
8620
  module.exports = require("vue");
8625
8621
 
8622
+ /***/ }),
8623
+
8624
+ /***/ "9418":
8625
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
8626
+
8627
+ "use strict";
8628
+ /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_MultiFlatmapVuer_vue_vue_type_style_index_0_id_92af3352_prod_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("0654");
8629
+ /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_MultiFlatmapVuer_vue_vue_type_style_index_0_id_92af3352_prod_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_MultiFlatmapVuer_vue_vue_type_style_index_0_id_92af3352_prod_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_0__);
8630
+ /* unused harmony reexport * */
8631
+
8632
+
8626
8633
  /***/ }),
8627
8634
 
8628
8635
  /***/ "97d3":
@@ -8651,6 +8658,17 @@ module.exports = require("@soda/get-current-script");
8651
8658
 
8652
8659
  module.exports = require("core-js/modules/es.string.iterator.js");
8653
8660
 
8661
+ /***/ }),
8662
+
8663
+ /***/ "9be4":
8664
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
8665
+
8666
+ "use strict";
8667
+ /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_FlatmapVuer_vue_vue_type_style_index_0_id_92908858_prod_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("813c");
8668
+ /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_FlatmapVuer_vue_vue_type_style_index_0_id_92908858_prod_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_FlatmapVuer_vue_vue_type_style_index_0_id_92908858_prod_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_0__);
8669
+ /* unused harmony reexport * */
8670
+
8671
+
8654
8672
  /***/ }),
8655
8673
 
8656
8674
  /***/ "9d7e":
@@ -9814,29 +9832,11 @@ function isKorean(text) {
9814
9832
 
9815
9833
  /***/ }),
9816
9834
 
9817
- /***/ "d3e9":
9818
- /***/ (function(module, exports, __webpack_require__) {
9819
-
9820
- // extracted by mini-css-extract-plugin
9821
-
9822
- /***/ }),
9823
-
9824
9835
  /***/ "d4df":
9825
9836
  /***/ (function(module, exports, __webpack_require__) {
9826
9837
 
9827
9838
  // extracted by mini-css-extract-plugin
9828
9839
 
9829
- /***/ }),
9830
-
9831
- /***/ "d5a7":
9832
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
9833
-
9834
- "use strict";
9835
- /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_FlatmapVuer_vue_vue_type_style_index_0_id_65c27825_prod_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("2804");
9836
- /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_FlatmapVuer_vue_vue_type_style_index_0_id_65c27825_prod_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_FlatmapVuer_vue_vue_type_style_index_0_id_65c27825_prod_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_0__);
9837
- /* unused harmony reexport * */
9838
-
9839
-
9840
9840
  /***/ }),
9841
9841
 
9842
9842
  /***/ "da6e":
@@ -13311,7 +13311,7 @@ if (typeof window !== 'undefined') {
13311
13311
  // Indicate to webpack that this file can be concatenated
13312
13312
  /* harmony default export */ var setPublicPath = (null);
13313
13313
 
13314
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"52da7808-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/FlatmapVuer.vue?vue&type=template&id=65c27825&scoped=true&
13314
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"52da7808-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/FlatmapVuer.vue?vue&type=template&id=92908858&scoped=true&
13315
13315
  var render = function render() {
13316
13316
  var _vm = this,
13317
13317
  _c = _vm._self._c;
@@ -13782,7 +13782,7 @@ var render = function render() {
13782
13782
  };
13783
13783
  var staticRenderFns = [];
13784
13784
 
13785
- // CONCATENATED MODULE: ./src/components/FlatmapVuer.vue?vue&type=template&id=65c27825&scoped=true&
13785
+ // CONCATENATED MODULE: ./src/components/FlatmapVuer.vue?vue&type=template&id=92908858&scoped=true&
13786
13786
 
13787
13787
  // EXTERNAL MODULE: external "core-js/modules/es.symbol.js"
13788
13788
  var es_symbol_js_ = __webpack_require__("9b22");
@@ -15298,10 +15298,10 @@ var mapResize = function mapResize(map) {
15298
15298
  var myOptions = options;
15299
15299
  if (this.mapImp) {
15300
15300
  if (myOptions) {
15301
- if (!myOptions.className) myOptions.className = "flatmapvuer-popover";
15301
+ if (!myOptions.className) myOptions.className = "custom-popup";
15302
15302
  } else {
15303
15303
  myOptions = {
15304
- className: "flatmapvuer-popover",
15304
+ className: "custom-popup",
15305
15305
  positionAtLastClick: true
15306
15306
  };
15307
15307
  }
@@ -15400,6 +15400,12 @@ var mapResize = function mapResize(map) {
15400
15400
  }
15401
15401
  }
15402
15402
  },
15403
+ restoreMapState: function restoreMapState(state) {
15404
+ if (state) {
15405
+ if (state.viewport) this.mapImp.setState(state.viewport);
15406
+ if (state.searchTerm) this.searchAndShowResult(state.searchTerm, true);
15407
+ }
15408
+ },
15403
15409
  createFlatmap: function createFlatmap(state) {
15404
15410
  var _this3 = this;
15405
15411
  if (!this.mapImp && !this.loading) {
@@ -15471,12 +15477,17 @@ var mapResize = function mapResize(map) {
15471
15477
  _this3.pathways = _this3.mapImp.pathTypes();
15472
15478
  _this3.$emit("ready", _this3);
15473
15479
  _this3.loading = false;
15474
- if (_this3._viewportToBeSet) _this3.mapImp.setState(_this3._viewportToBeSet);else if (state && state.viewport) _this3.mapImp.setState(state.viewport);
15480
+ if (_this3._stateToBeSet) _this3.restoreMapState(_this3._viewportToBeSet);else {
15481
+ _this3.restoreMapState(state);
15482
+ }
15475
15483
  });
15476
15484
  } else if (state) {
15477
15485
  if (this.entry == state.entry) {
15478
- this._viewportToBeSet = state.viewport;
15479
- if (this.mapImp && !this.loading) this.mapImp.setState(this._viewportToBeSet);
15486
+ this._stateToBeSet = {
15487
+ viewport: state.viewport,
15488
+ searchTerm: state.searchTerm
15489
+ };
15490
+ if (this.mapImp && !this.loading) this.restoreMapState(this._stateToBeSet);
15480
15491
  }
15481
15492
  }
15482
15493
  },
@@ -15487,17 +15498,24 @@ var mapResize = function mapResize(map) {
15487
15498
  this.drawerOpen = flag;
15488
15499
  },
15489
15500
  /**
15490
- * Function to display features with annotation matching the provided term.
15501
+ * Function to display features with annotation matching the provided term,
15502
+ * with the option to display the label using displayLabel flag.
15491
15503
  */
15492
- searchAndShowResult: function searchAndShowResult(term) {
15504
+ searchAndShowResult: function searchAndShowResult(term, displayLabel) {
15493
15505
  if (this.mapImp) {
15494
15506
  if (term === undefined || term === "") {
15495
15507
  this.mapImp.clearSearchResults();
15496
15508
  return true;
15497
15509
  } else {
15498
15510
  var searchResults = this.mapImp.search(term);
15499
- if (searchResults && searchResults.__featureIds.length > 0) {
15511
+ if (searchResults && searchResults.results && searchResults.results.length > 0) {
15500
15512
  this.mapImp.showSearchResults(searchResults);
15513
+ if (displayLabel && searchResults.results[0].featureId && searchResults.results[0].text) {
15514
+ this.mapImp.showPopup(searchResults.results[0].featureId, searchResults.results[0].text, {
15515
+ className: "custom-popup",
15516
+ positionAtLastClick: false
15517
+ });
15518
+ }
15501
15519
  return true;
15502
15520
  } else this.mapImp.clearSearchResults();
15503
15521
  }
@@ -15654,8 +15672,8 @@ var mapResize = function mapResize(map) {
15654
15672
  });
15655
15673
  // CONCATENATED MODULE: ./src/components/FlatmapVuer.vue?vue&type=script&lang=js&
15656
15674
  /* harmony default export */ var components_FlatmapVuervue_type_script_lang_js_ = (FlatmapVuervue_type_script_lang_js_);
15657
- // EXTERNAL MODULE: ./src/components/FlatmapVuer.vue?vue&type=style&index=0&id=65c27825&prod&scoped=true&lang=scss&
15658
- var FlatmapVuervue_type_style_index_0_id_65c27825_prod_scoped_true_lang_scss_ = __webpack_require__("d5a7");
15675
+ // EXTERNAL MODULE: ./src/components/FlatmapVuer.vue?vue&type=style&index=0&id=92908858&prod&scoped=true&lang=scss&
15676
+ var FlatmapVuervue_type_style_index_0_id_92908858_prod_scoped_true_lang_scss_ = __webpack_require__("9be4");
15659
15677
 
15660
15678
  // CONCATENATED MODULE: ./src/components/FlatmapVuer.vue
15661
15679
 
@@ -15672,14 +15690,14 @@ var FlatmapVuer_component = normalizeComponent(
15672
15690
  staticRenderFns,
15673
15691
  false,
15674
15692
  null,
15675
- "65c27825",
15693
+ "92908858",
15676
15694
  null
15677
15695
 
15678
15696
  )
15679
15697
 
15680
15698
  /* harmony default export */ var FlatmapVuer = (FlatmapVuer_component.exports);
15681
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"52da7808-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/MultiFlatmapVuer.vue?vue&type=template&id=a7b93f3a&scoped=true&
15682
- var MultiFlatmapVuervue_type_template_id_a7b93f3a_scoped_true_render = function render() {
15699
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"52da7808-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/MultiFlatmapVuer.vue?vue&type=template&id=92af3352&scoped=true&
15700
+ var MultiFlatmapVuervue_type_template_id_92af3352_scoped_true_render = function render() {
15683
15701
  var _vm = this,
15684
15702
  _c = _vm._self._c;
15685
15703
  return _c('div', {
@@ -15721,7 +15739,7 @@ var MultiFlatmapVuervue_type_template_id_a7b93f3a_scoped_true_render = function
15721
15739
  "popper-class": "flatmap_dropdown"
15722
15740
  },
15723
15741
  on: {
15724
- "change": _vm.flatmapChanged
15742
+ "change": _vm.setSpecies
15725
15743
  },
15726
15744
  model: {
15727
15745
  value: _vm.activeSpecies,
@@ -15790,9 +15808,9 @@ var MultiFlatmapVuervue_type_template_id_a7b93f3a_scoped_true_render = function
15790
15808
  });
15791
15809
  })], 2);
15792
15810
  };
15793
- var MultiFlatmapVuervue_type_template_id_a7b93f3a_scoped_true_staticRenderFns = [];
15811
+ var MultiFlatmapVuervue_type_template_id_92af3352_scoped_true_staticRenderFns = [];
15794
15812
 
15795
- // CONCATENATED MODULE: ./src/components/MultiFlatmapVuer.vue?vue&type=template&id=a7b93f3a&scoped=true&
15813
+ // CONCATENATED MODULE: ./src/components/MultiFlatmapVuer.vue?vue&type=template&id=92af3352&scoped=true&
15796
15814
 
15797
15815
  // EXTERNAL MODULE: ./node_modules/element-ui/lib/theme-chalk/popover.css
15798
15816
  var popover = __webpack_require__("06f1");
@@ -15838,6 +15856,7 @@ var es_object_keys_js_ = __webpack_require__("ea64");
15838
15856
 
15839
15857
 
15840
15858
 
15859
+
15841
15860
 
15842
15861
 
15843
15862
  /* eslint-disable no-alert, no-console */
@@ -15864,6 +15883,10 @@ var TAXON_UUID = {
15864
15883
  components: {
15865
15884
  FlatmapVuer: FlatmapVuer
15866
15885
  },
15886
+ beforeMount: function beforeMount() {
15887
+ this._resolveList = [];
15888
+ this._initialised = false;
15889
+ },
15867
15890
  mounted: function mounted() {
15868
15891
  var _this = this;
15869
15892
  this.initialise();
@@ -15881,6 +15904,7 @@ var TAXON_UUID = {
15881
15904
  fetch(_this2.flatmapAPI).then(function (response) {
15882
15905
  return response.json();
15883
15906
  }).then(function (data) {
15907
+ _this2._initialised = true;
15884
15908
  //Check each key in the provided availableSpecies against the one
15885
15909
  //on the server, add them to the Select if the key is found
15886
15910
  Object.keys(_this2.availableSpecies).forEach(function (key) {
@@ -15898,20 +15922,33 @@ var TAXON_UUID = {
15898
15922
  }
15899
15923
  }
15900
15924
  });
15901
- if (!_this2.state) {
15925
+ //Use the state species if it does not have any other species information
15926
+ var species = _this2.initial;
15927
+ if (_this2.state) {
15928
+ var mapState = _this2.state.state;
15929
+ if ((!mapState || !mapState.uuid && !mapState.entry) && _this2.state.species) species = _this2.state.species;else species = undefined;
15930
+ }
15931
+ if (species) {
15902
15932
  //No state resuming, set the current flatmap to {this.initial}
15903
- if (_this2.initial && _this2.speciesList[_this2.initial] !== undefined) {
15904
- _this2.activeSpecies = _this2.initial;
15933
+ if (species && _this2.speciesList[species] !== undefined) {
15934
+ _this2.activeSpecies = species;
15905
15935
  } else {
15906
15936
  _this2.activeSpecies = Object.keys(_this2.speciesList)[0];
15907
15937
  }
15908
- external_vue_default.a.nextTick(function () {
15909
- if (_this2.$refs[_this2.activeSpecies]) _this2.$refs[_this2.activeSpecies][0].createFlatmap();
15910
- });
15938
+ _this2.setSpecies(_this2.activeSpecies, _this2.state ? _this2.state.state : undefined, 5);
15911
15939
  }
15940
+ resolve();
15941
+ _this2._resolveList.forEach(function (other) {
15942
+ other();
15943
+ });
15912
15944
  });
15945
+ } else if (_this2._initialised) {
15946
+ //resolve as it has been initialised
15947
+ resolve();
15948
+ } else {
15949
+ //resolve when the list request has been resolved
15950
+ _this2._resolveList.push(resolve);
15913
15951
  }
15914
- resolve();
15915
15952
  });
15916
15953
  },
15917
15954
  FlatmapSelected: function FlatmapSelected(resource) {
@@ -15941,10 +15978,20 @@ var TAXON_UUID = {
15941
15978
  var map = this.getCurrentFlatmap();
15942
15979
  map.showMarkerPopup(featureId, node, options);
15943
15980
  },
15944
- flatmapChanged: function flatmapChanged(species, viewport) {
15945
- if (this.activeSpecies != species) this.activeSpecies = species;
15946
- this.$refs[this.activeSpecies][0].createFlatmap(viewport);
15947
- this.$emit('flatmapChanged', this.activeSpecies);
15981
+ setSpecies: function setSpecies(species, state, numberOfRetry) {
15982
+ var _this3 = this;
15983
+ if (this.$refs && species in this.$refs) {
15984
+ this.activeSpecies = species;
15985
+ this.$refs[this.activeSpecies][0].createFlatmap(state);
15986
+ this.$emit('flatmapChanged', this.activeSpecies);
15987
+ } else if (numberOfRetry) {
15988
+ var retry = numberOfRetry - 1;
15989
+ if (retry >= 0) {
15990
+ external_vue_default.a.nextTick(function () {
15991
+ _this3.setSpecies(species, state, retry);
15992
+ });
15993
+ }
15994
+ }
15948
15995
  },
15949
15996
  /**
15950
15997
  * Function to switch to the latest existing map from
@@ -15957,7 +16004,7 @@ var TAXON_UUID = {
15957
16004
  for (var i = 0; i < keys.length; i++) {
15958
16005
  var species = this.speciesList[keys[i]];
15959
16006
  if (!species.isLegacy && species.taxo === state.entry && species.biologicalSex === state.biologicalSex) {
15960
- this.flatmapChanged(keys[i], state);
16007
+ this.setSpecies(keys[i], state, 0);
15961
16008
  return;
15962
16009
  }
15963
16010
  }
@@ -15983,7 +16030,8 @@ var TAXON_UUID = {
15983
16030
  state: {
15984
16031
  entry: taxo,
15985
16032
  uuid: uuid,
15986
- viewport: state.state.viewport
16033
+ viewport: state.state.viewport,
16034
+ searchTerm: state.state.searchTerm
15987
16035
  }
15988
16036
  };
15989
16037
  }
@@ -15995,7 +16043,7 @@ var TAXON_UUID = {
15995
16043
  * @private
15996
16044
  */
15997
16045
  updateState: function updateState(state) {
15998
- var _this3 = this;
16046
+ var _this4 = this;
15999
16047
  return new Promise(function (resolve) {
16000
16048
  if (state && state.state) {
16001
16049
  var mapState = state.state;
@@ -16003,14 +16051,14 @@ var TAXON_UUID = {
16003
16051
  if (!mapState.uuid) {
16004
16052
  if (mapState.entry) {
16005
16053
  var uuid = mapState.entry in TAXON_UUID ? TAXON_UUID[mapState.entry] : undefined;
16006
- var newState = _this3.createLegacyEntry(state, mapState.entry, uuid);
16054
+ var newState = _this4.createLegacyEntry(state, mapState.entry, uuid);
16007
16055
  resolve(newState ? newState : state);
16008
16056
  }
16009
16057
  } else if (mapState.entry) {
16010
16058
  //uuid is in the state but should be checked if it is the latest map
16011
16059
  //for that taxon
16012
16060
  return new Promise(function () {
16013
- var mapManager = new (__webpack_require__("4979").MapManager)(_this3.flatmapAPI);
16061
+ var mapManager = new (__webpack_require__("4979").MapManager)(_this4.flatmapAPI);
16014
16062
  //mapManager.findMap_ is an async function so we need to wrap this with a promise
16015
16063
  var identifier = {
16016
16064
  taxon: mapState.entry
@@ -16018,7 +16066,7 @@ var TAXON_UUID = {
16018
16066
  if (mapState.biologicalSex) identifier['biologicalSex'] = mapState.biologicalSex;
16019
16067
  mapManager.findMap_(identifier).then(function (map) {
16020
16068
  if (map.uuid !== mapState.uuid) {
16021
- return _this3.createLegacyEntry(state, mapState.entry, mapState.uuid);
16069
+ return _this4.createLegacyEntry(state, mapState.entry, mapState.uuid);
16022
16070
  }
16023
16071
  }).then(function (newState) {
16024
16072
  resolve(newState ? newState : state);
@@ -16055,24 +16103,15 @@ var TAXON_UUID = {
16055
16103
  * @public
16056
16104
  */
16057
16105
  setState: function setState(state) {
16058
- var _this4 = this;
16106
+ var _this5 = this;
16059
16107
  if (state) {
16060
- this.initialise().then(function () {
16061
- //Update state if required
16062
- _this4.updateState(state).then(function (currentState) {
16063
- if (currentState.species && currentState.species !== _this4.activeSpecies) {
16064
- _this4.activeSpecies = currentState.species;
16065
- if (currentState.state) {
16066
- //Wait for next tick when the refs are ready for rendering
16067
- _this4.$nextTick(function () {
16068
- if (_this4.activeSpecies in _this4.$refs) {
16069
- _this4.$refs[_this4.activeSpecies][0].createFlatmap(currentState.state);
16070
- _this4.$emit('flatmapChanged', _this4.activeSpecies);
16071
- }
16072
- });
16073
- }
16108
+ //Update state if required
16109
+ this.updateState(state).then(function (currentState) {
16110
+ _this5.initialise().then(function () {
16111
+ if (currentState.species && currentState.species !== _this5.activeSpecies) {
16112
+ _this5.setSpecies(currentState.species, currentState.state, 5);
16074
16113
  } else if (currentState.state) {
16075
- var map = _this4.getCurrentFlatmap();
16114
+ var map = _this5.getCurrentFlatmap();
16076
16115
  map.setState(currentState.state);
16077
16116
  }
16078
16117
  });
@@ -16206,8 +16245,8 @@ var TAXON_UUID = {
16206
16245
  });
16207
16246
  // CONCATENATED MODULE: ./src/components/MultiFlatmapVuer.vue?vue&type=script&lang=js&
16208
16247
  /* harmony default export */ var components_MultiFlatmapVuervue_type_script_lang_js_ = (MultiFlatmapVuervue_type_script_lang_js_);
16209
- // EXTERNAL MODULE: ./src/components/MultiFlatmapVuer.vue?vue&type=style&index=0&id=a7b93f3a&prod&scoped=true&lang=scss&
16210
- var MultiFlatmapVuervue_type_style_index_0_id_a7b93f3a_prod_scoped_true_lang_scss_ = __webpack_require__("2a5c");
16248
+ // EXTERNAL MODULE: ./src/components/MultiFlatmapVuer.vue?vue&type=style&index=0&id=92af3352&prod&scoped=true&lang=scss&
16249
+ var MultiFlatmapVuervue_type_style_index_0_id_92af3352_prod_scoped_true_lang_scss_ = __webpack_require__("9418");
16211
16250
 
16212
16251
  // CONCATENATED MODULE: ./src/components/MultiFlatmapVuer.vue
16213
16252
 
@@ -16220,11 +16259,11 @@ var MultiFlatmapVuervue_type_style_index_0_id_a7b93f3a_prod_scoped_true_lang_scs
16220
16259
 
16221
16260
  var MultiFlatmapVuer_component = normalizeComponent(
16222
16261
  components_MultiFlatmapVuervue_type_script_lang_js_,
16223
- MultiFlatmapVuervue_type_template_id_a7b93f3a_scoped_true_render,
16224
- MultiFlatmapVuervue_type_template_id_a7b93f3a_scoped_true_staticRenderFns,
16262
+ MultiFlatmapVuervue_type_template_id_92af3352_scoped_true_render,
16263
+ MultiFlatmapVuervue_type_template_id_92af3352_scoped_true_staticRenderFns,
16225
16264
  false,
16226
16265
  null,
16227
- "a7b93f3a",
16266
+ "92af3352",
16228
16267
  null
16229
16268
 
16230
16269
  )