Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove node.js code from browser context #87

Merged
merged 1 commit into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
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
3 changes: 1 addition & 2 deletions src/pages/RealtimeMapPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ interface Path {
}

export const colorIcon = ({ operator_id, name }: { operator_id: string; name?: string }) => {
const path = process.env.PUBLIC_URL + `/bus-logos/${operator_id}.svg`
const path = `/bus-logos/${operator_id}.svg`
return new DivIcon({
className: 'my-div-icon',
html: `
Expand Down Expand Up @@ -245,7 +245,6 @@ export function Markers({ positions }: { positions: Point[] }) {
map.flyTo([position.coords.latitude, position.coords.longitude], 13),
)
}, [])
// const two = process.env.PUBLIC_URL + '/bus-groups/2.svg'

return (
<>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/components/MapLayers/BusLayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { VehicleLocation } from 'src/model/vehicleLocation'
import createClusterCustomIcon from '../utils/customCluster/customCluster'

const colorIcon = ({ operator_id, name }: { operator_id: string; name?: string }) => {
const path = process.env.PUBLIC_URL + `/bus-logos/${operator_id}.svg`
const path = `/bus-logos/${operator_id}.svg`
return new DivIcon({
className: 'my-div-icon',
html: `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default createClusterCustomIcon
const getIconForGroup = (numOfNearbyBusses: number): string => {
const groupSizes = [30, 10, 3, 2]

const imgPath = process.env.PUBLIC_URL + '/bus-groups/'
const imgPath = '/bus-groups/'
const iconName = `${groupSizes.find((groupSize) => numOfNearbyBusses >= groupSize) || 3}.svg`
return imgPath + iconName
}
Expand Down
Loading