mikebronner / nova-map-marker-field

Provides an visual interface for editing latitude and longitude coordinates.
MIT License
131 stars 36 forks source link

Map doesn't refresh on second search try. #52

Open marcoguidara opened 3 years ago

marcoguidara commented 3 years ago

Describe the bug When I submit a search into map search bar, the first time the map gets refreshed. If I submit another search without clearing the bar with the "x button", the map doesn't get refreshed.

To Reproduce Steps to reproduce the behavior:

  1. Go to Nova Edit resource form.
  2. Click on map search bar
  3. Fill the search bar and press return
  4. Wait for map refresh
  5. Change some data into search bar and press return
  6. Map doesn't refresh.

Expected behavior Map should refresh after every search submit

Screenshots If applicable, add screenshots to help explain your problem.

Environment:

Additional context Add any other context about the problem here.

mikebronner commented 3 years ago

@marcoguidara I believe this is probably a bug with the underlying mapping engine, leaflet. I'll keep this issue open and investigate it when I am able. I'll be happy to review any PRs, if you can send one.

marcoguidara commented 3 years ago

Thank you for your prompt reply. Sadly, I can't set up a PR on the project I'm using the package.

If may help, this is the way I'm using the field now:

<?php

namespace App\Nova\Traits;

use GeneaLabs\NovaMapMarkerField\MapMarker;
...

trait HasLocation
{
    public function getLocationFieldsAll()
    {
        return $this->merge([

            MapMarker::make('Posizione')
                ->searchProvider('openstreetmap')
                ->searchLabel('Inserire indirizzo/Coordinate')
                ->hideFromIndex(),
        ]);
    }
}
mrigo commented 3 years ago

Hi, any news about this? I have the same problem... Thanks!

keizah7 commented 2 years ago

image