filament-google-maps icon indicating copy to clipboard operation
filament-google-maps copied to clipboard

Widget - change markers without refresh map

Open jcesarbueno opened this issue 9 months ago • 2 comments

Hi,

How can I change the markers on the map widget without refreshing the whole map?

jcesarbueno avatar May 13 '24 13:05 jcesarbueno

Having the same issue here, @jcesarbueno did you find a solution?

abdallahisham avatar Jul 10 '24 10:07 abdallahisham

Any update here?

mikestmike avatar Sep 11 '24 12:09 mikestmike

Any Update on this?

I too am stuck with this Issue.

kingmaker-agm avatar Oct 04 '24 09:10 kingmaker-agm

I moved to advanced markers in a livewire component https://console.cloud.google.com/google/maps-hosted/discover/complex-markers?project=trim-odyssey-419813&pli=1

mikestmike avatar Oct 04 '24 09:10 mikestmike

@mikestmike Can you help us out by sharing the code?

kingmaker-agm avatar Oct 04 '24 09:10 kingmaker-agm

In the class i have a method that fetches locations based on dates whereBetween

View:

<div>
    <div class="w-full">
        <gmp-map center="{{ $mapCenter }}" zoom="10" map-id="sessions" style="height: 350px;">
            @foreach ($locations as $location)
                <gmp-advanced-marker position="{{ $location['latitude'] }}, {{ $location['longitude'] }}"
                    title="{{$location->name}}"></gmp-advanced-marker>
            @endforeach
        </gmp-map>
    </div>
</div>


@push('scripts')
    <script
        src="https://maps.googleapis.com/maps/api/js?key={{ env('GOOGLE_MAPS_API_KEY') }}&loading=async&libraries=marker&v=beta&solution_channel=GMP_CCS_complexmarkers_v3"
        defer></script>
        <style >
            gmp-advanced-marker {
                touch-action: none; 
                position: absolute; 
                left: 0px; 
                pointer-events: none; 
                transform: translate(-50%, -100%) translate(0px, 0px); 
                will-change: transform;
            }
        </style>
@endpush

mikestmike avatar Oct 04 '24 09:10 mikestmike