# Pyrk OpenStreetMap + Leaflet setup

This version lets you test route maps without Google Cloud, billing, or API keys.

## What it uses

- Leaflet.js for the interactive browser map.
- OpenStreetMap public tiles for the map background.
- Pyrk manual route calculation by default: it connects the points you click and estimates distance between them.
- Optional OSRM demo routing can be enabled for experiments, but it is not recommended for production traffic.

## Quick start

1. Copy `config/app.example.php` to `config/app.php`.
2. Keep this setting:

```php
'maps' => [
    'provider' => 'osm',
]
```

3. Open:

```text
http://localhost/pyrk_walking_club_full_starter/public/login-dev.php
```

4. Login as admin:

```text
admin@pyrk.local
password
```

5. Go to:

```text
Admin → Routes
```

6. Add start, checkpoints, and finish points.
7. Click **Calculate route**.
8. Click **Save route**.

## Optional: try OSRM demo routing

In `config/app.php` set:

```php
'maps' => [
    'provider' => 'osm',
    'osm' => [
        'use_osrm_demo' => true,
        'osrm_url' => 'https://router.project-osrm.org',
        'osrm_profile' => 'foot',
    ],
]
```

Notes:

- This may fail or be unavailable because it is a public demo service.
- Do not use the OSRM demo server for production traffic.
- For production, use Google Routes API, a commercial routing provider, or your own OSRM server.

## Returning to Google Maps later

Change this:

```php
'maps' => [
    'provider' => 'google',
]
```

Then add your Google keys:

```php
'google' => [
    'maps_browser_key' => 'YOUR_BROWSER_KEY',
    'routes_server_key' => 'YOUR_ROUTES_KEY',
]
```
