diff options
-rw-r--r-- | src/client/views/nodes/MapBox/MapBox.tsx | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/client/views/nodes/MapBox/MapBox.tsx b/src/client/views/nodes/MapBox/MapBox.tsx index 453a3d6fc..242611135 100644 --- a/src/client/views/nodes/MapBox/MapBox.tsx +++ b/src/client/views/nodes/MapBox/MapBox.tsx @@ -1,10 +1,11 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { GoogleMapProps, Marker } from '@react-google-maps/api'; import BingMapsReact from 'bingmaps-react'; -import { EditableText, IconButton, Type } from 'browndash-components'; +import { EditableText, IconButton, Toggle, Type } from 'browndash-components'; import { action, computed, IReactionDisposer, observable, ObservableMap, reaction, runInAction } from 'mobx'; import { observer } from 'mobx-react'; import * as React from 'react'; +import { getMenuPlacement } from 'react-select/src/components/Menu'; import { Doc, DocListCast, Opt } from '../../../../fields/Doc'; import { Width } from '../../../../fields/DocSymbols'; import { Id } from '../../../../fields/FieldSymbols'; @@ -695,7 +696,7 @@ export class MapBox extends ViewBoxAnnotatableComponent<ViewBoxAnnotatableProps * Toggles mode for placing a pin down on map */ @observable - placePinOn: boolean | undefined; + placePinOn = true; @action togglePlacePin = () => { if (this.placePinOn) this.placePinOn = false; @@ -822,6 +823,13 @@ export class MapBox extends ViewBoxAnnotatableComponent<ViewBoxAnnotatableProps <label htmlFor="switch" className="toggle"> <p>{this.placePinOn ? 'Place Pin ON' : 'Place Pin OFF'}</p> </label> + <Toggle + toggleStatus = {this.placePinOn} + onClick={this.togglePlacePin} + iconPlacement={"right"} + text="amongus" + + /> </div> <div className="mapBox-topbar"> |