@cashub/ui 0.24.5 → 0.25.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.
Files changed (2) hide show
  1. package/map/GoogleMap.js +21 -0
  2. package/package.json +1 -1
package/map/GoogleMap.js CHANGED
@@ -341,6 +341,27 @@ const Map = _ref2 => {
341
341
  });
342
342
  }
343
343
  }
344
+ if (geoFenceOptions.enabledReposition) {
345
+ const repositionButton = document.createElement('button');
346
+ repositionButton.style.margin = 'var(--spacing-s)';
347
+ repositionButton.style.padding = 'var(--spacing-xs)';
348
+ repositionButton.style.boxShadow = 'rgba(0, 0, 0, 0.3) 0px 1px 4px -1px';
349
+ repositionButton.style.border = 'none';
350
+ repositionButton.style.borderRadius = '2px';
351
+ repositionButton.style.cursor = 'pointer';
352
+ repositionButton.style.backgroundColor = 'rgb(255, 255, 255)';
353
+ repositionButton.style.fontSize = '1rem';
354
+ repositionButton.textContent = 'Reposition';
355
+ repositionButton.title = 'Click to reposition the map to geofence';
356
+ repositionButton.type = 'button';
357
+ repositionButton.addEventListener('click', () => {
358
+ map.setCenter({
359
+ lat: geoFenceOptions.latitude,
360
+ lng: geoFenceOptions.longitude
361
+ });
362
+ });
363
+ map.controls[google.maps.ControlPosition.RIGHT_BOTTOM].push(repositionButton);
364
+ }
344
365
  return () => {
345
366
  circle.setMap(null);
346
367
  window.google.maps.event.clearListeners(circle, 'click');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cashub/ui",
3
- "version": "0.24.5",
3
+ "version": "0.25.0",
4
4
  "private": false,
5
5
  "author": "CasHUB Team",
6
6
  "description": "CasHUB UI components library",