Shops on the Map: Geo-Locations, Type Colors & Nearby Search

NEW

Player shops now appear as colored pins on the 2D world map. Each shop has a geographic location and a type — so you can see at a glance where hardware stores, food shops, fitness studios, and other businesses are around the world.

Even better: you can now search for shops near your location by radius. Looking for a gym within 50 km? Just type the distance, pick a category, and hit search.

Shop Types & Colors

Every shop owner picks a type when creating or editing their shop. Each type has its own color and icon on the map:

🔧 Hardware
🍎 Food
🛠️ Services
💾 Digital
👕 Clothing
🎨 Art
💪 Fitness
📚 Education
💼 Consulting
📍 Other
◆ General

Map Pins

When you open the world map, shops with a set location appear as colored pins. Hover over a pin to see:

  • Shop name and type
  • Short description
  • Currency (CC or KC)
  • Number of products

Click a pin to jump directly to that shop and browse its products.

The pins use the same geoNaturalEarth1 projection as the pre-rendered country shapes, so they align perfectly with the map. They scale automatically when you zoom in or out.

In the shop overlay, you’ll find a new ”📍 Near me” search bar:

  1. Pick a category — e.g., Fitness, Food, Hardware, or “All types”
  2. Set the radius — in kilometers (default: 50 km)
  3. Click Search — the system finds all shops of that type within your radius

The search uses your home country location by default. If your browser supports geolocation, you can also use your real GPS position for more precise results.

Results show each shop’s name, type, currency, product count, and distance in kilometers. Click a result to switch to that shop instantly.

Behind the scenes, the search uses the Haversine formula — the same great-circle distance calculation used in navigation — to compute precise distances between your location and every geo-located shop.

For Shop Owners

If you own a shop, you can now set your location and shop type:

  1. Open My Shop in the shop overlay
  2. Click on your shop to see the detail view
  3. Click ”📍 Set Location” (or “Update Location” if you already have one)
  4. Click on the mini-map to set your shop’s position
  5. Pick a shop type from the color-coded selector
  6. Click Save

Your shop will immediately appear as a colored pin on the world map, and other players can find you via nearby search.

You can also set location and type during shop creation — the form now includes both fields.

How It Works Under the Hood

🌍 Geo-Coordinates in the Database
The shop_channels table now stores lat, lng, and shop_type columns. The migration runs automatically on server startup — no manual database changes needed.

📡 Two New API Endpoints
GET /shop/map-pins returns all active shops with geo coordinates for map rendering. GET /shop/nearby?lat=&lng=&radius_km=&category= performs the radius search with a bounding-box pre-filter and precise Haversine distance calculation.

🗺️ Projection Matching
The 2D map uses pre-rendered SVG paths from a geoNaturalEarth1 projection. Shop pins use the same projection at runtime to convert lat/lng to SVG coordinates, ensuring perfect alignment with country borders.

What’s Next

This release adds the foundation for geo-aware commerce in ENLIGHTENMENT. Future improvements include:

  • Shop clusters at high zoom levels (group nearby pins)
  • Route planning — see how to travel to a physical shop
  • Shop reviews & ratings
  • Featured shops on the map
  • Region-based shop directories

ENLIGHTENMENT is a blockchain-based game of personal growth, archetypal exploration, and collective resonance. Join us at getplasma.org.