# Google Maps Coordinate Extraction Guide

## Overview
Sistem ini memiliki fitur untuk mengekstrak koordinat latitude dan longitude dari Google Maps share link atau input koordinat manual.

## Cara Penggunaan

### Method 1: Menggunakan Google Maps Share Link (Full URL)
1. Buka Google Maps di browser
2. Cari lokasi yang diinginkan
3. Klik kanan pada marker/lokasi
4. Pilih "Share" atau copy URL dari address bar
5. URL yang bekerja:
   - `https://www.google.com/maps/place/.../@lat,lng,15z/...`
   - `https://maps.google.com/?q=lat,lng`
6. Paste URL ke field "Google Maps Link"
7. Klik tombol "Extract"
8. Koordinat akan otomatis terisi di field Latitude & Longitude

### Method 2: Menggunakan Shortened Link (maps.app.goo.gl)
Google Maps shortened links (`https://maps.app.goo.gl/...`) sekarang bisa di-handle otomatis oleh sistem:

**Automatic (Recommended):**
1. Paste shortened link: `https://maps.app.goo.gl/Mnjjpkh5pGsLZAQV6`
2. Klik tombol "Extract"
3. Sistem akan otomatis expand link dan extract koordinat
4. ✓ Koordinat akan langsung terisi!

**Jika automatic tidak berhasil:**
1. Klik link shortened Google Maps untuk membuka Google Maps
2. Copy URL baru dari address bar (akan berubah menjadi full URL)
3. Paste URL baru ke field "Google Maps Link"
4. Klik tombol "Extract"

**Alternatif manual (jika above tidak berhasil):**
1. Klik link shortened Google Maps
2. Di Google Maps, right-click pada marker
3. Copy koordinat yang ditampilkan (format: `-6.1234, 106.5678`)
4. Paste ke field "Google Maps Link"
5. Klik tombol "Extract"

### Method 3: Input Koordinat Manual
Jika sudah memiliki koordinat:
1. Paste atau ketik koordinat dalam format: `-6.1234,106.5678` (atau `-6.1234, 106.5678`)
2. Klik tombol "Extract"
3. Sistem akan validasi dan mengisi field Latitude & Longitude

## Format Koordinat

### Format yang Diterima:
- `-6.1234,106.5678` (tanpa spasi)
- `-6.1234, 106.5678` (dengan spasi)

### Validasi:
- **Latitude**: harus antara -90 hingga 90
- **Longitude**: harus antara -180 hingga 180

## Contoh Penggunaan

### Contoh 1: Full Google Maps URL
```
Input: https://www.google.com/maps/place/Jakarta/@-6.2088,106.8456,15z/
Output:
- Latitude: -6.2088
- Longitude: 106.8456
```

### Contoh 2: Koordinat Manual
```
Input: -6.2088,106.8456
Output:
- Latitude: -6.2088
- Longitude: 106.8456
```

### Contoh 3: Shortened Link (Otomatis)
```
Input: https://maps.app.goo.gl/YMpNZGBkB76JTwdU7
Sistem akan otomatis:
1. Expand link
2. Extract koordinat dari expanded URL
3. Mengisi field Latitude & Longitude

Output:
- Latitude: -6.xxxx
- Longitude: 106.xxxx
```

## Catatan Penting

1. **Latitude selalu negatif untuk lokasi di belahan selatan** (Indonesia, Australia, dll)
   - Jakarta: -6.xxxx (bukan +6.xxxx)

2. **Longitude untuk Indonesia**: 95-141 derajat timur
   - Jakarta: 106.xxxx

3. **Field Latitude & Longitude opsional** - Anda bisa mengosongkannya jika tidak ada data lokasi

4. **Perubahan field tidak otomatis** - Jika mengubah nilai manual, extract akan menimpa nilai yang ada

## Troubleshooting

### "Invalid format" Error
- Pastikan format koordinat: `lat,lng` (dengan koma)
- Contoh benar: `-6.1234,106.5678`
- Contoh salah: `-6.1234;106.5678`, `-6.1234 106.5678`

### "Invalid coordinates" Error
- Latitude harus -90 sampai 90
- Longitude harus -180 sampai 180
- Periksa urutan: **Latitude HARUS DI DEPAN, Longitude DI BELAKANG**

### Tidak bisa extract dari shortened link
- Gunakan full Google Maps URL dari address bar browser
- Atau copy koordinat manual dari Google Maps

## Tips

1. **Untuk akurasi maksimal**: Gunakan full Google Maps URL dari browser address bar
2. **Koordinat dari Google Maps**: Right-click marker → copy koordinat yang ditampilkan
3. **Multiple locations**: Buat company terpisah untuk setiap lokasi

