<?php

/**
 * Map Editor Plugin for Kirby CMS
 *
 * Interactive map editor with MapLibre GL JS for creating
 * print-ready maps with markers and rich content.
 */

Kirby::plugin('geoproject/map-editor', [
    'fields' => [
        'map-editor' => [
            'props' => [
                'defaultCenter' => function ($defaultCenter = [43.836699, 4.360054]) {
                    return $defaultCenter;
                },
                'defaultZoom' => function ($defaultZoom = 13) {
                    return $defaultZoom;
                },
                'maxMarkers' => function ($maxMarkers = 50) {
                    return $maxMarkers;
                },
                'mode' => function ($mode = 'multi') {
                    return $mode;
                },
                'latitude' => function ($latitude = null) {
                    return $latitude;
                },
                'longitude' => function ($longitude = null) {
                    return $longitude;
                }
            ]
        ]
    ],
    'api' => [
        'routes' => require __DIR__ . '/api/routes.php'
    ]
]);
