Then in your view that is listing the post all you need to add within the loop tag is.
<wpv-loop>
[wpv-map-marker map_id="my-map" marker_id="my-marker" marker_title="This is a marker" marker_field="wpcf-my-marker"]This is the content of the marker popup.[/wpv-map-marker]
</wpv-loop>
Notice the use of the map_id as this must match the [wpv-map-render] shortcode for it to work. Also the marker_field is where you will add the slug of the custom field that holds the address value.
- the name of address field is 'location' so I made the shortcode like below. Is it correct? or do I have to modify the "marker_id" too?
- Also in marker_field do I have to put "wpcf-" before the name of the address field?
here the code inside my view loop
[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop wrap="1" pad="true">
[wpv-item index=1]
<div class="row ">
<div class="col-md-12">[wpv-post-body view_template="loop-item-in-lista-experiences"]</div>
</div>
[wpv-item index=other]
<div class="col-md-12">[wpv-post-body view_template="loop-item-in-lista-experiences"]</div>
[wpv-item index=pad]
<div class="col-md-12"></div>
[wpv-item index=pad-last]
<div class="col-md-12"></div>
[wpv-map-marker map_id="my-map" marker_id="my-marker" marker_title="This is a marker" marker_field="location"]This is the content of the marker popup.[/wpv-map-marker]
</div>
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
<strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
[/wpv-no-items-found]
[wpv-layout-end]
You will need to add the marker shortcode within each of your Loop indexes.
Add it below index=1 and index=other
Also Howw can I customize the popup?
The content within the marker can be customized with HTML and CSS so if you are to add some HTML elements here with some classes then you can write some css to design the marker's popup.
If you provide the general_center_lat="123" general_center_lon="123" parameters with the longitude and latitude that you want to center the map over then you can center it over that specific location.