Closed MortenHofft closed 1 year ago
@MortenHofft Thanks I did implement this and it works. I note that I had to name the function exactly 'getSuggests' for it to work.
Great that you got it working. You can call the function whatever you want to I'm certain. As long as you also reference it as such in https://github.com/VtEcostudies/VAL_GBIF_Wordpress/blob/7c1e9c1e931bd2421afa57550ea64caaa0f447d4/js/gbif_data_widget.js#L95
e.g. line 95 could just as well be getSuggest: anyNameOfYourFunction
asn long as that is what you called your function in line 31
Yes, you're correct that my local function name can be anything! Sorry I meant to say that the object-declaration of the suggest function appears to only allow the value 'getSuggests'. I misunderstood which of my coding updates was successful!Thanks for clarifying:
... getSuggests: getAnySuggestFunctionName, ...
Hi @jloomisVCE you asked a question in our webinar today. Something along "Can we limit GADM suggestions to a specific area"
I said - i think not. I was wrong - you can. The API supports it https://www.gbif.org/developer/occurrence#gadm
But that means you have to overwrite the suggest. You have already done that elsewhere in your portal as far as I remember. To make it a bit simpler, I've just changed so that the suggest configs get merged.
And you would then provide that as part of the configuration under the occurrence part.
E.g. here if Colombia https://github.com/gbif/hp-colombian-biodiversity/blob/master/_includes/js/config.js#L46
This will not solve other issues you might have with GADM suggest such as lack of granularity and such, but please create issues with examples for those as they are best handled separately.
I will close this issue once the simplification to the overwrites is also in production