I inserted the code:
[wpv-map-render map_id='map-9'][wpv-map-marker map_id='map-9' marker_id='marker-9' marker_usermeta='wpcf-adres' id="$author"][/wpv-map-marker]
Unfortunately, in your user profile added by the CRED form, the map does not show the correct place. But while editing the profile on the front-end map shows the right place.
The user field is called "adres".
The CRED form is inserted:
[cred_field field='adres' post='user' value='' urlparam='']
Something I'm doing wrong?
Dear Bochnacki,
I assume you are going to display the author of current post, the custom address field "wpcf-adres".
You can try this:
[wpv-map-render map_id='map-9'][wpv-map-marker map_id='map-9' marker_id='marker-9' marker_usermeta='wpcf-adres' id='[wpv-post-author format="meta" meta="ID"]'][/wpv-map-marker]
More help:
https://toolset.com/documentation/user-guides/maps-shortcodes/#wpv-map-marker
id. Optional, defaults to empty. The ID of the object used to get the address meta field value for this marker.
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-post-author
Display details for the author of the current post.
Thanks for correcting me.
Unfortunately the map still does not indicate the correct place.
Strangely, while editing a profile on the front-end works well, and not here...
I can not duplicate same problem, please check this in your website:
modify the marker shortcode, add attribute debug="true" in it, for example:
[wpv-map-marker marker_id='marker-9' ... debug="true"][/wpv-map-marker]
Then test it in front-end, there should be a debug logs, copy it here, we need to know what is the problem in your website.
Marker data
————
Original attributes:
Array
(
[map_id] => map-9
[marker_id] => marker-9
[marker_usermeta] => wpcf-adres
[id] => 1
[debug] => true
)
Used attributes:
Array
(
[map_id] => map-9
[marker_id] => marker-9-1
[marker_lat] => 50.8076222
[marker_lon] => 19.1180519
)
The marker does output the latitude and longitude values, it is strange that in your website:
map still does not indicate the correct place
Please check these:
deactivate other plugins and switch to wordpress default theme, and test again
If the problem still exists, please provide a live website with same problem, does the same problem exists in your website?
hidden link
If it is, please point out the problem page URL, I need to debug it in a live website.
I deactivated other plugins and switched to the default theme of wordpress and re-tested - the map still does not indicate the correct place.
The problem is at hidden link
Thanks for the details, since you are using the map's shortcode into views loop, the shortcode [wpv-map-render map_id='map-9'], will output a google map ID "map-9-1", so I modified the codes in view "Profil dealera":
hidden link
section "Loop item in Ogłoszenia dealera", add "-1" into shortcode [wpv-map-marker] attribute "map_id", as below:
[wpv-map-render map_id='map-9'][wpv-map-marker map_id='map-9-1' marker_id='marker-9' marker_usermeta='wpcf-adres' id='[wpv-post-author format="meta" meta="ID"]'][/wpv-map-marker]
Please test again, check if it is fixed. thanks
It is better, but now the same place is displayed for each user (the place the administrator wrote in his profile).
I do not quite know how to correct this because id = '[wpv-post-author format = "meta" meta = "ID"] seems to be the only correct formula.
The problem page:
hidden link
is a wordpress created by admin user, but you are going to retrieve user information from the user view's loop, so in the shortcode [wpv-map-marker], the attribute "id" is not needed, you can remove it to this:
[wpv-map-render map_id='map-9'][wpv-map-marker map_id='map-9-1' marker_id='marker-9' marker_usermeta='wpcf-adres' debug='true'][wpv-user field="user_login"][/wpv-map-marker]
And test again
Works perfectly.
Thank you again 🙂