Skip to content
This repository has been archived by the owner on Oct 17, 2022. It is now read-only.

Commit

Permalink
Merge pull request #39 from Orclyx/master
Browse files Browse the repository at this point in the history
Pass searchProviderKey to provider if set
  • Loading branch information
mikebronner authored Jul 24, 2020
2 parents 5914e08 + 4d19ca1 commit 4c5c5bf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dist/js/field.js

Large diffs are not rendered by default.

16 changes: 11 additions & 5 deletions resources/js/components/FormField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,22 +65,28 @@
iconUrl: this.icon,
shadowUrl: this.shadow,
});
const providerOptions = {};
if (typeof this.field.searchProviderKey !== 'undefined') {
providerOptions.params.key = this.field.searchProviderKey;
}
switch (this.field.searchProvider) {
case "bing":
this.geosearchOptions.provider = new BingProvider();
this.geosearchOptions.provider = new BingProvider(providerOptions);
break;
case "google":
this.geosearchOptions.provider = new GoogleProvider();
this.geosearchOptions.provider = new GoogleProvider(providerOptions);
break;
case "locationiq":
this.geosearchOptions.provider = new LocationIQProvider();
this.geosearchOptions.provider = new LocationIQProvider(providerOptions);
break;
case "opencage":
this.geosearchOptions.provider = new OpenCageProvider();
this.geosearchOptions.provider = new OpenCageProvider(providerOptions);
break;
case "openstreetmap":
this.geosearchOptions.provider = new OpenStreetMapProvider();
this.geosearchOptions.provider = new OpenStreetMapProvider(providerOptions);
break;
}
Expand Down

0 comments on commit 4c5c5bf

Please sign in to comment.