mirror of
https://github.com/visgl/react-map-gl.git
synced 2026-01-25 16:02:50 +00:00
Remove overwritten dotElement from geolocate control (#944)
This commit is contained in:
parent
08267e7a5f
commit
82d18af7e6
@ -96,7 +96,6 @@ export default class GeolocateControl extends BaseControl<
|
||||
_mapboxGeolocateControl: any = null;
|
||||
|
||||
_geolocateButtonRef: {current: null | HTMLButtonElement} = createRef();
|
||||
_markerRef: {current: null | Marker} = createRef();
|
||||
|
||||
componentDidMount() {
|
||||
isGeolocationSupported().then(result => {
|
||||
@ -105,14 +104,6 @@ export default class GeolocateControl extends BaseControl<
|
||||
});
|
||||
}
|
||||
|
||||
componentDidUpdate() {
|
||||
// MapboxGeolocateControl needs manipulate the style of Marker's container
|
||||
const markerRef = this._markerRef.current;
|
||||
if (this._mapboxGeolocateControl && markerRef) {
|
||||
this._mapboxGeolocateControl._dotElement = markerRef._containerRef.current;
|
||||
}
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
// re-implement MapboxGeolocateControl's _onRemove
|
||||
// clear the geolocation watch if exists
|
||||
@ -235,7 +226,6 @@ export default class GeolocateControl extends BaseControl<
|
||||
// $FlowFixMe
|
||||
<Marker
|
||||
key="location-maker"
|
||||
ref={this._markerRef}
|
||||
className="mapboxgl-user-location-dot"
|
||||
longitude={markerPosition.longitude}
|
||||
latitude={markerPosition.latitude}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user