@abi-software/flatmapvuer 1.2.0-beta.1 → 1.2.0-beta.3

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abi-software/flatmapvuer",
3
- "version": "1.2.0-beta.1",
3
+ "version": "1.2.0-beta.3",
4
4
  "license": "Apache-2.0",
5
5
  "files": [
6
6
  "dist/*",
package/src/App.vue CHANGED
@@ -74,6 +74,7 @@
74
74
  @help-mode-last-item="onHelpModeLastItem"
75
75
  @shown-tooltip="onTooltipShown"
76
76
  @shown-map-tooltip="onMapTooltipShown"
77
+ :connectivityInfoSidebar="true"
77
78
  :displayMinimap="true"
78
79
  :enableOpenMapUI="true"
79
80
  :flatmapAPI="flatmapAPI"
@@ -601,7 +601,7 @@ Please use `const` to assign meaningful names to them...
601
601
  <Tooltip
602
602
  ref="tooltip"
603
603
  class="tooltip"
604
- v-show="tooltipDisplay && !connectivityInfoSidebar"
604
+ v-show="tooltipDisplay"
605
605
  :annotationEntry="annotationEntry"
606
606
  :tooltipEntry="tooltipEntry"
607
607
  :annotationDisplay="viewingMode === 'Annotation'"
@@ -1983,7 +1983,6 @@ export default {
1983
1983
  * @arg feature
1984
1984
  */
1985
1985
  displayTooltip: function (feature, geometry = undefined) {
1986
- this.tooltipDisplay = true
1987
1986
  let featureId = undefined
1988
1987
  let options = { className: 'flatmapvuer-popover' }
1989
1988
  if (geometry) {
@@ -1997,15 +1996,19 @@ export default {
1997
1996
  }
1998
1997
  // If connectivityInfoSidebar is set to `true`
1999
1998
  // Connectivity info will show in sidebar
2000
- if (this.connectivityInfoSidebar) {
1999
+ if (this.connectivityInfoSidebar && this.viewingMode !== 'Annotation') {
2001
2000
  // move the map center to highlighted area
2002
- const featureIds = [feature];
2003
- this.moveMap(featureIds);
2001
+ // this method is moved to sidebar connectivity info
2002
+ // const featureIds = [feature];
2003
+ // this.moveMap(featureIds);
2004
2004
  this.$emit('connectivity-info-open', this.tooltipEntry);
2005
2005
  }
2006
- // If connectivityInfoSidebar is not set (default) or set to `false`
2007
- // Connectivity info (Provenance info) tooltip will show on map
2008
- if (!this.disableUI && !this.connectivityInfoSidebar) {
2006
+ // If UI is not disabled,
2007
+ // And connectivityInfoSidebar is not set (default) or set to `false`
2008
+ // Provenance popup will be shown on map
2009
+ // Tooltip will be shown for Annotation view
2010
+ if (!this.disableUI && (!this.connectivityInfoSidebar || this.viewingMode === 'Annotation')) {
2011
+ this.tooltipDisplay = true;
2009
2012
  this.$nextTick(() => {
2010
2013
  this.mapImp.showPopup(featureId, this.$refs.tooltip.$el, options)
2011
2014
  this.popUpCssHacks()
@@ -2018,11 +2021,11 @@ export default {
2018
2021
  * because the sidebar is opened
2019
2022
  * @arg featureIds
2020
2023
  */
2021
- moveMap: function (featureIds) {
2024
+ moveMap: function (featureIds, options = {}) {
2022
2025
  if (this.mapImp) {
2026
+ const { offsetX = 0, offsetY = 0, zoom = 4 } = options;
2023
2027
  const Map = this.mapImp._map;
2024
2028
  const bbox = this.mapImp._bounds.toArray();
2025
- const sidebarWidth = 500; // actual width is 600
2026
2029
 
2027
2030
  // Zoom the map to features first
2028
2031
  this.mapImp.zoomToFeatures(featureIds, { noZoomIn: true });
@@ -2036,9 +2039,8 @@ export default {
2036
2039
  if (bbox?.length) {
2037
2040
  setTimeout(() => {
2038
2041
  Map.fitBounds(bbox, {
2039
- padding: {
2040
- right: sidebarWidth
2041
- },
2042
+ offset: [offsetX, offsetY],
2043
+ zoom: zoom,
2042
2044
  animate: true
2043
2045
  });
2044
2046
  });