File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -414,6 +414,17 @@ function getLocation(zoom = true, followLocationOverride) {
414414 let feature = currentLocationLayer . getSource ( ) . getFeatures ( ) [ 0 ] ;
415415 feature . setStyle ( iconStyle ) ;
416416 feature . getGeometry ( ) . setCoordinates ( ol . proj . fromLonLat ( pos ) ) ;
417+
418+ // Update the zIndex based on zoom level
419+ const currentZoom = map . getView ( ) . getZoom ( ) ;
420+ const animating = map . getView ( ) . getAnimating ( ) ;
421+ if ( currentZoom < 13.5 && ! animating ) {
422+ currentLocationLayer . setZIndex ( 99 ) ;
423+ } else {
424+ currentLocationLayer . setZIndex ( 1 ) ;
425+ }
426+ console . log ( "currentZoom: " + currentZoom ) ;
427+ console . log ( "currentLocationLayer zIndex: " + currentLocationLayer . getZIndex ( ) ) ;
417428 }
418429
419430 if ( followLocation && ! ( rotationMode === "compass" || rotationMode === "route" ) ) {
You can’t perform that action at this time.
0 commit comments