Skip to content

Commit

Permalink
fix map marker issues and set max zoom level
Browse files Browse the repository at this point in the history
  • Loading branch information
bwees committed Aug 30, 2024
1 parent b63d948 commit 66a7d5e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
3 changes: 3 additions & 0 deletions app/components/map/MapView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,10 @@ const Map: React.FC = () => {
rotateEnabled={false}
region={defaultMapRegion}
onPanDrag={() => setIsViewCenteredOnUser(false)}
// this deprcation is ok, we only use it on android
maxZoomLevel={Platform.OS == "android" ? 18 : undefined}
showsMyLocationButton={false} // we have our own
// fix dark mode android map syling
customMapStyle={Platform.OS == "android" && theme.mode == "dark" ? DarkGoogleMaps : undefined}
>
{/* Route Polylines */}
Expand Down
12 changes: 11 additions & 1 deletion app/components/map/markers/BusMarker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import BusMapIcon from '../BusMapIcon';
import BusCallout from '../BusCallout';
import { IVehicle } from 'utils/interfaces';
import useAppStore from '../../../data/app_state';
import { Platform } from 'react-native';

interface Props {
bus: IVehicle,
Expand Down Expand Up @@ -31,7 +32,16 @@ const BusMarker: React.FC<Props> = ({ bus, tintColor, routeName }) => {
tracksViewChanges={false}
anchor={{x: 0.5, y: 0.5}}
pointerEvents="auto"
style={{ zIndex: 100, elevation: 100 }}
style={[
{ zIndex: 100, elevation: 100},

Platform.OS == "android" && {
width: 42,
height: 42,
justifyContent: 'center',
alignItems: 'center'
}
]}
onPress={() => busDefaultDirection()}
>
{/* Bus Icon on Map*/}
Expand Down
9 changes: 8 additions & 1 deletion app/components/map/markers/RoutePlanMarker.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { memo } from 'react';
import { MapMarker, Marker } from 'react-native-maps';
import { RoutePlanMapMarker } from 'utils/interfaces';
import { View } from 'react-native';
import { Platform, View } from 'react-native';
import { getLighterColor } from 'app/utils';
import useAppStore from 'app/data/app_state';

Expand All @@ -21,6 +21,13 @@ const RoutePlanMarker: React.FC<Props> = ({ marker }) => {
latitude: marker.latitude,
longitude: marker.longitude
}}
style={[
Platform.OS == "android" && {
height: 72,
justifyContent: 'center',
alignItems: 'center'
}
]}
tracksViewChanges={false}
anchor={{x: 0.5, y: 0.5}}
pointerEvents="auto"
Expand Down

0 comments on commit 66a7d5e

Please sign in to comment.