I've updated WordPress and I'd suggest switching Theme and disable the plugins that aren't Toolset, if that's OK, because of the cleaner the slate the better to work on.
We don't need Page builders, cache, or other features just yet
(Well, the SVG Maps plugin, please leave that 🙂 )
I see you use Relevannsi, this is why the field's setup asked you stuff about using it in the search - please ignore it for now, given Relevannsi is not needed for the use case.
I couldn't find values in the fields of the first post you mentioned, ID-region-field is empty, but I see you added numeric ID values to some of the Location posts.
Those ID's match the exact area ID of the SVG map, right?
Like, "Gran Teatro Falla" is in SVG Map Area "2"?
You say "The numbers correspond with the ID value of the "Provincia" field, included in the CPT ", but that field is a word, not a number, in your install, like "Cadiz". I assume you mean the ID of the svg map, right?
You seem to confirm that with "Also those values correspond with the values the SVG Map plugin support team told me to introduce in the field I created, called "option_id". (The one in the support team ticket I pasted you before)."
Now, to the feature itself.
1. You can get the ID of the Area clicked with the code below:
function (e, mapsvg){
var region = this;
console.log(region);
}
2. The ID of those regions are not numbered, they are values like ES-CO. So that is what we need to store in the Custom Post Fields, exactly matching, because otherwise, we cannot match the clicked area to a found search result, right?
3. From here on, it's simple. console.log(region); returns a whole opbject of the region, and we want only the ID, so we get just the ID:
function (e, mapsvg){
var region = this;
console.log(region.id);
}
BTW; the JS code I insert here: lien caché, in the "click.region" event.
Now when clicking the maps' regions, the console tells you the ID's, right?
What we need now, is just pushing that to a new URL parameter, so the View can listen to it, and filter.
The URL parameter I added in Views for this field is:
ID-region-field es un/a cadena igual a URL_PARAM(areaid)
Hence, we can push with JS the ID we get on click from the map, to the URL paramater "?areaid="
The view will then listen to that.
The final code is:
function (e, mapsvg){
var region = this.id;
//console.log(region.id);
var pageUrl = '?areaid=' + region;
window.history.pushState('', '', pageUrl);
}
It creates a ?areaid=ID-ID url attribute where ID-ID is the ID of the area you clicked.
If you now click in an area at lien caché, it will update the URl with lien caché, for example.
If you have any posts with the Field saving ES-CO, and search in that view by ?areaid=ES-CO, it'll find that one post, see lien caché
Now, the issue remaining is firing the (submitting the) search itself.
How do you plan to handle that?
By page reload or AJAX update on changes in the search?