This repository has been archived by the owner on Sep 11, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 828
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Send pin drop location share events (#7967)
* center icon better Signed-off-by: Kerry Archibald <[email protected]> * remove debug Signed-off-by: Kerry Archibald <[email protected]> * retrigger all builds Signed-off-by: Kerry Archibald <[email protected]> * set assetType on share event Signed-off-by: Kerry Archibald <[email protected]> * use pin marker on map for pin drop share Signed-off-by: Kerry Archibald <[email protected]> * lint Signed-off-by: Kerry Archibald <[email protected]> * test events Signed-off-by: Kerry Archibald <[email protected]> * pin drop helper text Signed-off-by: Kerry Archibald <[email protected]> * use generic location type Signed-off-by: Kerry Archibald <[email protected]> * add navigationcontrol when in pin mode Signed-off-by: Kerry Archibald <[email protected]> * allow pin drop without location permissions Signed-off-by: Kerry Archibald <[email protected]> * remove geolocate control when pin dropping without geo perms Signed-off-by: Kerry Archibald <[email protected]> * test locationpicker Signed-off-by: Kerry Archibald <[email protected]> * test marker type, tidy Signed-off-by: Kerry Archibald <[email protected]> * tweak style Signed-off-by: Kerry Archibald <[email protected]> * lint Signed-off-by: Kerry Archibald <[email protected]>
- Loading branch information
Kerry
authored
Mar 9, 2022
1 parent
288e47f
commit 14684c6
Showing
9 changed files
with
540 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,23 @@ | ||
const EventEmitter = require("events"); | ||
const { LngLat } = require('maplibre-gl'); | ||
const { LngLat, NavigationControl } = require('maplibre-gl'); | ||
|
||
class MockMap extends EventEmitter { | ||
addControl = jest.fn(); | ||
removeControl = jest.fn(); | ||
} | ||
class MockGeolocateControl extends EventEmitter { | ||
const MockMapInstance = new MockMap(); | ||
|
||
class MockGeolocateControl extends EventEmitter { | ||
trigger = jest.fn(); | ||
} | ||
class MockMarker extends EventEmitter { | ||
setLngLat = jest.fn().mockReturnValue(this); | ||
addTo = jest.fn(); | ||
} | ||
const MockGeolocateInstance = new MockGeolocateControl(); | ||
const MockMarker = {} | ||
MockMarker.setLngLat = jest.fn().mockReturnValue(MockMarker); | ||
MockMarker.addTo = jest.fn().mockReturnValue(MockMarker); | ||
module.exports = { | ||
Map: MockMap, | ||
GeolocateControl: MockGeolocateControl, | ||
Marker: MockMarker, | ||
Map: jest.fn().mockReturnValue(MockMapInstance), | ||
GeolocateControl: jest.fn().mockReturnValue(MockGeolocateInstance), | ||
Marker: jest.fn().mockReturnValue(MockMarker), | ||
LngLat, | ||
NavigationControl | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.