dotswan / filament-map-picker

Map Picker is a Filament custom field designed to simplify the process of choosing a location on a map and obtaining its geo-coordinates.
MIT License
32 stars 10 forks source link

Map not working after Update from V1.0 #23

Closed octaviogamero27 closed 4 days ago

octaviogamero27 commented 4 weeks ago

imagen

The map in form is not displayed. It does not obtain the location in real time, and it does not load the map

Please Help Thanks

mohaphez commented 4 weeks ago

Hi @octaviogamero27

Can you share your code ? Are you see any error inside console.log ? Are you use spa mode ?

Also mention the exact version of Laravel, Filament and package please

If you answer these questions, I can help you better

octaviogamero27 commented 4 weeks ago

Thanks for Answer me SPA mode is disabled, and console.log doesnt have errors

imagen

Laravel Version 10, Filament V3.2.86 Package V1.2.4

mohaphez commented 4 weeks ago

I rewrote your code exactly in my project. But the map loads correctly. I even put it in a filament repeater and everything was fine again.

Did this happen to you after the package update?

You can enter the following commands and test again.

php artisan optimize:clear
php artisan cache:clear
php artisan filament:assets
octaviogamero27 commented 4 weeks ago

imagen

Hi @mohaphez yes its happen after update the package!!

I've tried the commands but It doesnt work yet!! I tried delete vendor folders and then run composer install and update, but still It doesnt work.

Only infolists working good!!

mohaphez commented 4 weeks ago

Ok, I found that your code works and displays correctly with the repeater for create.

But I encountered a problem in the edit mode.

And the reason is that I did not have a one-to-many relationship for the location and the primary variables were not correctly referenced to the field.

Can you test the field outside the repeater or put it in another resource?

For use with repeaters, make sure the values ​​are correctly referenced in the map field.

octaviogamero27 commented 4 weeks ago

imagen

It has been working great, It was after update the package, I didnt change anything in the code, Just Update composer I tried in another resource but still Its doesnt work yet

mohaphez commented 4 weeks ago

I really have no idea anymore for now,

Can you downgrade the package to version 1.2.2 and test it ?

octaviogamero27 commented 4 weeks ago

imagen

I´ve downgraded to V1.0 the others new versions dont work, But its works with v1.0.0 but I need the infolist functionality

mohaphez commented 4 weeks ago

It is strange .

The difference between these two versions is that from version 1.1.1 onwards, apline.js is used instead of raw JavaScript (window.mapPicker).

I will definitely look into this.

Just are you sure you don't have any errors in the console, yes ?

And one more question, do you install and use any other package or library related to leaflet or map in your project other than this package?

octaviogamero27 commented 4 weeks ago

I tried everything that its on my own, On console log dont have errors Which Filament version do I need?

I dont have another related plugin only this one

octaviogamero27 commented 4 weeks ago

<div x-data="async () => { do { await (new Promise(resolve => setTimeout(resolve, 100))); } while (window.mapPicker === undefined); const m = mapPicker($wire, {{ $getMapConfig()}}); m.attach($refs.map); }" wire:ignore> <div x-ref="map" class="w-full" style="min-height: 50vh; z-index: 1 !important;"> </div> </div>

@mohaphez On osm-map-entry.blade.php file has an error, It doesnt have wire:init method, you have put the init functionality on wire:data, otherwise the map doesnt load on first component inits.

mohaphez commented 5 days ago

Hello @octaviogamero27 ,

Can you please update your package to version 1.2.5 and confirm that the issue has been resolved?

octaviogamero27 commented 4 days ago

Hi @mohaphez

The bug has fixed with the update v1.2.5

Thanks a lot of!

One idea suggest, could you please add support for several points on map?