+
{
@@ -52,13 +59,13 @@ function MarasiDriveMapMobile() {
className={`absolute size-[11.111vw] right-[1.111vw] bottom-[1.111vw] `}
onClick={() => setMapActive(true)}
>
-
}
-
+ {/*
+ /> */}
);
}
-export default MarasiDriveMapMobile;
+export default GoogleMapMobile;
diff --git a/src/components/ui/MapMarker.tsx b/src/components/ui/MapMarker.tsx
index d3e324e..ed40045 100644
--- a/src/components/ui/MapMarker.tsx
+++ b/src/components/ui/MapMarker.tsx
@@ -1,4 +1,4 @@
-import { AdvancedMarker, Pin, useMap } from "@vis.gl/react-google-maps";
+import { AdvancedMarker, useMap } from "@vis.gl/react-google-maps";
import type { Marker } from "@googlemaps/markerclusterer";
import IGMapPoi from "../../types/IGMapPoi";
@@ -10,34 +10,38 @@ interface IGMapMarker {
}
export default function MapMarker({
- markerKey,
poi,
- setMarkerRef,
children,
+ markerKey,
+ setMarkerRef,
}: IGMapMarker) {
const map = useMap();
+ const { location, ignoreClusterization, label } = poi;
return (
{
+ if (!ignoreClusterization) {
+ setMarkerRef(marker, markerKey.toString());
+ }
+ }}
onClick={() => {
- map?.panTo(poi.location);
+ map?.panTo(location);
map?.setZoom(17);
}}
- key={markerKey}
- position={poi.location}
- ref={(marker) => {
- if (!poi.ignoreClusterization)
- setMarkerRef(marker, markerKey.toString());
- }}
>
- .label-container]:opacity-100 hover:[&>.label-container]:left-[calc(100%-38px)] hover:[&>.label-container]:pointer-events-auto hover:[&>.label-container]:z-140 hover:[&>.gmap-img-container]:z-150`}
>
- <>{children}>
-
+ {children}
+ {label && (
+
+ {label}
+
+ )}
+
);
}
diff --git a/src/data/googleMapData.tsx b/src/data/googleMapData.tsx
new file mode 100644
index 0000000..e573ea6
--- /dev/null
+++ b/src/data/googleMapData.tsx
@@ -0,0 +1,119 @@
+/* eslint-disable no-loss-of-precision */
+import IGMapPoi from "../types/IGMapPoi";
+import MarasiMarker from "../../public/images/map/markers/marasi-drive.png";
+import MarinaMarker from "../../public/images/map/markers/dubai-marina.png";
+import { marasiDriveMapCards } from "./aboutMarasiDrive";
+
+function GetMarkerHTML(name: string, primary: boolean = false) {
+ const src = !primary
+ ? marasiDriveMapCards.find((item) => item.title === name)?.image
+ : name;
+
+ return (
+ <>
+
+

+
+ {/* ADD POINTER FOR PRIMARY POINTS */}
+ >
+ );
+}
+
+export const GoogleMapData: {
+ marasiDriveDefaultCenter: { lat: number; lng: number };
+ dubaiMarinaDefaultCenter: { lat: number; lng: number };
+ markers: IGMapPoi[];
+} = {
+ marasiDriveDefaultCenter: {
+ lat: 25.183476007744233,
+ lng: 55.274782084720286,
+ },
+ dubaiMarinaDefaultCenter: {
+ lat: 25.069466431595334,
+ lng: 55.128736429300375,
+ },
+ markers: [
+ {
+ //Rove Dubai Marina Hotel
+ location: { lat: 25.069466431595334, lng: 55.128736429300375 },
+ type: "Hotels",
+ ignoreClusterization: true,
+ customMarker: GetMarkerHTML(MarinaMarker, true),
+ clickableAreaScale: 3,
+ label: "Rove Dubai Marina Hotel",
+ },
+ {
+ location: { lat: 25.181371868546396, lng: 55.27515332907251 },
+ type: "Hotels",
+ ignoreClusterization: true,
+ customMarker: GetMarkerHTML(MarasiMarker, true),
+ clickableAreaScale: 3,
+ label: "Marasi Drive",
+ },
+ // HOTELS
+ {
+ location: { lat: 25.197249056658244, lng: 55.27438894800352 },
+ type: "Hotels",
+ customMarker: GetMarkerHTML("Burj Khalifa"),
+ label: "Burj Khalifa",
+ },
+ {
+ location: { lat: 25.195237825881613, lng: 55.27528478028406 },
+ type: "Hotels",
+ customMarker: GetMarkerHTML("Dubai Fountain"),
+ label: "The Dubai Fountain",
+ },
+ {
+ location: { lat: 25.197748564692787, lng: 55.2802703666763 },
+ type: "Hotels",
+ customMarker: GetMarkerHTML("Dubai Mall"),
+ label: "Dubai Mall",
+ },
+ {
+ location: { lat: 25.195811139364157, lng: 55.27207211658565 },
+ type: "Hotels",
+ customMarker: GetMarkerHTML("Dubai Opera"),
+ label: "Dubai Opera",
+ },
+ {
+ location: { lat: 25.18774242603455, lng: 55.27024382999044 },
+ type: "Hotels",
+ customMarker: GetMarkerHTML("Marasi Promenade"),
+ label: "Marasi Promenade",
+ },
+ {
+ location: { lat: 25.203319687345175, lng: 55.279495993292876 },
+ type: "Hotels",
+ customMarker: GetMarkerHTML("Rove Downtown Hotel"),
+ label: "Rove Downtown Hotel",
+ },
+ {
+ location: { lat: 25.20535369013859, lng: 55.26803667795135 },
+ type: "Hotels",
+ customMarker: GetMarkerHTML("Rove City Walk Hotel"),
+ label: "Rove City Walk Hotel",
+ },
+ {
+ location: { lat: 25.20768362042376, lng: 55.26248238220776 },
+ type: "Hotels",
+ customMarker: GetMarkerHTML("City Walk"),
+ label: "City Walk",
+ },
+ {
+ location: { lat: 25.204504325496778, lng: 55.265693333774536 },
+ type: "Hotels",
+ customMarker: GetMarkerHTML("Coca-Cola Arena"),
+ label: "Coca-Cola Arena",
+ },
+ {
+ location: { lat: 25.26087724994889, lng: 55.372561586751665 },
+ type: "Hotels",
+ customMarker: GetMarkerHTML("Dubai International Airport"),
+ label: "Dubai International Airport",
+ },
+ ],
+};
diff --git a/src/data/marasiDriveMapData.tsx b/src/data/marasiDriveMapData.tsx
deleted file mode 100644
index f8d1d9f..0000000
--- a/src/data/marasiDriveMapData.tsx
+++ /dev/null
@@ -1,175 +0,0 @@
-/* eslint-disable no-loss-of-precision */
-import IGMapPoi from "../types/IGMapPoi";
-
-import MarasiMarker from "../../public/images/map/markers/marasi-drive.png";
-import MarinaMarker from "../../public/images/map/markers/dubai-marina.png";
-import MallsIcon from "../components/icons/map/MallsIcon";
-import HotelIcon from "../components/icons/map/HotelIcon";
-import EntertainmentIcon from "../components/icons/map/EntertainmentIcon";
-import OtherIcon from "../components/icons/map/OtherIcon";
-
-const marasiDriveMarker = (
-
-

-
-);
-
-const DubaiMarinaMarker = (
-
-

-
-);
-
-function Marker(type: "Hotels" | "Malls" | "Entertainment" | "Other") {
- const SvgByType = {
- Hotels:
,
- Malls:
,
- Entertainment:
,
- Other:
,
- };
-
- return (
-
- {SvgByType[type]}
-
- );
-}
-
-export const MarasiDriveMapData: {
- defaultCenter: { lat: number; lng: number };
- markers: IGMapPoi[];
-} = {
- defaultCenter: { lat: 25.183476007744233, lng: 55.274782084720286 },
- markers: [
- // HOTELS
- {
- //Atlantis the Palm
- location: { lat: 25.13046499761402, lng: 55.11718843636159 },
- type: "Hotels",
- customMarker: Marker("Hotels"),
- label: "Atlantis the Palm",
- },
- {
- //Atlantis the Royal
- location: { lat: 25.138673890838593, lng: 55.12795877692962 },
- type: "Hotels",
- customMarker: Marker("Hotels"),
- label: "Atlantis the Royal",
- },
- {
- //Rove JBR
- location: { lat: 25.083013494794002, lng: 55.13925845861501 },
- type: "Hotels",
- customMarker: Marker("Hotels"),
- label: "Rove JBR",
- },
- {
- //Rove Dubai Marina Hotel
- location: { lat: 25.069466431595334, lng: 55.128736429300375 },
- type: "Hotels",
- ignoreClusterization: true,
- customMarker: DubaiMarinaMarker,
- clickableAreaScale: 3,
- label: "Rove Dubai Marina Hotel",
- },
- {
- //Jumeirah Burj Al Arab
- location: { lat: 25.14125865549382, lng: 55.18534065404832 },
- type: "Hotels",
- customMarker: Marker("Hotels"),
- label: "Jumeirah Burj Al Arab",
- },
-
- // MALLS
- {
- //Dubai Marina Mall
- location: { lat: 25.076382747164647, lng: 55.14196528147056 },
- type: "Malls",
- customMarker: Marker("Malls"),
- label: "Dubai Marina Mall",
- },
-
- // ENTERTAINMENT
- {
- // Skydive Dubai
- location: { lat: 25.090979874826218, lng: 55.13798324927472 },
- type: "Entertainment",
- customMarker: Marker("Entertainment"),
- label: "Skydive Dubai",
- },
- {
- // JBR Beach
- location: { lat: 25.077626143690992, lng: 55.131404670555284 },
- type: "Entertainment",
- customMarker: Marker("Entertainment"),
- label: "JBR Beach",
- },
- {
- // Emirates Golf Club
- location: { lat: 25.08540156566801, lng: 55.16017556009668 },
- type: "Entertainment",
- customMarker: Marker("Entertainment"),
- label: "Emirates Golf Club",
- },
-
- // OTHER
- {
- // Palm Jumeirah
- location: { lat: 25.116513748878386, lng: 55.13630547853065 },
- type: "Other",
- customMarker: Marker("Other"),
- label: "Palm Jumeirah",
- },
- {
- // Dubai Harbour
- location: { lat: 25.093312800021923, lng: 55.14276330405519 },
- type: "Other",
- customMarker: Marker("Other"),
- label: "Dubai Harbour",
- },
- {
- // Emirates Hills
- location: { lat: 25.06922740304993, lng: 55.171394810795576 },
- type: "Other",
- customMarker: Marker("Other"),
- label: "Emirates Hills",
- },
- {
- // Internet City
- location: { lat: 25.09899279065803, lng: 55.16505834170482 },
- type: "Other",
- customMarker: Marker("Other"),
- label: "Internet City",
- },
- {
- // JLT
- location: { lat: 25.078250849819398, lng: 55.1499560328892 },
- type: "Other",
- customMarker: Marker("Other"),
- label: "JLT",
- },
- {
- // Jumeirah Islands
- location: { lat: 25.05800902880235, lng: 55.15510123900208 },
- type: "Other",
- customMarker: Marker("Other"),
- label: "Jumeirah Islands",
- },
- {
- // Bluewaters Island
- location: { lat: 25.080169343022643, lng: 55.121785121589454 },
- type: "Other",
- customMarker: Marker("Other"),
- label: "Bluewaters Island",
- },
-
- {
- location: { lat: 25.181371868546396, lng: 55.27515332907251 },
- type: "Hotels",
- ignoreClusterization: true,
- customMarker: marasiDriveMarker,
- clickableAreaScale: 3,
- label: "Marasi Drive",
- },
- ],
-};