28 lines
1.3 KiB
PHP
28 lines
1.3 KiB
PHP
{{--
|
|
Optional OpenStreetMap picker for address fields.
|
|
|
|
@param string $map_id Unique DOM id for the map container
|
|
@param string $address_selector CSS selector of the address input/textarea to fill
|
|
@param string|null $position_field_id Existing hidden field id for "lat,lng" (e.g. position on contacts)
|
|
@param string|null $position_value Initial position value
|
|
--}}
|
|
@php
|
|
$map_id = $map_id ?? 'osm_map_' . \Illuminate\Support\Str::random(8);
|
|
$address_selector = $address_selector ?? null;
|
|
$position_field_id = $position_field_id ?? null;
|
|
$position_value = $position_value ?? '';
|
|
$fill_address = $fill_address ?? true;
|
|
@endphp
|
|
@include('partials.osm_address_map_assets')
|
|
<div class="osm-address-map-wrapper"
|
|
data-map-id="{{ $map_id }}"
|
|
data-address-selector="{{ $address_selector }}"
|
|
data-position-field="{{ $position_field_id ? '#'.$position_field_id : '' }}"
|
|
data-fill-address="{{ $fill_address ? '1' : '0' }}">
|
|
<button type="button" class="btn btn-sm btn-default osm-map-toggle tw-mb-2">
|
|
<i class="fa fa-map-marker"></i> @lang('lang_v1.select_on_map')
|
|
<small class="text-muted">(@lang('lang_v1.optional'))</small>
|
|
</button>
|
|
<div class="osm-map-container" id="{{ $map_id }}" style="display:none;"></div>
|
|
</div>
|