@corpsmap/corpsmap 3.0.6 → 3.0.10

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/lib/dev.js CHANGED
@@ -78086,7 +78086,9 @@ var createOlMapBundle = (function (opts) {
78086
78086
  var dispatch = _ref2.dispatch,
78087
78087
  store = _ref2.store;
78088
78088
  var geoProjection = store.selectMapGeoProjection();
78089
- var webProjection = store.selectMapWebProjection();
78089
+ var webProjection = store.selectMapWebProjection(); // CWBI-13636 Limit Map Extent
78090
+
78091
+ var extent = transformExtent([-180, -85, 180, 85], geoProjection, webProjection);
78090
78092
  var center = opts.hasOwnProperty("center") ? opts.center : store.selectMapCenter();
78091
78093
  var zoom = opts.hasOwnProperty("zoom") ? opts.zoom : store.selectMapZoom();
78092
78094
  var rotation = opts.hasOwnProperty("rotation") ? opts.rotation : store.selectMapRotation();
@@ -78098,7 +78100,8 @@ var createOlMapBundle = (function (opts) {
78098
78100
  zoom: zoom,
78099
78101
  rotation: rotation,
78100
78102
  minZoom: minZoom,
78101
- maxZoom: maxZoom
78103
+ maxZoom: maxZoom,
78104
+ extent: extent
78102
78105
  });
78103
78106
  var map = new Map$3({
78104
78107
  controls: [new ScaleLine({
@@ -103730,7 +103733,8 @@ var mapViewBundle = {
103730
103733
  maxZoom: 22,
103731
103734
  action: null,
103732
103735
  updating: false,
103733
- listening: false
103736
+ listening: false,
103737
+ shouldUpdateZoom: false
103734
103738
  };
103735
103739
  return function () {
103736
103740
  var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialData;
@@ -103896,9 +103900,12 @@ var mapViewBundle = {
103896
103900
  dispatch({
103897
103901
  type: "VIEW_START_ACTION"
103898
103902
  });
103899
- var view = store.selectView();
103900
- var currentZoom = view.getZoom();
103901
- animateView({
103903
+ var view = store.selectView(); // pulling view
103904
+
103905
+ var currentZoom = view.getZoom(); // getting current view
103906
+
103907
+ animateView( // subtract 1 from current zoom
103908
+ {
103902
103909
  zoom: currentZoom - 1
103903
103910
  }, view);
103904
103911
  dispatch({
@@ -105328,7 +105335,7 @@ var config = {
105328
105335
  };
105329
105336
 
105330
105337
  var name = "@corpsmap/corpsmap";
105331
- var version$1 = "3.0.6";
105338
+ var version$1 = "3.0.10";
105332
105339
  var description = "CorpsMap as React Components";
105333
105340
  var main = "index.js";
105334
105341
  var scripts = {
@@ -157881,6 +157888,8 @@ var treeViewDownload = {
157881
157888
  doUpdateTreeViewLayerDownloadFormat: function doUpdateTreeViewLayerDownloadFormat(e) {
157882
157889
  return function (_ref3) {
157883
157890
  var dispatch = _ref3.dispatch;
157891
+ e.preventDefault();
157892
+ e.stopPropagation();
157884
157893
  var layer = store.selectTreeViewSelectedItem();
157885
157894
  var format = e.target.value;
157886
157895
  var url = null;
@@ -158394,6 +158403,100 @@ var plugin$j = {
158394
158403
  }]
158395
158404
  };
158396
158405
 
158406
+ var zoomIndicator = /*#__PURE__*/function (_React$Component) {
158407
+ _inherits(zoomIndicator, _React$Component);
158408
+
158409
+ var _super = _createSuper(zoomIndicator);
158410
+
158411
+ function zoomIndicator(props) {
158412
+ var _this;
158413
+
158414
+ _classCallCheck(this, zoomIndicator);
158415
+
158416
+ _this = _super.call(this, props);
158417
+ _this.handleClick = _this.handleClick.bind(_assertThisInitialized(_this));
158418
+ return _this;
158419
+ }
158420
+
158421
+ _createClass(zoomIndicator, [{
158422
+ key: "handleClick",
158423
+ value: function handleClick() {}
158424
+ }, {
158425
+ key: "render",
158426
+ value: function render() {
158427
+ var _this$props = this.props,
158428
+ mapZoom = _this$props.mapZoom,
158429
+ zoomLevelIndicator = _this$props.zoomLevelIndicator;
158430
+
158431
+ if (zoomLevelIndicator == true) {
158432
+ return /*#__PURE__*/React$1__default.createElement(SidebarButton$1, {
158433
+ iconText: Math.floor(mapZoom),
158434
+ label: "Zoom-Indicator",
158435
+ title: "Zoom-Indicator",
158436
+ onClick: this.handleClick
158437
+ });
158438
+ } else {
158439
+ return null;
158440
+ }
158441
+ }
158442
+ }]);
158443
+
158444
+ return zoomIndicator;
158445
+ }(React$1__default.Component);
158446
+
158447
+ var zoomIndicator$1 = connect('doZoomIndicatorActivate', 'selectMapZoom', 'selectZoomLevelIndicator', zoomIndicator);
158448
+
158449
+ var bundle$f = {
158450
+ name: "zoomLevel",
158451
+ getReducer: function getReducer() {
158452
+ var initialData = {
158453
+ zoomLevelIndicator: false
158454
+ };
158455
+ return function () {
158456
+ var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialData;
158457
+
158458
+ var _ref = arguments.length > 1 ? arguments[1] : undefined,
158459
+ type = _ref.type,
158460
+ payload = _ref.payload;
158461
+
158462
+ switch (type) {
158463
+ case "ACTIVATE_ZOOM_INDICATOR":
158464
+ case "DEACTIVATE_ZOOM_INDICATOR":
158465
+ return Object.assign({}, state, payload);
158466
+
158467
+ default:
158468
+ return state;
158469
+ }
158470
+ };
158471
+ },
158472
+ doZoomIndicatorActivate: function doZoomIndicatorActivate() {
158473
+ return function (_ref2) {
158474
+ var dispatch = _ref2.dispatch,
158475
+ store = _ref2.store;
158476
+ dispatch({
158477
+ type: "ACTIVATE_ZOOM_INDICATOR",
158478
+ payload: {
158479
+ zoomLevelIndicator: true
158480
+ }
158481
+ });
158482
+ };
158483
+ },
158484
+ selectZoomLevelIndicator: function selectZoomLevelIndicator(state) {
158485
+ return state.zoomLevel.zoomLevelIndicator;
158486
+ }
158487
+ };
158488
+
158489
+ var plugin$k = {
158490
+ pluginName: 'zoomIndicator',
158491
+ enabled: true,
158492
+ bundle: bundle$f,
158493
+ components: [{
158494
+ component: zoomIndicator$1,
158495
+ region: 'right-sidebar-top',
158496
+ sortOrder: 40
158497
+ }]
158498
+ };
158499
+
158397
158500
  var ZoomHomeButton = /*#__PURE__*/function (_React$Component) {
158398
158501
  _inherits(ZoomHomeButton, _React$Component);
158399
158502
 
@@ -158461,7 +158564,7 @@ var ZoomHomeButton = /*#__PURE__*/function (_React$Component) {
158461
158564
 
158462
158565
  var ZoomHomeButton$1 = connect("doZoomHome", "doZoomHomeResetLoc", "doNotificationsFire", ZoomHomeButton);
158463
158566
 
158464
- var bundle$f = {
158567
+ var bundle$g = {
158465
158568
  name: "zoomHome",
158466
158569
  getReducer: function getReducer() {
158467
158570
  var initialData = {
@@ -158532,10 +158635,10 @@ var bundle$f = {
158532
158635
  }
158533
158636
  };
158534
158637
 
158535
- var plugin$k = {
158638
+ var plugin$l = {
158536
158639
  pluginName: "ZoomToInitial",
158537
158640
  enabled: true,
158538
- bundle: bundle$f,
158641
+ bundle: bundle$g,
158539
158642
  components: [{
158540
158643
  component: ZoomHomeButton$1,
158541
158644
  region: "left-sidebar-top",
@@ -158607,7 +158710,7 @@ var ZoomToBoxButton$1 = connect('doStartZoomBox', 'doStopZoomBox', ZoomToBoxButt
158607
158710
  var zoombox = createInteraction({
158608
158711
  interaction: 'dragbox'
158609
158712
  });
158610
- var bundle$g = {
158713
+ var bundle$h = {
158611
158714
  name: 'zoombox',
158612
158715
  getReducer: function getReducer() {
158613
158716
  var initialData = {
@@ -158705,10 +158808,10 @@ var bundle$g = {
158705
158808
  }
158706
158809
  };
158707
158810
 
158708
- var plugin$l = {
158811
+ var plugin$m = {
158709
158812
  pluginName: 'ZoomtoExtent',
158710
158813
  enabled: true,
158711
- bundle: bundle$g,
158814
+ bundle: bundle$h,
158712
158815
  components: [{
158713
158816
  component: ZoomToBoxButton$1,
158714
158817
  region: 'basic-toolbar',
@@ -158760,7 +158863,7 @@ var MapLoadingIndicator = /*#__PURE__*/function (_React$Component) {
158760
158863
 
158761
158864
  var MapLoadingIndicator$1 = connect("selectMapLoading", MapLoadingIndicator);
158762
158865
 
158763
- var bundle$h = {
158866
+ var bundle$i = {
158764
158867
  name: "mapLoading",
158765
158868
  getReducer: function getReducer() {
158766
158869
  var initialData = {
@@ -158797,10 +158900,10 @@ var bundle$h = {
158797
158900
  }
158798
158901
  };
158799
158902
 
158800
- var plugin$m = {
158903
+ var plugin$n = {
158801
158904
  pluginName: "MapLoadingIndicator",
158802
158905
  enabled: true,
158803
- bundle: bundle$h,
158906
+ bundle: bundle$i,
158804
158907
  components: [{
158805
158908
  component: MapLoadingIndicator$1,
158806
158909
  region: "lower-right-toolbar",
@@ -158836,7 +158939,7 @@ exports.geocoder = plugin$6;
158836
158939
  exports.geojsonIdent = plugin$7;
158837
158940
  exports.identify = plugin$8;
158838
158941
  exports.legend = plugin$9;
158839
- exports.mapLoadingIndicator = plugin$m;
158942
+ exports.mapLoadingIndicator = plugin$n;
158840
158943
  exports.measureTools = plugin$a;
158841
158944
  exports.permalink = plugin$b;
158842
158945
  exports.printMap = plugin$c;
@@ -158847,6 +158950,7 @@ exports.treeView = plugin$g;
158847
158950
  exports.treeViewPanel = TreeviewPanel$1;
158848
158951
  exports.vectorIdent = plugin$h;
158849
158952
  exports.vectorSearch = plugin$i;
158850
- exports.zoomHome = plugin$k;
158953
+ exports.zoomHome = plugin$l;
158851
158954
  exports.zoomInOut = plugin$j;
158852
- exports.zoomToBox = plugin$l;
158955
+ exports.zoomLevel = plugin$k;
158956
+ exports.zoomToBox = plugin$m;
package/lib/prod.js CHANGED
@@ -78000,7 +78000,9 @@ var createOlMapBundle = (function (opts) {
78000
78000
  var dispatch = _ref2.dispatch,
78001
78001
  store = _ref2.store;
78002
78002
  var geoProjection = store.selectMapGeoProjection();
78003
- var webProjection = store.selectMapWebProjection();
78003
+ var webProjection = store.selectMapWebProjection(); // CWBI-13636 Limit Map Extent
78004
+
78005
+ var extent = transformExtent([-180, -85, 180, 85], geoProjection, webProjection);
78004
78006
  var center = opts.hasOwnProperty("center") ? opts.center : store.selectMapCenter();
78005
78007
  var zoom = opts.hasOwnProperty("zoom") ? opts.zoom : store.selectMapZoom();
78006
78008
  var rotation = opts.hasOwnProperty("rotation") ? opts.rotation : store.selectMapRotation();
@@ -78012,7 +78014,8 @@ var createOlMapBundle = (function (opts) {
78012
78014
  zoom: zoom,
78013
78015
  rotation: rotation,
78014
78016
  minZoom: minZoom,
78015
- maxZoom: maxZoom
78017
+ maxZoom: maxZoom,
78018
+ extent: extent
78016
78019
  });
78017
78020
  var map = new Map$3({
78018
78021
  controls: [new ScaleLine({
@@ -103644,7 +103647,8 @@ var mapViewBundle = {
103644
103647
  maxZoom: 22,
103645
103648
  action: null,
103646
103649
  updating: false,
103647
- listening: false
103650
+ listening: false,
103651
+ shouldUpdateZoom: false
103648
103652
  };
103649
103653
  return function () {
103650
103654
  var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialData;
@@ -103810,9 +103814,12 @@ var mapViewBundle = {
103810
103814
  dispatch({
103811
103815
  type: "VIEW_START_ACTION"
103812
103816
  });
103813
- var view = store.selectView();
103814
- var currentZoom = view.getZoom();
103815
- animateView({
103817
+ var view = store.selectView(); // pulling view
103818
+
103819
+ var currentZoom = view.getZoom(); // getting current view
103820
+
103821
+ animateView( // subtract 1 from current zoom
103822
+ {
103816
103823
  zoom: currentZoom - 1
103817
103824
  }, view);
103818
103825
  dispatch({
@@ -105242,7 +105249,7 @@ var config = {
105242
105249
  };
105243
105250
 
105244
105251
  var name = "@corpsmap/corpsmap";
105245
- var version$1 = "3.0.6";
105252
+ var version$1 = "3.0.10";
105246
105253
  var description = "CorpsMap as React Components";
105247
105254
  var main = "index.js";
105248
105255
  var scripts = {
@@ -157795,6 +157802,8 @@ var treeViewDownload = {
157795
157802
  doUpdateTreeViewLayerDownloadFormat: function doUpdateTreeViewLayerDownloadFormat(e) {
157796
157803
  return function (_ref3) {
157797
157804
  var dispatch = _ref3.dispatch;
157805
+ e.preventDefault();
157806
+ e.stopPropagation();
157798
157807
  var layer = store.selectTreeViewSelectedItem();
157799
157808
  var format = e.target.value;
157800
157809
  var url = null;
@@ -158308,6 +158317,100 @@ var plugin$j = {
158308
158317
  }]
158309
158318
  };
158310
158319
 
158320
+ var zoomIndicator = /*#__PURE__*/function (_React$Component) {
158321
+ _inherits(zoomIndicator, _React$Component);
158322
+
158323
+ var _super = _createSuper(zoomIndicator);
158324
+
158325
+ function zoomIndicator(props) {
158326
+ var _this;
158327
+
158328
+ _classCallCheck(this, zoomIndicator);
158329
+
158330
+ _this = _super.call(this, props);
158331
+ _this.handleClick = _this.handleClick.bind(_assertThisInitialized(_this));
158332
+ return _this;
158333
+ }
158334
+
158335
+ _createClass(zoomIndicator, [{
158336
+ key: "handleClick",
158337
+ value: function handleClick() {}
158338
+ }, {
158339
+ key: "render",
158340
+ value: function render() {
158341
+ var _this$props = this.props,
158342
+ mapZoom = _this$props.mapZoom,
158343
+ zoomLevelIndicator = _this$props.zoomLevelIndicator;
158344
+
158345
+ if (zoomLevelIndicator == true) {
158346
+ return /*#__PURE__*/React$1__default.createElement(SidebarButton$1, {
158347
+ iconText: Math.floor(mapZoom),
158348
+ label: "Zoom-Indicator",
158349
+ title: "Zoom-Indicator",
158350
+ onClick: this.handleClick
158351
+ });
158352
+ } else {
158353
+ return null;
158354
+ }
158355
+ }
158356
+ }]);
158357
+
158358
+ return zoomIndicator;
158359
+ }(React$1__default.Component);
158360
+
158361
+ var zoomIndicator$1 = connect('doZoomIndicatorActivate', 'selectMapZoom', 'selectZoomLevelIndicator', zoomIndicator);
158362
+
158363
+ var bundle$f = {
158364
+ name: "zoomLevel",
158365
+ getReducer: function getReducer() {
158366
+ var initialData = {
158367
+ zoomLevelIndicator: false
158368
+ };
158369
+ return function () {
158370
+ var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialData;
158371
+
158372
+ var _ref = arguments.length > 1 ? arguments[1] : undefined,
158373
+ type = _ref.type,
158374
+ payload = _ref.payload;
158375
+
158376
+ switch (type) {
158377
+ case "ACTIVATE_ZOOM_INDICATOR":
158378
+ case "DEACTIVATE_ZOOM_INDICATOR":
158379
+ return Object.assign({}, state, payload);
158380
+
158381
+ default:
158382
+ return state;
158383
+ }
158384
+ };
158385
+ },
158386
+ doZoomIndicatorActivate: function doZoomIndicatorActivate() {
158387
+ return function (_ref2) {
158388
+ var dispatch = _ref2.dispatch,
158389
+ store = _ref2.store;
158390
+ dispatch({
158391
+ type: "ACTIVATE_ZOOM_INDICATOR",
158392
+ payload: {
158393
+ zoomLevelIndicator: true
158394
+ }
158395
+ });
158396
+ };
158397
+ },
158398
+ selectZoomLevelIndicator: function selectZoomLevelIndicator(state) {
158399
+ return state.zoomLevel.zoomLevelIndicator;
158400
+ }
158401
+ };
158402
+
158403
+ var plugin$k = {
158404
+ pluginName: 'zoomIndicator',
158405
+ enabled: true,
158406
+ bundle: bundle$f,
158407
+ components: [{
158408
+ component: zoomIndicator$1,
158409
+ region: 'right-sidebar-top',
158410
+ sortOrder: 40
158411
+ }]
158412
+ };
158413
+
158311
158414
  var ZoomHomeButton = /*#__PURE__*/function (_React$Component) {
158312
158415
  _inherits(ZoomHomeButton, _React$Component);
158313
158416
 
@@ -158375,7 +158478,7 @@ var ZoomHomeButton = /*#__PURE__*/function (_React$Component) {
158375
158478
 
158376
158479
  var ZoomHomeButton$1 = connect("doZoomHome", "doZoomHomeResetLoc", "doNotificationsFire", ZoomHomeButton);
158377
158480
 
158378
- var bundle$f = {
158481
+ var bundle$g = {
158379
158482
  name: "zoomHome",
158380
158483
  getReducer: function getReducer() {
158381
158484
  var initialData = {
@@ -158446,10 +158549,10 @@ var bundle$f = {
158446
158549
  }
158447
158550
  };
158448
158551
 
158449
- var plugin$k = {
158552
+ var plugin$l = {
158450
158553
  pluginName: "ZoomToInitial",
158451
158554
  enabled: true,
158452
- bundle: bundle$f,
158555
+ bundle: bundle$g,
158453
158556
  components: [{
158454
158557
  component: ZoomHomeButton$1,
158455
158558
  region: "left-sidebar-top",
@@ -158521,7 +158624,7 @@ var ZoomToBoxButton$1 = connect('doStartZoomBox', 'doStopZoomBox', ZoomToBoxButt
158521
158624
  var zoombox = createInteraction({
158522
158625
  interaction: 'dragbox'
158523
158626
  });
158524
- var bundle$g = {
158627
+ var bundle$h = {
158525
158628
  name: 'zoombox',
158526
158629
  getReducer: function getReducer() {
158527
158630
  var initialData = {
@@ -158619,10 +158722,10 @@ var bundle$g = {
158619
158722
  }
158620
158723
  };
158621
158724
 
158622
- var plugin$l = {
158725
+ var plugin$m = {
158623
158726
  pluginName: 'ZoomtoExtent',
158624
158727
  enabled: true,
158625
- bundle: bundle$g,
158728
+ bundle: bundle$h,
158626
158729
  components: [{
158627
158730
  component: ZoomToBoxButton$1,
158628
158731
  region: 'basic-toolbar',
@@ -158674,7 +158777,7 @@ var MapLoadingIndicator = /*#__PURE__*/function (_React$Component) {
158674
158777
 
158675
158778
  var MapLoadingIndicator$1 = connect("selectMapLoading", MapLoadingIndicator);
158676
158779
 
158677
- var bundle$h = {
158780
+ var bundle$i = {
158678
158781
  name: "mapLoading",
158679
158782
  getReducer: function getReducer() {
158680
158783
  var initialData = {
@@ -158711,10 +158814,10 @@ var bundle$h = {
158711
158814
  }
158712
158815
  };
158713
158816
 
158714
- var plugin$m = {
158817
+ var plugin$n = {
158715
158818
  pluginName: "MapLoadingIndicator",
158716
158819
  enabled: true,
158717
- bundle: bundle$h,
158820
+ bundle: bundle$i,
158718
158821
  components: [{
158719
158822
  component: MapLoadingIndicator$1,
158720
158823
  region: "lower-right-toolbar",
@@ -158750,7 +158853,7 @@ exports.geocoder = plugin$6;
158750
158853
  exports.geojsonIdent = plugin$7;
158751
158854
  exports.identify = plugin$8;
158752
158855
  exports.legend = plugin$9;
158753
- exports.mapLoadingIndicator = plugin$m;
158856
+ exports.mapLoadingIndicator = plugin$n;
158754
158857
  exports.measureTools = plugin$a;
158755
158858
  exports.permalink = plugin$b;
158756
158859
  exports.printMap = plugin$c;
@@ -158761,6 +158864,7 @@ exports.treeView = plugin$g;
158761
158864
  exports.treeViewPanel = TreeviewPanel$1;
158762
158865
  exports.vectorIdent = plugin$h;
158763
158866
  exports.vectorSearch = plugin$i;
158764
- exports.zoomHome = plugin$k;
158867
+ exports.zoomHome = plugin$l;
158765
158868
  exports.zoomInOut = plugin$j;
158766
- exports.zoomToBox = plugin$l;
158869
+ exports.zoomLevel = plugin$k;
158870
+ exports.zoomToBox = plugin$m;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corpsmap/corpsmap",
3
- "version": "3.0.6",
3
+ "version": "3.0.10",
4
4
  "description": "CorpsMap as React Components",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -63,6 +63,8 @@ export default (opts) => {
63
63
  doMapInitialize: (el, opts) => ({ dispatch, store }) => {
64
64
  const geoProjection = store.selectMapGeoProjection();
65
65
  const webProjection = store.selectMapWebProjection();
66
+ // CWBI-13636 Limit Map Extent
67
+ const extent = transformExtent([-180, -85, 180, 85], geoProjection, webProjection)
66
68
  const center = opts.hasOwnProperty("center")
67
69
  ? opts.center
68
70
  : store.selectMapCenter();
@@ -87,6 +89,7 @@ export default (opts) => {
87
89
  rotation: rotation,
88
90
  minZoom: minZoom,
89
91
  maxZoom: maxZoom,
92
+ extent: extent,
90
93
  });
91
94
 
92
95
  const map = new olMap({
@@ -35,6 +35,7 @@ export default {
35
35
  action: null,
36
36
  updating: false,
37
37
  listening: false,
38
+ shouldUpdateZoom: false,
38
39
  };
39
40
 
40
41
  return (state = initialData, { type, payload }) => {
@@ -97,6 +98,7 @@ export default {
97
98
  roll: 0,
98
99
  minZoom: d.minzoom ? d.minzoom : 0,
99
100
  maxZoom: d.maxzoom ? d.maxzoom : 22,
101
+
100
102
  };
101
103
 
102
104
  dispatch({ type: "VIEW_SET_DEFAULTS", payload: config });
@@ -161,9 +163,9 @@ export default {
161
163
 
162
164
  doZoomOut: () => ({ dispatch, store }) => {
163
165
  dispatch({ type: "VIEW_START_ACTION" });
164
- const view = store.selectView();
165
- const currentZoom = view.getZoom();
166
- animateView(
166
+ const view = store.selectView(); // pulling view
167
+ const currentZoom = view.getZoom(); // getting current view
168
+ animateView( // subtract 1 from current zoom
167
169
  {
168
170
  zoom: currentZoom - 1,
169
171
  },
@@ -42,6 +42,8 @@ export const treeViewDownload = {
42
42
  doUpdateTreeViewLayerDownloadFormat:
43
43
  (e) =>
44
44
  ({ dispatch }) => {
45
+ e.preventDefault();
46
+ e.stopPropagation();
45
47
  const layer = store.selectTreeViewSelectedItem();
46
48
  const format = e.target.value;
47
49
  let url = null;
@@ -53,7 +53,10 @@ const LayerSubpanel = (props) => {
53
53
  <i className="mdi mdi-star" title="Layer saved to favorites list" />
54
54
  ) : null}
55
55
  {treeViewSelectedItem.userDefaultLayer ? (
56
- <i className="mdi mdi-account" title="Layer saved to user default layer list" />
56
+ <i
57
+ className="mdi mdi-account"
58
+ title="Layer saved to user default layer list"
59
+ />
57
60
  ) : null}
58
61
  <b>{treeViewSelectedItem.displayName}</b>
59
62
  </p>
@@ -95,7 +98,7 @@ const LayerSubpanel = (props) => {
95
98
  <DefaultsToggle layer={treeViewSelectedItem} />
96
99
  ) : null}
97
100
 
98
- {showDownload ? ( <DownloadLayer /> ) : null}
101
+ {showDownload ? <DownloadLayer /> : null}
99
102
 
100
103
  <OpacitySlider layer={treeViewSelectedItem.mapLayer} />
101
104
 
@@ -0,0 +1,32 @@
1
+ export default {
2
+ name: "zoomLevel",
3
+
4
+ getReducer: () => {
5
+ const initialData = {
6
+ zoomLevelIndicator: false,
7
+ };
8
+ return (state = initialData, { type, payload }) => {
9
+ switch (type) {
10
+ case "ACTIVATE_ZOOM_INDICATOR":
11
+ case "DEACTIVATE_ZOOM_INDICATOR":
12
+ return Object.assign({}, state, payload);
13
+ default:
14
+ return state;
15
+ }
16
+ };
17
+ },
18
+
19
+ doZoomIndicatorActivate: () => ({ dispatch, store }) => {
20
+ dispatch({
21
+ type: "ACTIVATE_ZOOM_INDICATOR",
22
+ payload: {
23
+ zoomLevelIndicator: true,
24
+ },
25
+ });
26
+ },
27
+
28
+ selectZoomLevelIndicator: (state) => {
29
+ return state.zoomLevel.zoomLevelIndicator;
30
+ },
31
+ };
32
+
@@ -0,0 +1,16 @@
1
+ import zoomIndicator from './zoom-indicator';
2
+ import bundle from "./bundle";
3
+
4
+ const plugin = {
5
+ pluginName: 'zoomIndicator',
6
+ enabled: true,
7
+ bundle: bundle,
8
+ components:[{
9
+ component: zoomIndicator,
10
+ region: 'right-sidebar-top',
11
+ sortOrder: 40
12
+
13
+ }]
14
+ }
15
+
16
+ export default plugin;
@@ -0,0 +1,35 @@
1
+ import React from "react";
2
+ import { connect } from "redux-bundler-react";
3
+ import { SidebarButton } from "../../application-controls/index";
4
+
5
+ class zoomIndicator extends React.Component {
6
+ constructor(props) {
7
+ super(props);
8
+ this.handleClick = this.handleClick.bind(this);
9
+ }
10
+ handleClick() {}
11
+ render() {
12
+ const {mapZoom, zoomLevelIndicator} = this.props;
13
+
14
+ if (zoomLevelIndicator == true){
15
+ return (
16
+ <SidebarButton
17
+ iconText={Math.floor(mapZoom)}
18
+ label="Zoom-Indicator"
19
+ title="Zoom-Indicator"
20
+ onClick={this.handleClick}
21
+ />
22
+ );
23
+ }
24
+ else{
25
+ return (null);
26
+ }
27
+ }
28
+ }
29
+
30
+ export default connect(
31
+ 'doZoomIndicatorActivate',
32
+ 'selectMapZoom',
33
+ 'selectZoomLevelIndicator',
34
+ zoomIndicator
35
+ );
package/src/index.js CHANGED
@@ -26,6 +26,7 @@ import basemapSwitcher from "./core-plugins/basemap-switcher";
26
26
  import bookmarks from "./core-plugins/bookmarks";
27
27
  // import catalog from './core-plugins/catalog';
28
28
  // import cmIdent from './core-plugins/identify-cm';
29
+
29
30
  import coordDisplay from "./core-plugins/coordinate-display";
30
31
  import draw from "./core-plugins/draw-tools";
31
32
  // import editor from './core-plugins/editor';
@@ -46,6 +47,7 @@ import treeViewPanel from "./core-plugins/tree-view/tree-view-panel";
46
47
  import vectorIdent from "./core-plugins/identify-vector";
47
48
  import vectorSearch from "./core-plugins/vector-search";
48
49
  import zoomInOut from "./core-plugins/zoom-in-out";
50
+ import zoomLevel from "./core-plugins/zoom-level";
49
51
  import zoomHome from "./core-plugins/zoom-home";
50
52
  import zoomToBox from "./core-plugins/zoom-to-box";
51
53
  import mapLoadingIndicator from "./core-plugins/map-loading-indicator";
@@ -74,6 +76,7 @@ export {
74
76
  bookmarks,
75
77
  // catalog,
76
78
  // cmIdent,
79
+ zoomLevel,
77
80
  coordDisplay,
78
81
  draw,
79
82
  // editor,