Skip Navigation

[Resolved] User profile map

This support ticket is created 7 years, 4 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

Tagged: 

This topic contains 10 replies, has 2 voices.

Last updated by Bochnacki 7 years, 4 months ago.

Assisted by: Luo Yang.

Author
Posts
#544890

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?

#545036

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.

#545063

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...

#545414

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.

#545557

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
)

#545886

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.

#546023

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

#546730

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

#546814

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.

#547191

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

#547351

Works perfectly.
Thank you again 🙂