Hi,
As there is no direct method or feature available for this, it will require some workaround and a custom script.
1. You can wrap the content inside the view's loop item which you need to highlight on map marker click inside a special div container, e.g.
<wpv-loop>
<div class="result-item-container" data-item-title="[wpv-post-title]">
....Views loop item content...
</div>
</wpv-loop>
Please note how I've added a special class "result-item-container" and the current post's title in the "data-item-title" attribute. This will help in identifying each loop item's container, matching the post title.
2. In your map marker's shortcode, you'll also have to make sure that the current post's title is set for the "marker_title" attribute.
Example:
[wpv-map-marker map_id='map-1' marker_id='marker-[wpv-post-id]' marker_title='[wpv-post-title]' marker_field='wpcf-post-location']marker content[/wpv-map-marker]
3. Next, in the view's "JS editor" you can include this custom script, replacing "map-1" with the actual ID of your map:
jQuery( document ).ready( function( $ ) {
jQuery( document ).on( 'js_event_wpv_addon_maps_init_map_completed',function(event_settings) {
var markers = WPViews.view_addon_maps.markers;
var map='map-1';
for(var marker in markers[ map ]) {
markers[ map ][marker].addListener('click', function() {
jQuery('.result-item-container').removeClass('highlighted');
jQuery('.result-item-container[data-item-title="'+this['title']+'"]').addClass('highlighted');
});
}
});
});
This script will execute whenever a map marker is clicked and will add the "highlighted" class to the loop item container, where the post title matches.
4. This special class "highlighted" will allow you to style the highlighted loop item differently from the rest. For example, suppose you want to set a red background color to the highlighted result item. For that, you can add the custom CSS code in the view like this:
.result-item-container.highlighted {
background: red;
}
I hope this helps and please let me know if any step is not clear.
Note: The custom code examples from our forum are shared to get you started in the right direction. You're welcome to adjust them as needed and for more personalized customization assistance, you can consider hiring a professional from our list of recommended contractors:
https://toolset.com/contractors/
regards,
Waqar