+ {/* Right Image (Google Satellite) */}
+

+
+ {/* Left Image (Mapbox) */}
+
+
+

+
+
+
+ {/* Slider Handle */}
+
+
+ {/* Labels */}
+
+ MAPBOX
+
+
+ GOOGLE SATELLITE
+
+
+ )
+}
diff --git a/components/header-search-button.tsx b/components/header-search-button.tsx
index 69fda09a..1923e596 100644
--- a/components/header-search-button.tsx
+++ b/components/header-search-button.tsx
@@ -9,9 +9,10 @@ import { useActions, useUIState } from 'ai/rsc'
import { AI } from '@/app/actions'
import { nanoid } from 'nanoid'
import { UserMessage } from './user-message'
-import { toast } from 'react-toastify'
+import { toast } from 'sonner'
import { useSettingsStore } from '@/lib/store/settings'
import { useMapData } from './map/map-data-context'
+import { compressImage } from '@/lib/utils/image-utils'
// Define an interface for the actions to help TypeScript during build
interface HeaderActions {
@@ -48,7 +49,7 @@ export function HeaderSearchButton() {
setIsAnalyzing(true)
try {
- setMessages(currentMessages => [
+ setMessages((currentMessages: any[]) => [
...currentMessages,
{
id: nanoid(),
@@ -56,13 +57,42 @@ export function HeaderSearchButton() {
}
])
- let blob: Blob | null = null;
+ let mapboxBlob: Blob | null = null;
+ let googleBlob: Blob | null = null;
- if (mapProvider === 'mapbox') {
- const canvas = map!.getCanvas()
- blob = await new Promise