nova-map-marker-field
nova-map-marker-field copied to clipboard
Google search provider does not work
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
Environment:
- Laravel Version: 8.34.0
- PHP Version: 8.0.3
- Package Version: 0.3.1
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)
...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.