Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
joao-vasconcelos committed Jan 3, 2024
1 parent ef3fce9 commit d464f5c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 10 additions & 4 deletions nextjs/components/FrontendStopsToolbar/FrontendStopsToolbar.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
'use client';

/* * */

import styles from './FrontendStopsToolbar.module.css';
import OSMMapDefaults from '@/components/OSMMap/OSMMap.config';
import { IconArrowsMinimize, IconBrandGoogleMaps } from '@tabler/icons-react';
Expand All @@ -9,6 +11,8 @@ import { useMap } from 'react-map-gl/maplibre';
import FrontendStopsToolbarSearch from '@/components/FrontendStopsToolbarSearch/FrontendStopsToolbarSearch';
import { useFrontendStopsContext } from '@/contexts/FrontendStopsContext';

/* * */

export default function FrontendStopsToolbar() {
//

Expand All @@ -17,7 +21,7 @@ export default function FrontendStopsToolbar() {

const t = useTranslations('FrontendStopsToolbar');

const { FrontendStopsMap } = useMap();
const { frontendStopsMap } = useMap();
const frontendStopsContext = useFrontendStopsContext();

//
Expand All @@ -28,12 +32,12 @@ export default function FrontendStopsToolbar() {
};

const handleMapReCenter = () => {
FrontendStopsMap.flyTo({ ...OSMMapDefaults.viewport, duration: 2000 });
frontendStopsMap.flyTo({ ...OSMMapDefaults.viewport, duration: 2000 });
};

const handleOpenInGoogleMaps = () => {
const center = FrontendStopsMap.getCenter();
const zoom = FrontendStopsMap.getZoom();
const center = frontendStopsMap.getCenter();
const zoom = frontendStopsMap.getZoom();
const zoomMargin = 2; // Compensate the difference between OSM and Google Maps
window.open(`https://www.google.com/maps/@${center.lat},${center.lng},${zoom + zoomMargin}z`, '_blank', 'noopener,noreferrer');
};
Expand Down Expand Up @@ -72,4 +76,6 @@ export default function FrontendStopsToolbar() {
</div>
</div>
);

//
}
2 changes: 1 addition & 1 deletion nextjs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@carrismetropolitana/website",
"version": "2024.01.03-1519",
"version": "2024.01.03-1525",
"private": true,
"scripts": {
"dev": "next dev",
Expand Down

0 comments on commit d464f5c

Please sign in to comment.