@abi-software/flatmapvuer 1.2.0-beta.2 → 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.2",
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"
@@ -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) {
@@ -1999,8 +1998,9 @@ export default {
1999
1998
  // Connectivity info will show in sidebar
2000
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
2006
  // If UI is not disabled,
@@ -2008,6 +2008,7 @@ export default {
2008
2008
  // Provenance popup will be shown on map
2009
2009
  // Tooltip will be shown for Annotation view
2010
2010
  if (!this.disableUI && (!this.connectivityInfoSidebar || this.viewingMode === 'Annotation')) {
2011
+ this.tooltipDisplay = true;
2011
2012
  this.$nextTick(() => {
2012
2013
  this.mapImp.showPopup(featureId, this.$refs.tooltip.$el, options)
2013
2014
  this.popUpCssHacks()
@@ -2020,11 +2021,11 @@ export default {
2020
2021
  * because the sidebar is opened
2021
2022
  * @arg featureIds
2022
2023
  */
2023
- moveMap: function (featureIds) {
2024
+ moveMap: function (featureIds, options = {}) {
2024
2025
  if (this.mapImp) {
2026
+ const { offsetX = 0, offsetY = 0, zoom = 4 } = options;
2025
2027
  const Map = this.mapImp._map;
2026
2028
  const bbox = this.mapImp._bounds.toArray();
2027
- const sidebarWidth = 500; // actual width is 600
2028
2029
 
2029
2030
  // Zoom the map to features first
2030
2031
  this.mapImp.zoomToFeatures(featureIds, { noZoomIn: true });
@@ -2038,9 +2039,8 @@ export default {
2038
2039
  if (bbox?.length) {
2039
2040
  setTimeout(() => {
2040
2041
  Map.fitBounds(bbox, {
2041
- padding: {
2042
- right: sidebarWidth
2043
- },
2042
+ offset: [offsetX, offsetY],
2043
+ zoom: zoom,
2044
2044
  animate: true
2045
2045
  });
2046
2046
  });