DEMO SITE v1.7.32

OpenStreetMapNEW
1.7.32
Tailwind CSS theme

The point field can now use OpenStreetMap (via Leaflet) instead of Google Maps - free, no API key. Set Xcrud_config::$map_provider = 'osm'; everything else about the field (search box, draggable marker, click-to-place) stays the same.

HIDE CODE
<?php
    $xcrud = Xcrud::get_instance();

    // Switch the 'point' field type to OpenStreetMap (via Leaflet) instead of
    // Google Maps. No API key needed - this is the only line a developer has
    // to add to an existing point-field setup to switch providers.
    Xcrud_config::$map_provider = 'osm';

    $xcrud->table('base_fields');
    $xcrud->fields("text,point");
    $xcrud->label("text", "Location name");
    $xcrud->change_type("point", "point", "", array(
        "text" => "Selected location",
        "search_text" => "Search address (OpenStreetMap / Nominatim)",
        "zoom" => 5,
        "search" => true,
    ));
    $xcrud->fields_arrange("text,point", "Location", true);

    echo $xcrud->render('create');
?>

Base Fields - Add