Toolset is a great set of plugins that has saved me countless hours as I've worked on our site, but I am having a problem tonight with using the Maps plugin with Views.
I have created custom user fields, one of which is an address. When I edit a user profile from the backend, I enter an address in the field and the map at the side places a marker at the location I've selected. The address is saved in the wpcf-home-town field in the wpcc-user-meta table, apparently as a string. I assumed that google then georeferences that string again each time it is needed.
I created a View for users (with any role) and placed a map outside the loop and the marker inside the loop using the wizard, and then, when that didn't work, I tried again using the Fields and Views buttons. The result was a map with no markers on it. I thought the problem might be with the looping somehow, so I simplified the problem and attempted to add a single marker to a map at the address of the logged in user. But, I could not even get that to work.
As you can see from the screenshot, the admin user on this site has an address in Las Vegas, which correctly shows up on the back end user edit form. The code used to create the map is shown below:
<p>[wpv-map-render map_id="map-test1"]<br />
[wpv-map-marker map_id="map-test1" marker_id="marker-1" marker_usermeta="wpcf-home-town" id="$current"][/wpv-map-marker]</p>
<p><button class="js-wpv-addon-maps-reload-map" data-map="map-test1">Reload Map</button></p>
As before, the map shows up and there is no marker on it. To check that the id was correctly being passed, I added a few lines as follows:
<p>[wpv-map-render map_id="map-test1"]<br />
[wpv-map-marker map_id="map-test1" marker_id="marker-1" marker_usermeta="wpcf-home-town" id="$current"][/wpv-map-marker]</p>
<p><button class="js-wpv-addon-maps-reload-map" data-map="map-test1">Reload Map</button><br />
My Address is: [types usermeta='home-town' user_is_author='true'][/types]</p>
<p>The Lat Long is: [types usermeta='home-town' format='FIELD_ADDRESS: FIELD_LATITUDE, FIELD_LONGITUDE' user_is_author='true'][/types]</p>
This is to show the address as text and then the lat/long for the address. As shown in the screen shot, the address is correctly printed below the map, but the latitude/longitude is not listed. Does this mean that google is not geolocating the address? Is that why the markers are not showing up?
Incidentally, I also include an address with a custom post type I have created and am able to create a map showing the location of that post on this same site, so I'm sure the google API is working correctly and I feel like I understand how to set up the map, but this has me stumped. What could I be doing wrong?
Any suggestions would be greatly appreciated.
Thanks.