diff options
author | Anton Tananaev <anton@traccar.org> | 2022-08-01 16:41:28 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2022-08-01 16:41:28 -0700 |
commit | a15dd2a6a947672b576f474ad80a8902f1fb2ac2 (patch) | |
tree | bd6a9dea7eca449eccc18745aa175c7eb7bdc177 /modern/src/map/MapDirection.js | |
parent | 0bad707fd781a665426926d19d9775a9b0cca90b (diff) | |
download | trackermap-web-a15dd2a6a947672b576f474ad80a8902f1fb2ac2.tar.gz trackermap-web-a15dd2a6a947672b576f474ad80a8902f1fb2ac2.tar.bz2 trackermap-web-a15dd2a6a947672b576f474ad80a8902f1fb2ac2.zip |
Support icon scaling (fix #799)
Diffstat (limited to 'modern/src/map/MapDirection.js')
-rw-r--r-- | modern/src/map/MapDirection.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/modern/src/map/MapDirection.js b/modern/src/map/MapDirection.js index 736d7166..7897cda7 100644 --- a/modern/src/map/MapDirection.js +++ b/modern/src/map/MapDirection.js @@ -1,10 +1,13 @@ import { useEffect } from 'react'; +import { useAttributePreference } from '../common/util/preferences'; import { map } from './core/MapView'; const MapDirection = ({ position }) => { const id = 'directions'; + const iconScale = useAttributePreference('iconScale', 1); + useEffect(() => { map.addSource(id, { type: 'geojson', @@ -19,6 +22,7 @@ const MapDirection = ({ position }) => { source: id, layout: { 'icon-image': 'direction', + 'icon-size': iconScale, 'icon-rotate': ['get', 'rotation'], 'icon-rotation-alignment': 'map', }, |