diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 2963264..97806ba 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,4 +1,6 @@ + + diff --git a/app.config.js b/app.config.js index 0c6f37e..799b203 100644 --- a/app.config.js +++ b/app.config.js @@ -16,9 +16,10 @@ export default { bundleIdentifier: "com.anonymous.hipmi-mobile", infoPlist: { ITSAppUsesNonExemptEncryption: false, + "NSLocationWhenInUseUsageDescription": "Aplikasi membutuhkan akses lokasi untuk menampilkan peta.", }, associatedDomains: ["applinks:cld-dkr-staging-hipmi.wibudev.com"], - buildNumber: "7", + buildNumber: "8", }, android: { @@ -75,6 +76,7 @@ export default { }, ], "expo-font", + "@rnmapbox/maps", ], experiments: { diff --git a/app/(application)/(user)/maps/index.tsx b/app/(application)/(user)/maps/index.tsx index 90ba6eb..96907e9 100644 --- a/app/(application)/(user)/maps/index.tsx +++ b/app/(application)/(user)/maps/index.tsx @@ -1,32 +1,6 @@ -import { - ButtonCustom, - DrawerCustom, - DummyLandscapeImage, - Grid, - Spacing, - StackCustom, - TextCustom, - ViewWrapper, -} from "@/components"; -import GridTwoView from "@/components/_ShareComponent/GridTwoView"; -import API_IMAGE from "@/constants/api-storage"; -import { ICON_SIZE_SMALL } from "@/constants/constans-value"; -import { apiMapsGetAll } from "@/service/api-client/api-maps"; -import { openInDeviceMaps } from "@/utils/openInDeviceMaps"; -import { FontAwesome, Ionicons } from "@expo/vector-icons"; -import { Image } from "expo-image"; -import { router, useFocusEffect } from "expo-router"; -import { useCallback, useState } from "react"; -import { View } from "react-native"; -import MapView, { Marker } from "react-native-maps"; - -const defaultRegion = { - latitude: -8.737109, - longitude: 115.1756897, - latitudeDelta: 0.1, - longitudeDelta: 0.1, - height: 300, -}; +import MapsView from "@/screens/Maps/MapsView"; +import MapsView2 from "@/screens/Maps/MapsView2"; +import { Text, View } from "react-native"; export interface LocationItem { id: string | number; @@ -37,198 +11,11 @@ export interface LocationItem { } export default function Maps() { - const [list, setList] = useState(null); - const [loadList, setLoadList] = useState(false); - const [openDrawer, setOpenDrawer] = useState(false); - const [selected, setSelected] = useState({ - id: "", - bidangBisnis: "", - nomorTelepon: "", - alamatBisnis: "", - namePin: "", - imageId: "", - portofolioId: "", - latitude: 0, - longitude: 0, - }); - - useFocusEffect( - useCallback(() => { - handlerLoadList(); - }, []) - ); - - const handlerLoadList = async () => { - try { - setLoadList(true); - const response = await apiMapsGetAll(); - - if (response.success) { - setList(response.data); - } - } catch (error) { - console.log("[ERROR]", error); - } finally { - setLoadList(false); - } - }; - return ( <> - - {/* */} - - {loadList ? ( - - ) : ( - - {list?.map((item: any, index: number) => { - return ( - { - setOpenDrawer(true); - setSelected({ - id: item?.id, - bidangBisnis: - item?.Portofolio?.MasterBidangBisnis?.name, - nomorTelepon: item?.Portofolio?.tlpn, - alamatBisnis: item?.Portofolio?.alamatKantor, - namePin: item?.namePin, - imageId: item?.imageId, - portofolioId: item?.Portofolio?.id, - latitude: item?.latitude, - longitude: item?.longitude, - }); - }} - // Gunakan gambar kustom jika tersedia - > - - - - - ); - })} - - )} - - - - setOpenDrawer(false)} - height={"auto"} - > - - - - - } - rightIcon={{selected.namePin}} - /> - - - } - rightIcon={{selected.bidangBisnis}} - /> - - - } - rightIcon={{selected.nomorTelepon}} - /> - - } - rightIcon={{selected.alamatBisnis}} - /> - - - - { - setOpenDrawer(false); - router.push(`/portofolio/${selected.portofolioId}`); - }} - > - Detail - - - - { - openInDeviceMaps({ - latitude: selected.latitude, - longitude: selected.longitude, - title: selected.namePin, - }); - }} - > - Buka Maps - - - - - + + {/* , */} + {/* Map disabled */} ); } diff --git a/bun.lock b/bun.lock index c15cfc7..4419dcc 100644 --- a/bun.lock +++ b/bun.lock @@ -12,6 +12,7 @@ "@react-navigation/elements": "^2.3.8", "@react-navigation/native": "^7.1.6", "@react-navigation/native-stack": "^7.3.10", + "@rnmapbox/maps": "^10.2.7", "@types/lodash": "^4.17.20", "@types/react-native-vector-icons": "^6.4.18", "axios": "^1.11.0", @@ -29,6 +30,7 @@ "expo-image": "~3.0.8", "expo-image-picker": "~17.0.8", "expo-linking": "~8.0.8", + "expo-location": "~19.0.7", "expo-notifications": "^0.32.13", "expo-router": "~6.0.1", "expo-splash-screen": "~31.0.9", @@ -574,6 +576,8 @@ "@react-navigation/routers": ["@react-navigation/routers@7.4.1", "", { "dependencies": { "nanoid": "^3.3.11" } }, "sha512-42mZrMzQ0LfKxUb5OHIurYrPYyRsXFLolucILrvm21f0O40Sw0Ufh1bnn/jRqnxZZu7wvpUGIGYM8nS9zVE1Aw=="], + "@rnmapbox/maps": ["@rnmapbox/maps@10.2.7", "", { "dependencies": { "@turf/along": "6.5.0", "@turf/distance": "6.5.0", "@turf/helpers": "6.5.0", "@turf/length": "6.5.0", "@turf/nearest-point-on-line": "6.5.0", "@types/geojson": "^7946.0.7", "debounce": "^2.2.0" }, "peerDependencies": { "expo": ">=47.0.0", "mapbox-gl": "^2.9.0", "react": ">=17.0.0", "react-dom": ">= 17.0.0", "react-native": ">=0.69" }, "optionalPeers": ["expo", "mapbox-gl", "react-dom"] }, "sha512-CJZuBKz2EiHjpJsyPz0jZOcm0jniDJdkeboeuyrcCIGe53Cw8gCFM6hxWOTJTL04o7idbNxD54jD4BQKxs6b1A=="], + "@rtsao/scc": ["@rtsao/scc@1.1.0", "", {}, "sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g=="], "@sinclair/typebox": ["@sinclair/typebox@0.27.8", "", {}, "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA=="], @@ -588,6 +592,30 @@ "@tsconfig/node18": ["@tsconfig/node18@18.2.4", "", {}, "sha512-5xxU8vVs9/FNcvm3gE07fPbn9tl6tqGGWA9tSlwsUEkBxtRnTsNmwrV8gasZ9F/EobaSv9+nu8AxUKccw77JpQ=="], + "@turf/along": ["@turf/along@6.5.0", "", { "dependencies": { "@turf/bearing": "^6.5.0", "@turf/destination": "^6.5.0", "@turf/distance": "^6.5.0", "@turf/helpers": "^6.5.0", "@turf/invariant": "^6.5.0" } }, "sha512-LLyWQ0AARqJCmMcIEAXF4GEu8usmd4Kbz3qk1Oy5HoRNpZX47+i5exQtmIWKdqJ1MMhW26fCTXgpsEs5zgJ5gw=="], + + "@turf/bbox": ["@turf/bbox@7.3.0", "", { "dependencies": { "@turf/helpers": "7.3.0", "@turf/meta": "7.3.0", "@types/geojson": "^7946.0.10", "tslib": "^2.8.1" } }, "sha512-EC5GSUJlhXSiCVCEmgCSheZYm0s1ouKzUNqeEOsEYlqTbMAZ19RWgsg/xH2tjnuUw2JP9eGAUzQnCFX6JEV53w=="], + + "@turf/bearing": ["@turf/bearing@6.5.0", "", { "dependencies": { "@turf/helpers": "^6.5.0", "@turf/invariant": "^6.5.0" } }, "sha512-dxINYhIEMzgDOztyMZc20I7ssYVNEpSv04VbMo5YPQsqa80KO3TFvbuCahMsCAW5z8Tncc8dwBlEFrmRjJG33A=="], + + "@turf/destination": ["@turf/destination@6.5.0", "", { "dependencies": { "@turf/helpers": "^6.5.0", "@turf/invariant": "^6.5.0" } }, "sha512-4cnWQlNC8d1tItOz9B4pmJdWpXqS0vEvv65bI/Pj/genJnsL7evI0/Xw42RvEGROS481MPiU80xzvwxEvhQiMQ=="], + + "@turf/distance": ["@turf/distance@6.5.0", "", { "dependencies": { "@turf/helpers": "^6.5.0", "@turf/invariant": "^6.5.0" } }, "sha512-xzykSLfoURec5qvQJcfifw/1mJa+5UwByZZ5TZ8iaqjGYN0vomhV9aiSLeYdUGtYRESZ+DYC/OzY+4RclZYgMg=="], + + "@turf/helpers": ["@turf/helpers@6.5.0", "", {}, "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw=="], + + "@turf/invariant": ["@turf/invariant@6.5.0", "", { "dependencies": { "@turf/helpers": "^6.5.0" } }, "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg=="], + + "@turf/length": ["@turf/length@6.5.0", "", { "dependencies": { "@turf/distance": "^6.5.0", "@turf/helpers": "^6.5.0", "@turf/meta": "^6.5.0" } }, "sha512-5pL5/pnw52fck3oRsHDcSGrj9HibvtlrZ0QNy2OcW8qBFDNgZ4jtl6U7eATVoyWPKBHszW3dWETW+iLV7UARig=="], + + "@turf/line-intersect": ["@turf/line-intersect@6.5.0", "", { "dependencies": { "@turf/helpers": "^6.5.0", "@turf/invariant": "^6.5.0", "@turf/line-segment": "^6.5.0", "@turf/meta": "^6.5.0", "geojson-rbush": "3.x" } }, "sha512-CS6R1tZvVQD390G9Ea4pmpM6mJGPWoL82jD46y0q1KSor9s6HupMIo1kY4Ny+AEYQl9jd21V3Scz20eldpbTVA=="], + + "@turf/line-segment": ["@turf/line-segment@6.5.0", "", { "dependencies": { "@turf/helpers": "^6.5.0", "@turf/invariant": "^6.5.0", "@turf/meta": "^6.5.0" } }, "sha512-jI625Ho4jSuJESNq66Mmi290ZJ5pPZiQZruPVpmHkUw257Pew0alMmb6YrqYNnLUuiVVONxAAKXUVeeUGtycfw=="], + + "@turf/meta": ["@turf/meta@6.5.0", "", { "dependencies": { "@turf/helpers": "^6.5.0" } }, "sha512-RrArvtsV0vdsCBegoBtOalgdSOfkBrTJ07VkpiCnq/491W67hnMWmDu7e6Ztw0C3WldRYTXkg3SumfdzZxLBHA=="], + + "@turf/nearest-point-on-line": ["@turf/nearest-point-on-line@6.5.0", "", { "dependencies": { "@turf/bearing": "^6.5.0", "@turf/destination": "^6.5.0", "@turf/distance": "^6.5.0", "@turf/helpers": "^6.5.0", "@turf/invariant": "^6.5.0", "@turf/line-intersect": "^6.5.0", "@turf/meta": "^6.5.0" } }, "sha512-WthrvddddvmymnC+Vf7BrkHGbDOUu6Z3/6bFYUGv1kxw8tiZ6n83/VG6kHz4poHOfS0RaNflzXSkmCi64fLBlg=="], + "@tybys/wasm-util": ["@tybys/wasm-util@0.9.0", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-6+7nlbMVX/PVDCwaIQ8nTOPveOcFLSt8GcXdx8hD0bt39uWxYT88uXzqTd4fTvqta7oeUJqudepapKNt2DYJFw=="], "@types/babel__core": ["@types/babel__core@7.20.5", "", { "dependencies": { "@babel/parser": "^7.20.7", "@babel/types": "^7.20.7", "@types/babel__generator": "*", "@types/babel__template": "*", "@types/babel__traverse": "*" } }, "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA=="], @@ -984,6 +1012,8 @@ "dayjs": ["dayjs@1.11.13", "", {}, "sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg=="], + "debounce": ["debounce@2.2.0", "", {}, "sha512-Xks6RUDLZFdz8LIdR6q0MTH44k7FikOmnh5xkSjMig6ch45afc8sjTjRQf3P6ax8dMgcQrYO/AR2RGWURrruqw=="], + "debug": ["debug@4.4.1", "", { "dependencies": { "ms": "^2.1.3" } }, "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ=="], "decamelize": ["decamelize@1.2.0", "", {}, "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA=="], @@ -1198,6 +1228,8 @@ "expo-linking": ["expo-linking@8.0.8", "", { "dependencies": { "expo-constants": "~18.0.8", "invariant": "^2.2.4" }, "peerDependencies": { "react": "*", "react-native": "*" } }, "sha512-MyeMcbFDKhXh4sDD1EHwd0uxFQNAc6VCrwBkNvvvufUsTYFq3glTA9Y8a+x78CPpjNqwNAamu74yIaIz7IEJyg=="], + "expo-location": ["expo-location@19.0.7", "", { "peerDependencies": { "expo": "*" } }, "sha512-YNkh4r9E6ECbPkBCAMG5A5yHDgS0pw+Rzyd0l2ZQlCtjkhlODB55nMCKr5CZnUI0mXTkaSm8CwfoCO8n2MpYfg=="], + "expo-manifests": ["expo-manifests@1.0.8", "", { "dependencies": { "@expo/config": "~12.0.8", "expo-json-utils": "~0.15.0" }, "peerDependencies": { "expo": "*" } }, "sha512-nA5PwU2uiUd+2nkDWf9e71AuFAtbrb330g/ecvuu52bmaXtN8J8oiilc9BDvAX0gg2fbtOaZdEdjBYopt1jdlQ=="], "expo-module-scripts": ["expo-module-scripts@4.1.10", "", { "dependencies": { "@babel/cli": "^7.23.4", "@babel/plugin-transform-export-namespace-from": "^7.23.4", "@babel/preset-env": "^7.23.8", "@babel/preset-typescript": "^7.23.3", "@expo/npm-proofread": "^1.0.1", "@testing-library/react-native": "^13.1.0", "@tsconfig/node18": "^18.2.2", "@types/jest": "^29.2.1", "babel-plugin-dynamic-import-node": "^2.3.3", "babel-preset-expo": "~13.2.3", "commander": "^12.1.0", "eslint-config-universe": "^15.0.3", "glob": "^10.4.2", "jest-expo": "~53.0.9", "jest-snapshot-prettier": "npm:prettier@^2", "jest-watch-typeahead": "2.2.1", "resolve-workspace-root": "^2.0.0", "ts-jest": "~29.0.4", "typescript": "^5.8.3" }, "bin": { "expo-module": "bin/expo-module.js" } }, "sha512-fQVXVgxqUOz1cnnNumNLm0eI+Y8IhYNa056ad0vxEhcMui6FjS1+beZNHiaClGwd/NQb5RjlT48ABL3XSGHwxQ=="], @@ -1290,6 +1322,8 @@ "gensync": ["gensync@1.0.0-beta.2", "", {}, "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg=="], + "geojson-rbush": ["geojson-rbush@3.2.0", "", { "dependencies": { "@turf/bbox": "*", "@turf/helpers": "6.x", "@turf/meta": "6.x", "@types/geojson": "7946.0.8", "rbush": "^3.0.1" } }, "sha512-oVltQTXolxvsz1sZnutlSuLDEcQAKYC/uXt9zDzJJ6bu0W+baTI8LZBaTup5afzibEH4N3jlq2p+a152wlBJ7w=="], + "get-caller-file": ["get-caller-file@2.0.5", "", {}, "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg=="], "get-intrinsic": ["get-intrinsic@1.3.0", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.2", "es-define-property": "^1.0.1", "es-errors": "^1.3.0", "es-object-atoms": "^1.1.1", "function-bind": "^1.1.2", "get-proto": "^1.0.1", "gopd": "^1.2.0", "has-symbols": "^1.1.0", "hasown": "^2.0.2", "math-intrinsics": "^1.1.0" } }, "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ=="], @@ -1862,10 +1896,14 @@ "queue-microtask": ["queue-microtask@1.2.3", "", {}, "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A=="], + "quickselect": ["quickselect@2.0.0", "", {}, "sha512-RKJ22hX8mHe3Y6wH/N3wCM6BWtjaxIyyUIkpHOvfFnxdI4yD4tBXEBKSbriGujF6jnSVkJrffuo6vxACiSSxIw=="], + "randombytes": ["randombytes@2.1.0", "", { "dependencies": { "safe-buffer": "^5.1.0" } }, "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ=="], "range-parser": ["range-parser@1.2.1", "", {}, "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg=="], + "rbush": ["rbush@3.0.1", "", { "dependencies": { "quickselect": "^2.0.0" } }, "sha512-XRaVO0YecOpEuIvbhbpTrZgoiI6xBlz6hnlr6EHhd+0x9ase6EmeN+hdwwUaJvLcsFFQ8iWVF1GAK1yB0BWi0w=="], + "rc": ["rc@1.2.8", "", { "dependencies": { "deep-extend": "^0.6.0", "ini": "~1.3.0", "minimist": "^1.2.0", "strip-json-comments": "~2.0.1" }, "bin": "cli.js" }, "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw=="], "react": ["react@19.1.0", "", {}, "sha512-FS+XFBNvn3GTAWq26joslQgWNoFu08F4kl0J4CgdNKADkdSGXQyTCnKteIAJy96Br6YbpEU1LSzV5dYtjMkMDg=="], @@ -2500,6 +2538,10 @@ "@testing-library/react-native/pretty-format": ["pretty-format@30.0.5", "", { "dependencies": { "@jest/schemas": "30.0.5", "ansi-styles": "^5.2.0", "react-is": "^18.3.1" } }, "sha512-D1tKtYvByrBkFLe2wHJl2bwMJIiT8rW+XA+TiataH79/FszLQMrpGEvzUVkzPau7OCO0Qnrhpe87PqtOAIB8Yw=="], + "@turf/bbox/@turf/helpers": ["@turf/helpers@7.3.0", "", { "dependencies": { "@types/geojson": "^7946.0.10", "tslib": "^2.8.1" } }, "sha512-5kWdgwI6e2vGbkt2qOD+Z2BiKQ7dfKN/PtWRLCpvzyOO59rk19R53CHi8nUT/Y1vQLgWmT6eNpiKwsWwPZGIdg=="], + + "@turf/bbox/@turf/meta": ["@turf/meta@7.3.0", "", { "dependencies": { "@turf/helpers": "7.3.0", "@types/geojson": "^7946.0.10" } }, "sha512-fTLqdQqRm8qA2zHHUbBMY++YT9LDQejLG7OD70XF2dwg9nPiF9mUxO7nrsDp2IY8vNmH9OTAiMtlIjb0ssYccg=="], + "@types/react-native/@types/react": ["@types/react@19.0.14", "", { "dependencies": { "csstype": "^3.0.2" } }, "sha512-ixLZ7zG7j1fM0DijL9hDArwhwcCb4vqmePgwtV0GfnkHRSCUEv4LvzarcTdhoqgyMznUx/EhoTUv31CKZzkQlw=="], "@types/react-native-vector-icons/@types/react": ["@types/react@19.0.14", "", { "dependencies": { "csstype": "^3.0.2" } }, "sha512-ixLZ7zG7j1fM0DijL9hDArwhwcCb4vqmePgwtV0GfnkHRSCUEv4LvzarcTdhoqgyMznUx/EhoTUv31CKZzkQlw=="], @@ -2618,6 +2660,8 @@ "finalhandler/statuses": ["statuses@1.5.0", "", {}, "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA=="], + "geojson-rbush/@types/geojson": ["@types/geojson@7946.0.8", "", {}, "sha512-1rkryxURpr6aWP7R786/UQOkJ3PcpQiWkAXBmdWc7ryFWqN6a4xfK7BtjXvFBKO9LjQ+MWQSWxYeZX1OApnArA=="], + "glob/minimatch": ["minimatch@9.0.5", "", { "dependencies": { "brace-expansion": "^2.0.1" } }, "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow=="], "hoist-non-react-statics/react-is": ["react-is@16.13.1", "", {}, "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="], diff --git a/ios/HIPMIBadungConnect.xcodeproj/project.pbxproj b/ios/HIPMIBadungConnect.xcodeproj/project.pbxproj index 88b92e1..f4b773c 100644 --- a/ios/HIPMIBadungConnect.xcodeproj/project.pbxproj +++ b/ios/HIPMIBadungConnect.xcodeproj/project.pbxproj @@ -272,14 +272,22 @@ ); inputPaths = ( "${PODS_ROOT}/Target Support Files/Pods-HIPMIBadungConnect/Pods-HIPMIBadungConnect-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/MapboxMaps/MapboxMaps.framework", + "${PODS_XCFRAMEWORKS_BUILD_DIR}/MapboxCommon/MapboxCommon.framework/MapboxCommon", + "${PODS_XCFRAMEWORKS_BUILD_DIR}/MapboxCoreMaps/MapboxCoreMaps.framework/MapboxCoreMaps", "${PODS_XCFRAMEWORKS_BUILD_DIR}/React-Core-prebuilt/React.framework/React", "${PODS_XCFRAMEWORKS_BUILD_DIR}/ReactNativeDependencies/ReactNativeDependencies.framework/ReactNativeDependencies", + "${PODS_XCFRAMEWORKS_BUILD_DIR}/Turf/Turf.framework/Turf", "${PODS_XCFRAMEWORKS_BUILD_DIR}/hermes-engine/Pre-built/hermes.framework/hermes", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MapboxMaps.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MapboxCommon.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MapboxCoreMaps.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/React.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ReactNativeDependencies.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Turf.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/hermes.framework", ); runOnlyForDeploymentPostprocessing = 0; @@ -414,7 +422,7 @@ ); OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_DEBUG"; PRODUCT_BUNDLE_IDENTIFIER = "com.anonymous.hipmi-mobile"; - PRODUCT_NAME = "HIPMIBadungConnect"; + PRODUCT_NAME = HIPMIBadungConnect; SWIFT_OBJC_BRIDGING_HEADER = "HIPMIBadungConnect/HIPMIBadungConnect-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; @@ -446,7 +454,7 @@ ); OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_RELEASE"; PRODUCT_BUNDLE_IDENTIFIER = "com.anonymous.hipmi-mobile"; - PRODUCT_NAME = "HIPMIBadungConnect"; + PRODUCT_NAME = HIPMIBadungConnect; SWIFT_OBJC_BRIDGING_HEADER = "HIPMIBadungConnect/HIPMIBadungConnect-Bridging-Header.h"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; diff --git a/ios/HIPMIBadungConnect/Info.plist b/ios/HIPMIBadungConnect/Info.plist index 216ee66..4e8209f 100644 --- a/ios/HIPMIBadungConnect/Info.plist +++ b/ios/HIPMIBadungConnect/Info.plist @@ -39,7 +39,7 @@ CFBundleVersion - 7 + 8 ITSAppUsesNonExemptEncryption LSMinimumSystemVersion diff --git a/ios/Podfile.lock b/ios/Podfile.lock index be278fd..aa9a724 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -241,6 +241,8 @@ PODS: - ExpoModulesCore - ExpoLinking (8.0.8): - ExpoModulesCore + - ExpoLocation (19.0.7): + - ExpoModulesCore - ExpoModulesCore (3.0.15): - hermes-engine - RCTRequired @@ -295,6 +297,14 @@ PODS: - libwebp/sharpyuv (1.5.0) - libwebp/webp (1.5.0): - libwebp/sharpyuv + - MapboxCommon (24.15.4): + - Turf (= 4.0.0) + - MapboxCoreMaps (11.15.4): + - MapboxCommon (= 24.15.4) + - MapboxMaps (11.15.4): + - MapboxCommon (= 24.15.4) + - MapboxCoreMaps (= 11.15.4) + - Turf (= 4.0.0) - RCTDeprecation (0.81.4) - RCTRequired (0.81.4) - RCTTypeSafety (0.81.4): @@ -2150,6 +2160,33 @@ PODS: - ReactCommon/turbomodule/core - ReactNativeDependencies - Yoga + - rnmapbox-maps (10.2.7): + - MapboxMaps (~> 11.15.2) + - React + - React-Core + - rnmapbox-maps/DynamicLibrary (= 10.2.7) + - Turf + - rnmapbox-maps/DynamicLibrary (10.2.7): + - hermes-engine + - MapboxMaps (~> 11.15.2) + - RCTRequired + - RCTTypeSafety + - React + - React-Core + - React-Core-prebuilt + - React-featureflags + - React-ImageManager + - React-jsi + - React-NativeModulesApple + - React-RCTFabric + - React-renderercss + - React-rendererdebug + - ReactCodegen + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - ReactNativeDependencies + - Turf + - Yoga - RNReanimated (4.1.0): - hermes-engine - RCTRequired @@ -2420,6 +2457,7 @@ PODS: - SDWebImageWebPCoder (0.14.6): - libwebp (~> 1.0) - SDWebImage/Core (~> 5.17) + - Turf (4.0.0) - Yoga (0.0.0) - ZXingObjC/Core (3.6.9) - ZXingObjC/OneD (3.6.9): @@ -2452,6 +2490,7 @@ DEPENDENCIES: - ExpoImagePicker (from `../node_modules/expo-image-picker/ios`) - ExpoKeepAwake (from `../node_modules/expo-keep-awake/ios`) - ExpoLinking (from `../node_modules/expo-linking/ios`) + - ExpoLocation (from `../node_modules/expo-location/ios`) - ExpoModulesCore (from `../node_modules/expo-modules-core`) - ExpoSplashScreen (from `../node_modules/expo-splash-screen/ios`) - ExpoSymbols (from `../node_modules/expo-symbols/ios`) @@ -2533,6 +2572,7 @@ DEPENDENCIES: - "RNCAsyncStorage (from `../node_modules/@react-native-async-storage/async-storage`)" - "RNDateTimePicker (from `../node_modules/@react-native-community/datetimepicker`)" - RNGestureHandler (from `../node_modules/react-native-gesture-handler`) + - "rnmapbox-maps (from `../node_modules/@rnmapbox/maps`)" - RNReanimated (from `../node_modules/react-native-reanimated`) - RNScreens (from `../node_modules/react-native-screens`) - RNSVG (from `../node_modules/react-native-svg`) @@ -2545,10 +2585,14 @@ SPEC REPOS: - libavif - libdav1d - libwebp + - MapboxCommon + - MapboxCoreMaps + - MapboxMaps - SDWebImage - SDWebImageAVIFCoder - SDWebImageSVGCoder - SDWebImageWebPCoder + - Turf - ZXingObjC EXTERNAL SOURCES: @@ -2600,6 +2644,8 @@ EXTERNAL SOURCES: :path: "../node_modules/expo-keep-awake/ios" ExpoLinking: :path: "../node_modules/expo-linking/ios" + ExpoLocation: + :path: "../node_modules/expo-location/ios" ExpoModulesCore: :path: "../node_modules/expo-modules-core" ExpoSplashScreen: @@ -2761,6 +2807,8 @@ EXTERNAL SOURCES: :path: "../node_modules/@react-native-community/datetimepicker" RNGestureHandler: :path: "../node_modules/react-native-gesture-handler" + rnmapbox-maps: + :path: "../node_modules/@rnmapbox/maps" RNReanimated: :path: "../node_modules/react-native-reanimated" RNScreens: @@ -2799,6 +2847,7 @@ SPEC CHECKSUMS: ExpoImagePicker: d251aab45a1b1857e4156fed88511b278b4eee1c ExpoKeepAwake: 1a2e820692e933c94a565ec3fbbe38ac31658ffe ExpoLinking: f051f28e50ea9269ff539317c166adec81d9342d + ExpoLocation: 93d7faa0c2adbd5a04686af0c1a61bc6ed3ee2f7 ExpoModulesCore: 9281d8f1cda9d0c37dbce34c26014212b22eb8c0 ExpoSplashScreen: 0634b705953e6934a5156397162eefc1ee5d6a7c ExpoSymbols: 1ae04ce686de719b9720453b988d8bc5bf776c68 @@ -2810,6 +2859,9 @@ SPEC CHECKSUMS: libavif: 84bbb62fb232c3018d6f1bab79beea87e35de7b7 libdav1d: 23581a4d8ec811ff171ed5e2e05cd27bad64c39f libwebp: 02b23773aedb6ff1fd38cec7a77b81414c6842a8 + MapboxCommon: 975faa94b893bb64a1d28b09d9d6d820e1030a26 + MapboxCoreMaps: 105af9894d850290fbb466e9f9a133f5d175abf1 + MapboxMaps: e97e59d6ba48bb6f695a4c1dc2f174cb24743cd4 RCTDeprecation: 7487d6dda857ccd4cb3dd6ecfccdc3170e85dcbc RCTRequired: 54128b7df8be566881d48c7234724a78cb9b6157 RCTTypeSafety: d2b07797a79e45d7b19e1cd2f53c79ab419fe217 @@ -2882,6 +2934,7 @@ SPEC CHECKSUMS: RNCAsyncStorage: 3a4f5e2777dae1688b781a487923a08569e27fe4 RNDateTimePicker: be0e44bcb9ed0607c7c5f47dbedd88cf091f6791 RNGestureHandler: 2914750df066d89bf9d8f48a10ad5f0051108ac3 + rnmapbox-maps: 3c20ce786a7991498445c32de4fe4244e32aa0ee RNReanimated: 8d3a14606ad49f022c17d9e12a2d339e9e5ad9b0 RNScreens: d8d6f1792f6e7ac12b0190d33d8d390efc0c1845 RNSVG: 31d6639663c249b7d5abc9728dde2041eb2a3c34 @@ -2891,9 +2944,10 @@ SPEC CHECKSUMS: SDWebImageAVIFCoder: 00310d246aab3232ce77f1d8f0076f8c4b021d90 SDWebImageSVGCoder: 15a300a97ec1c8ac958f009c02220ac0402e936c SDWebImageWebPCoder: e38c0a70396191361d60c092933e22c20d5b1380 + Turf: c9eb11a65d96af58cac523460fd40fec5061b081 Yoga: 051f086b5ccf465ff2ed38a2cf5a558ae01aaaa1 ZXingObjC: 8898711ab495761b2dbbdec76d90164a6d7e14c5 -PODFILE CHECKSUM: 08ec3cea5bbb38596b0b014c2569f7bd48b51230 +PODFILE CHECKSUM: 961e5122c387eef49538723a9e3e7a469ca4144f COCOAPODS: 1.16.2 diff --git a/package.json b/package.json index d75d616..4d0106a 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "@react-navigation/elements": "^2.3.8", "@react-navigation/native": "^7.1.6", "@react-navigation/native-stack": "^7.3.10", + "@rnmapbox/maps": "^10.2.7", "@types/lodash": "^4.17.20", "@types/react-native-vector-icons": "^6.4.18", "axios": "^1.11.0", @@ -36,6 +37,7 @@ "expo-image": "~3.0.8", "expo-image-picker": "~17.0.8", "expo-linking": "~8.0.8", + "expo-location": "~19.0.7", "expo-notifications": "^0.32.13", "expo-router": "~6.0.1", "expo-splash-screen": "~31.0.9", diff --git a/screens/Maps/MapsView.tsx b/screens/Maps/MapsView.tsx new file mode 100644 index 0000000..282d30c --- /dev/null +++ b/screens/Maps/MapsView.tsx @@ -0,0 +1,226 @@ +import { + ViewWrapper, + DrawerCustom, + DummyLandscapeImage, + Spacing, + StackCustom, + TextCustom, + Grid, + ButtonCustom, +} from "@/components"; +import GridTwoView from "@/components/_ShareComponent/GridTwoView"; +import API_IMAGE from "@/constants/api-storage"; +import { ICON_SIZE_SMALL } from "@/constants/constans-value"; +import { apiMapsGetAll } from "@/service/api-client/api-maps"; +import { openInDeviceMaps } from "@/utils/openInDeviceMaps"; +import { FontAwesome, Ionicons } from "@expo/vector-icons"; +import { Image } from "expo-image"; +import { useFocusEffect, router } from "expo-router"; +import { useState, useCallback } from "react"; +import { View } from "react-native"; +import MapView, { Marker } from "react-native-maps"; + +const defaultRegion = { + latitude: -8.737109, + longitude: 115.1756897, + latitudeDelta: 0.1, + longitudeDelta: 0.1, + height: 300, +}; + +export default function MapsView() { + const [list, setList] = useState(null); + const [loadList, setLoadList] = useState(false); + const [openDrawer, setOpenDrawer] = useState(false); + const [selected, setSelected] = useState({ + id: "", + bidangBisnis: "", + nomorTelepon: "", + alamatBisnis: "", + namePin: "", + imageId: "", + portofolioId: "", + latitude: 0, + longitude: 0, + }); + + useFocusEffect( + useCallback(() => { + handlerLoadList(); + }, []) + ); + + const handlerLoadList = async () => { + try { + setLoadList(true); + const response = await apiMapsGetAll(); + + if (response.success) { + setList(response.data); + } + } catch (error) { + console.log("[ERROR]", error); + } finally { + setLoadList(false); + } + }; + + return ( + <> + + {/* */} + + {loadList ? ( + + ) : ( + + {list?.map((item: any, index: number) => { + return ( + { + setOpenDrawer(true); + setSelected({ + id: item?.id, + bidangBisnis: + item?.Portofolio?.MasterBidangBisnis?.name, + nomorTelepon: item?.Portofolio?.tlpn, + alamatBisnis: item?.Portofolio?.alamatKantor, + namePin: item?.namePin, + imageId: item?.imageId, + portofolioId: item?.Portofolio?.id, + latitude: item?.latitude, + longitude: item?.longitude, + }); + }} + // Gunakan gambar kustom jika tersedia + > + + + + + ); + })} + + )} + + + + setOpenDrawer(false)} + height={"auto"} + > + + + + + } + rightIcon={{selected.namePin}} + /> + + + } + rightIcon={{selected.bidangBisnis}} + /> + + + } + rightIcon={{selected.nomorTelepon}} + /> + + } + rightIcon={{selected.alamatBisnis}} + /> + + + + { + setOpenDrawer(false); + router.push(`/portofolio/${selected.portofolioId}`); + }} + > + Detail + + + + { + openInDeviceMaps({ + latitude: selected.latitude, + longitude: selected.longitude, + title: selected.namePin, + }); + }} + > + Buka Maps + + + + + + + ); +} diff --git a/screens/Maps/MapsView2.tsx b/screens/Maps/MapsView2.tsx new file mode 100644 index 0000000..3bd9e9a --- /dev/null +++ b/screens/Maps/MapsView2.tsx @@ -0,0 +1,28 @@ +import { TextCustom, ViewWrapper } from "@/components"; +import Mapbox from "@rnmapbox/maps"; +import { View } from "react-native"; + +// Nonaktifkan telemetry (opsional, untuk privasi) +Mapbox.setTelemetryEnabled(false); + +// Gunakan style OSM gratis +const MAP_STYLE_URL = "https://tiles.stadiamaps.com/styles/osm_bright.json"; + +// Atau gunakan MapLibre default: +// const MAP_STYLE_URL = 'https://demotiles.maplibre.org/style.json'; +export default function MapsView2() { + return ( + <> + + + + + + + + + ); +}