@cashub/ui 0.25.0 → 0.25.1
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/map/GoogleMap.js +7 -2
- package/package.json +1 -1
package/map/GoogleMap.js
CHANGED
|
@@ -341,8 +341,9 @@ const Map = _ref2 => {
|
|
|
341
341
|
});
|
|
342
342
|
}
|
|
343
343
|
}
|
|
344
|
+
let repositionButton;
|
|
344
345
|
if (geoFenceOptions.enabledReposition) {
|
|
345
|
-
|
|
346
|
+
repositionButton = document.createElement('button');
|
|
346
347
|
repositionButton.style.margin = 'var(--spacing-s)';
|
|
347
348
|
repositionButton.style.padding = 'var(--spacing-xs)';
|
|
348
349
|
repositionButton.style.boxShadow = 'rgba(0, 0, 0, 0.3) 0px 1px 4px -1px';
|
|
@@ -360,13 +361,17 @@ const Map = _ref2 => {
|
|
|
360
361
|
lng: geoFenceOptions.longitude
|
|
361
362
|
});
|
|
362
363
|
});
|
|
363
|
-
|
|
364
|
+
const controlDiv = document.createElement('div');
|
|
365
|
+
controlDiv.appendChild(repositionButton);
|
|
366
|
+
map.controls[google.maps.ControlPosition.RIGHT_BOTTOM].push(controlDiv);
|
|
364
367
|
}
|
|
365
368
|
return () => {
|
|
366
369
|
circle.setMap(null);
|
|
367
370
|
window.google.maps.event.clearListeners(circle, 'click');
|
|
368
371
|
window.google.maps.event.clearListeners(circle, 'radius_changed');
|
|
369
372
|
window.google.maps.event.clearListeners(circle, 'center_changed');
|
|
373
|
+
const rightBottonControls = map.controls[google.maps.ControlPosition.RIGHT_BOTTOM];
|
|
374
|
+
rightBottonControls.removeAt(0);
|
|
370
375
|
};
|
|
371
376
|
}
|
|
372
377
|
}, [map, geoFence, geoFenceOptions.latitude, geoFenceOptions.longitude, geoFenceOptions.radius, geoFenceOptions.minRadius, geoFenceOptions.editable, geoFenceOptions.eventHandlers]);
|