Skip to content
Merged
Changes from all commits
Commits
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
6 changes: 4 additions & 2 deletions src/HEREMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
animateCenter,
useVectorTiles,
engineType = H.Map.EngineType.HARP,
}, ref) => {

Check warning on line 101 in src/HEREMap.tsx

View workflow job for this annotation

GitHub Actions / lint

Refactor this function to reduce its Cognitive Complexity from 44 to the 15 allowed
if (engineType === H.Map.EngineType.WEBGL) {
throw new Error('WEBGL Engine is not supported.')
}
Expand Down Expand Up @@ -172,7 +172,7 @@
topLeft.walk(BEARING_TOP_LEFT, distance),
bottomRight.walk(BEARING_BOTTOM_RIGHT, distance),
)
if (viewBounds) { map.getViewModel().setLookAtData({ bounds: viewBounds }, animate, true) }
if (viewBounds) { map.getViewModel().setLookAtData({ bounds: viewBounds }, animate, !useVectorTiles) }
}

const zoomOnMarkers = (animate: number | boolean = true, group: string = 'default') => {
Expand Down Expand Up @@ -224,7 +224,7 @@
zoomOnMarkers,
zoomOnMarkersSet,
}
}, [map])

Check warning on line 227 in src/HEREMap.tsx

View workflow job for this annotation

GitHub Actions / lint

React Hook useImperativeHandle has missing dependencies: 'addToMarkerGroup', 'animateCenter', 'animateZoom', 'removeFromMarkerGroup', 'screenToGeo', 'zoomOnMarkers', and 'zoomOnMarkersSet'. Either include them or remove the dependency array

useEffect(() => {
if (unmountedRef.current) {
Expand Down Expand Up @@ -272,7 +272,9 @@
const behavior = interactive ? new H.mapevents.Behavior(new H.mapevents.MapEvents(newMap)) : undefined

if (behavior) {
behavior.disable(H.mapevents.Behavior.Feature.FRACTIONAL_ZOOM)
if (!useVectorTiles) {
behavior.disable(H.mapevents.Behavior.Feature.FRACTIONAL_ZOOM)
}

// create the default UI for the map
ui = H.ui.UI.createDefault(newMap, defaultLayersRef.current, getUILanguage(language))
Expand All @@ -297,7 +299,7 @@
unmountedRef.current = true
map?.dispose()
}
}, [])

Check warning on line 302 in src/HEREMap.tsx

View workflow job for this annotation

GitHub Actions / lint

React Hook useEffect has missing dependencies: 'apiKey', 'center', 'disableMapSettings', 'engineType', 'hidpi', 'interactive', 'language', 'map', 'onMapAvailable', 'trafficLayer', 'useVectorTiles', and 'zoom'. Either include them or remove the dependency array. If 'onMapAvailable' changes too often, find the parent component that defines it and wrap that definition in useCallback

useEffect(() => {
if (map) {
Expand Down
Loading