Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Added mapillary overlay to task selection map #280

Open
wants to merge 26 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
bb0389d
Added date selector for street imagery
ezzhang8 Jun 29, 2022
12951a7
Frontend legend visuals
ezzhang8 Jun 30, 2022
660563f
Set date filters as default
ezzhang8 Jul 6, 2022
904e61f
Frontend imagery form revamp
ezzhang8 Jul 7, 2022
9c1db88
iD/RapiD editor fromdate filter
ezzhang8 Jul 7, 2022
2056c8e
Backend add fields of imageCaptureMode and mapillaryOrganizationId
ezzhang8 Jul 7, 2022
0af3cd3
Mapillary API organization get call
ezzhang8 Jul 7, 2022
9a51f7a
Map legend update
ezzhang8 Jul 7, 2022
c5986dd
Update editor/rapideditor
ezzhang8 Jul 7, 2022
18cf0d8
Update map.js
ezzhang8 Jul 11, 2022
065521a
Merge branch 'develop' into mapillaryui
ezzhang8 Aug 4, 2022
8cfe6a1
Update action.js
ezzhang8 Aug 4, 2022
e38d9c0
Addressing comments
ezzhang8 Aug 8, 2022
15b4b2a
Removed mapillary token
ezzhang8 Aug 8, 2022
b5eca82
Ran linter commands & addressed comments
ezzhang8 Aug 8, 2022
e68b1c7
Mapillary overlay on task map
ezzhang8 Aug 4, 2022
762c995
Moved compass icon loading to load event
ezzhang8 Aug 4, 2022
1e32e74
Update map.js
ezzhang8 Aug 4, 2022
9edb7be
Visibility toggle
ezzhang8 Aug 4, 2022
c4b94ed
Redirect to mapillary app on ios/android
ezzhang8 Aug 4, 2022
f11b29a
Fixed react warnings, ran yarn prettier
ezzhang8 Aug 8, 2022
857807d
Update frontend/src/components/taskSelection/footer.js
ezzhang8 Aug 10, 2022
da14707
Mapillary tokens in env; mapbox reorganize
ezzhang8 Aug 10, 2022
5b142ea
Changed mapillary layer toggle to state-based component
ezzhang8 Aug 10, 2022
5537dfe
Replaced graph url with env
ezzhang8 Aug 10, 2022
cd01f2b
Rerun checks
ezzhang8 Aug 18, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Moved compass icon loading to load event
ezzhang8 committed Aug 8, 2022
commit 762c995abb299836c836cf85881859e5980ffa86
73 changes: 34 additions & 39 deletions frontend/src/components/taskSelection/map.js
Original file line number Diff line number Diff line change
@@ -178,9 +178,7 @@ export const TasksMap = ({
positionOptions: {
enableHighAccuracy: true
},
// When active the map will receive updates to the device's location as it changes.
trackUserLocation: true,
// Draw an arrow next to the location dot to indicate which direction the device is heading.
showUserHeading: true
})
);
@@ -265,6 +263,40 @@ export const TasksMap = ({
}
});

map.loadImage(compassIcon, (error, image) => {
if (error) throw error;

map.addImage('compass', image);

})

map.addSource('point', {
'type': 'geojson',
'data': {
'type': 'FeatureCollection',
'features': [
{
'type': 'Feature',
'geometry': {
'type': 'Point',
'coordinates': [0, 0]
}
}
]
}
});

map.addLayer({
'id': 'mapillary-compass',
'type': 'symbol',
'source': 'point', // reference the data source
'layout': {
'icon-image': 'compass', // reference the image
'icon-size': 0.5,
'visibility': 'none'
}
})

map.addLayer({
id: 'selected-tasks-border',
type: 'line',
@@ -444,44 +476,7 @@ export const TasksMap = ({
}
});

map.loadImage(compassIcon, (error, image) => {
if (error) throw error;

if (!map.hasImage('compass')) {
map.addImage('compass', image);
}

if (!map.getSource('point')) {
map.addSource('point', {
'type': 'geojson',
'data': {
'type': 'FeatureCollection',
'features': [
{
'type': 'Feature',
'geometry': {
'type': 'Point',
'coordinates': [0, 0]
}
}
]
}
});
}

if (!map.getLayer('mapillary-compass')) {
map.addLayer({
'id': 'mapillary-compass',
'type': 'symbol',
'source': 'point', // reference the data source
'layout': {
'icon-image': 'compass', // reference the image
'icon-size': 0.5,
'visibility': 'none'
}
});
}
})