|
1 | | -# Map Explorer |
| 1 | +# Mini Moving Map |
2 | 2 |
|
3 | 3 | A minimalist Google Maps application with AI-powered landmark discovery and 3D exploration experience. |
4 | 4 |
|
5 | 5 | ## Features |
6 | 6 |
|
| 7 | +- **Moving Map**: MSFS (Microsoft Flight Simulator) integration for aircraft marker tracking effect |
7 | 8 | - **Landmark Discovery**: Google Places nearby search + OpenAI landmark query + Wikipedia images |
8 | 9 | - **Location Search**: Google Places text search + OpenAI location query + User Geolocation |
9 | | -- **Photorealistic 3D Maps**: Google Earth style 3D navigation + Cinematic flyover for each landmarks |
10 | | -- **World ready**: LLM content and auto-update UI translation follows browser language setting |
11 | | -- **Moving Map**: MSFS (Microsoft Flight Simulator) integration for aircraft marker tracking effect |
| 10 | +- **Photorealistic 3D Maps**: Google Earth-style 3D navigation + Cinematic flyovers for each landmarks |
| 11 | +- **World ready**: Automatically adapts LLM content and UI translation to browser's language setting |
12 | 12 |
|
13 | 13 | ### Technical Highlights |
14 | 14 |
|
15 | 15 | - **Frontend:** Map integration, landmark visualization, location navigation, browser-side caching and test runner |
16 | 16 | - **Backend:** Flask API connecting to MSFS via SimConnect proxy to fetch real-time aircraft telemetry |
17 | | -- **LLM:** OpenAI selects landmarks from Google Places search results, generates descriptions, look up Wiki images, and adapts language based on location's country. |
18 | | -- **Caching:** Proximity-based keys with coordinate rounding + location matching + search radius + TTL expiration |
19 | | -- **Multi-Sources:** Google Places API (nearby search) + Wikipedia API (images) + OpenAI API (landmark info) |
20 | | -- **User interaction:** location geocoding → multi-tier cache lookup → landmark discovery (Google Places + OpenAI) → multi-pass searches |
21 | | -- **Auto Translation:** Support JSON resource, string changes detection, local TM, secondary locale for multi-lingual users |
| 17 | +- **LLM:** OpenAI selects landmarks from Google results, generates descriptions, adapts language to location |
| 18 | +- **Caching:** Proximity-based keys with coordinate rounding + location matching + TTL expiration |
| 19 | +- **Auto Translation:** Support JSON resource, string changes detection, local TM (Translation Memory), secondary locale for multi-lingual users |
22 | 20 | - **Configuration:** Map defaults, test mode mock data on `config.json`, LLM prompt templates on `prompts.js` |
23 | 21 |
|
24 | 22 | ### External Services |
25 | 23 |
|
26 | 24 | - **Google Maps API**: Core mapping functionality with 3D support |
27 | 25 | - **Google Places API**: Location search and nearby places discovery |
28 | 26 | - **OpenAI API**: LLM generated translations and landmark information |
29 | | -- **Wikipedia API**: Landmark and location images |
| 27 | +- **Wikipedia API**: Landmark and location photos |
30 | 28 |
|
31 | 29 | ### Vanilla JavaScript Frontend with Vite |
| 30 | + |
32 | 31 | ``` |
33 | 32 | src/ |
34 | 33 | ├── app.js # Init Google Maps application |
|
44 | 43 | └── test_runner.js # Client-side testing |
45 | 44 | ``` |
46 | 45 |
|
47 | | -## Get Started |
| 46 | +## Getting Started |
48 | 47 |
|
49 | | -1. **Install prerequisites** |
50 | | - - Install Node.js (https://nodejs.org/). |
51 | | - - Clone this repository and install dependencies (see `package.json`) |
| 48 | +**Prerequisites** |
| 49 | + |
| 50 | +- Install Node.js (https://nodejs.org/). |
| 51 | +- Clone this repository and install dependencies (see `package.json`) |
52 | 52 |
|
53 | 53 | ```bash |
54 | 54 | git clone <repository-url> |
55 | 55 | cd <my-project> |
56 | 56 | npm install |
57 | 57 | ``` |
58 | 58 |
|
59 | | -2. **Create environment file** |
| 59 | +**Create environment file** |
60 | 60 |
|
61 | | - Create your own `.env` file and add your API keys for local development. Vite exposes variables prefixed with `VITE_` to the browser app via `index.html`. |
| 61 | +Create your own `.env` file and add your API keys for local development. Vite exposes variables prefixed with `VITE_` to the browser app via `index.html`. |
62 | 62 |
|
63 | 63 | ```bash |
64 | 64 | VITE_GOOGLE_MAPS_API_KEY=your_google_maps_api_key |
65 | 65 | VITE_OPENAI_API_KEY=your_openai_api_key |
66 | 66 | ``` |
67 | 67 |
|
68 | | -3. **Generate API keys** |
| 68 | +### "Bring your own key" approach |
| 69 | + |
| 70 | +As an open-source project targeting technical users, this application is designed to run on user's keys. The user is responsible for: |
| 71 | + |
| 72 | +1. Creating their own Google Cloud project and API key (required). |
| 73 | +2. Securing their key by restricting it to their own domains (`localhost` for testing, their deployment domain for production). |
| 74 | +3. The costs associated with their usage. |
69 | 75 |
|
70 | | - - **Google Maps API Key** |
71 | | - 1. Visit the [Google Cloud Console](https://console.cloud.google.com/). |
72 | | - 2. Create or select a project. |
73 | | - 3. Enable “Maps JavaScript API” and “Places API (New)” in the API library. |
74 | | - 4. Create an API key under **APIs & Services → Credentials**. |
75 | | - 5. For local development restrict referrers to `localhost`. |
| 76 | +**Generate API keys** |
76 | 77 |
|
77 | | - - **OpenAI API Key** |
78 | | - 1. Visit the [OpenAI dashboard](https://platform.openai.com/account/api-keys). |
79 | | - 2. Create a new secret key and copy it for later use; it won't be shown again. |
| 78 | +- **Google Maps API Key** |
80 | 79 |
|
81 | | -4. **Start the development server** |
| 80 | + 1. Visit the [Google Cloud Console](https://console.cloud.google.com/) → Create or select a project → Go to [Google Maps Platform](https://console.cloud.google.com/google/maps-apis) ([See Also](https://developers.google.com/maps/documentation/javascript/get-api-key)). |
| 81 | + 2. Enable “Map Tiles API”, “Maps JavaScript API”, “Geocoding API” and “Places API (New)” under **APIs & Services**. |
| 82 | + 3. Create an API key under **Keys & Credentials**. For local development restrict **HTTP referrer** to `localhost`. |
| 83 | + |
| 84 | +- **OpenAI API Key** |
| 85 | + 1. Visit the [OpenAI dashboard](https://platform.openai.com/api-keys). |
| 86 | + 2. Create a new secret key and copy it for later use; it won't be shown again. |
| 87 | + |
| 88 | +**Start the development server** |
82 | 89 |
|
83 | 90 | ```bash |
84 | 91 | npm run dev |
85 | 92 | ``` |
86 | 93 |
|
87 | | -5. **Enter API keys in the app** |
| 94 | +**Enter API keys in the app** |
| 95 | + |
| 96 | +- Open `http://localhost:5001` in your browser. |
| 97 | +- Click the gear icon (**⚙️ Settings UI**) in the bottom‑left corner. |
| 98 | +- Fill in `GOOGLE_MAPS_API_KEY` and `OPENAI_API_KEY`, then close to save. |
| 99 | +- Settings are stored in `localStorage` under `APP_SETTINGS`. |
| 100 | +- In Chrome, view them under DevTools → Application → Local Storage; landmark caches use keys starting with `landmark_`. |
88 | 101 |
|
89 | | - - Open `http://localhost:5173` in your browser. |
90 | | - - Click the gear icon (**⚙️ Settings**) in the bottom‑left corner. |
91 | | - - Fill in `GOOGLE_MAPS_API_KEY` and `OPENAI_API_KEY`, then close to save. |
92 | | - - Settings are stored in `localStorage` under `APP_SETTINGS`; landmark caches use keys starting with `landmark_`. |
93 | | - - In Chrome, view them under DevTools → Application → Local Storage. |
| 102 | +**Start server proxy for MSFS "moving map** |
94 | 103 |
|
95 | | -6. **Start server proxy for MSFS "moving map** |
| 104 | +- Install Python with UV and dependencies (see `pyproject.toml`) |
96 | 105 |
|
97 | 106 | ```bash |
| 107 | +uv pip install . |
98 | 108 | python server.py |
99 | 109 | ``` |
100 | 110 |
|
101 | 111 | ## Usage |
102 | 112 |
|
103 | | -- Pan and zoom the Google map. Use the **🔍 search box** to jump to a city or location. |
104 | | -- Click **🏛️ Landmarks** to fetch nearby points of interest around the map center. |
105 | | -- Select a landmark card to read the AI-generated description and see a photo. |
106 | | -- For 3D views, click **[3D]** in the card to explore a photorealistic flyover. |
107 | | -- Use **📍 My Location** to center the map on your current position. |
| 113 | +- Pan and zoom the Google map. Use **🔍 Location Search** to search a city or place. |
| 114 | +- Click **🏛️ Landmarks** to discover nearby points of interest around the map center. |
| 115 | +- Select a landmark card to read the AI-generated description and see a Wiki photo. |
| 116 | +- Click **[3D]** on landmark cards to explore with a photorealistic 3D map view. |
| 117 | +- Use **📍 My Location** to center the map at current geolocation per browser detection. |
108 | 118 | - Open the gear icon (**⚙️ Settings**) to update API keys or clear stored values. |
109 | | -- Click **🌐 Locale** to toggle preferred locales per browser language setting. |
110 | | -- When connected to MSFS, click **aircraft ✈️** icon to sync aircraft position. |
| 119 | +- Use **🌐 Locale** to toggle between multiple preferred locales per browser setting. |
| 120 | +- Click **aircraft ✈️** icon to sync aircraft position when connected to MSFS. |
111 | 121 |
|
112 | 122 | ### Testing |
113 | 123 |
|
114 | 124 | - Frontend Test Runner - standalone test script running direct function testing |
115 | 125 | - Built-in test mode with mock data from config.json, skipping API calls |
116 | 126 | - Runnable on both browser console and Node.js CLI via `npm test` |
117 | | -- Append `?test=true` to the URL to run tests on-browser |
118 | | - |
119 | | -### MIT License - see [LICENSE](LICENSE) for details. |
120 | | - |
121 | | -Please respect Google Maps and OpenAI terms of service. |
| 127 | +- Append `?test=true` to the URL to auto-run tests on-browser |
0 commit comments