nova-map-marker-field icon indicating copy to clipboard operation
nova-map-marker-field copied to clipboard

Google search provider does not work

Open schrink opened this issue 3 years ago • 2 comments

Describe the bug When I set Google as a provider, it does not change. API key is good and working in the other parts of applicaiton

To Reproduce Steps to reproduce the behavior:

            MapMarker::make("Location")
                ->defaultZoom(18)
                ->searchProvider('google')
                ->searchProviderKey(env('GOOGLE_MAPS_GEOCODING_API_KEY')),

Expected behavior It should use Google Geocoding API.

Screenshots DevTools_-ourbeloved_cy_admin_resources_churches_604_edit_and_New_Issue·_GeneaLabs_nova-map-marker-field

Environment:

  • Laravel Version: 8.34.0
  • PHP Version: 8.0.3
  • Package Version: 0.3.1

schrink avatar Apr 03 '21 12:04 schrink

Issue seem to be here in line # 71 on FormField: Previously:
` const providerOptions = {};

        if (typeof this.field.searchProviderKey !== 'undefined') {
            providerOptions.params.key = this.field.searchProviderKey;
        }`

I changed it to:

const providerOptions = {params: {key: null}};

But there are other issues are there after this. This happens after clicking the suggestion second time:

nova-map-marker-field:28379 Uncaught (in promise) TypeError: Cannot create property '_leaflet_id' on string '85' at stamp (nova-map-marker-field:28379) at NewClass.getLayerId (nova-map-marker-field:35194) at NewClass.hasLayer (nova-map-marker-field:35120) at NewClass.removeLayer (nova-map-marker-field:35244) at NewClass.showResult (nova-map-marker-field:27414) at NewClass.<anonymous> (nova-map-marker-field:27401) at eval (eval at processIncludes (nova-map-marker-field:1), <anonymous>:3:4725)

iSaadSalman avatar Apr 20 '21 09:04 iSaadSalman

...same here: "Cannot create property '_leaflet_id' on string '85' at stamp"... the first time you select an address it works, then this js error appears, no matter which search provider is used.

nilsE avatar May 10 '21 11:05 nilsE