Support Forum
Has there ever been the method to get multiple pins to show up on a google map with wpgridbuilder facet after you import multiple locations by chance?
I've imported and nothing shows up until after you go into the location and then update it. It's like it doesn't register until after you save.
I think it might have something to do with Long/Lat.
With ACF you have the option to map and import the Long/Lat and then re-index with gridbuilder which allows for whatever the number of locations are and they populate without needing to open/save each imported location.
Hello there,
If you want to display multiple pins on a map, please follow the article below https://metabox.io/display-all-listings-on-a-map/?swcfpc=1
If you want to make the map field works with the Map Facet addon of WP Grid Builder, you will need to remove the third value (zoom) of the map field value. Please refer to this topic https://support.metabox.io/topic/how-to-remove-zoom-level-from-location-output/?swcfpc=1
and documentation https://docs.metabox.io/fields/map/#data
Hi Peter, thanks for the reply.
I've taken a look at this post before I sent in my request above https://metabox.io/display-all-listings-on-a-map/?swcfpc=1. It seems this is for Open Maps and not Google Maps, am I missing something?
I can also get multiple pins to show up on the map but only after I open an imported location and hit save/update so that is where the problem is. If I import 1000 locations, I don't want to have to open each one and hit save/update just to have them show up on the map. So that's where the problem lies, they don't show up automatically after import and/or reindexing from WPgridbuilder.
Do any of the suggestions you mentioned have a remedy for that issue? Reading through them doesn't seem like it will fix the issue I'm having.
Thanks again, talk soon
Hi Peter, I thought I'd record a quick video to show you what is going on, it might give you a clearer picture to what my problem is.
You can view it here: https://screencasts.tp-m.com/recordings/zNOqI69XjORztBqLD4Ll
Thank you,
Hello,
Thank you for your details. In general, I think the issue is not on the side of Meta Box. What Meta Box supports here is a custom post type and custom fields to display on the frontend. I'm not sure what option or feature you are using on your local site to filter the post (location) automatically based on moving the map. I suggest you can contact WP Gridbuilder to ask for help with this issue.
You can also update the locations in bulk by going to admin area > Location > Bulk select posts > Edit > Just click on Update, see this screenshot https://monosnap.com/file/dzKzxaT4aOBA4GEDBcbJjH12pP6MNE
Hi Peter, noted, I'll check with them as well.
I also tried the bulk update as you suggested before as well—no luck there either.
Much appreciated!
Hi Peter, can you take a look at this video, please?
You will see there are imported locations, and the imported data is acting as it's not registering the "Location Map Address" data until after you open the location and the page fully loads, and then you hit save/update.
In the video, you can see that there is what appears to be some default map area and once the page finishes loading you can see the map jump to the input location. It happens fast but you can catch it if you know what you're looking for.
Bulk editing and updating as you suggested above isn't doing a thing, you have to physically open each location and have it register the location in that split second and hit update.
How would you force that location to register in the post type without needing to open each location one by one?
Hello,
Can you please let me know what data of the post type you import? Please check the value of the map field in the database before/after you click on the Update button and share it with me.
Hi Peter, here are the two images.
Before:
https://www.dropbox.com/s/dfrulvd0matzhor/CleanShot%202023-06-13%20at%2016.21.30%402x.png?dl=0
After:
https://www.dropbox.com/s/sit574w1pftfdci/CleanShot%202023-06-13%20at%2016.29.24%402x.png?dl=0
I think I got it figured out by looking at the database.
You need to map the latitude and longitude to the map field created.
I'm running a few more tests to make sure but if my tests end up working out, you'll probably want to update your docs noting that because from my searches about getting it to work, there is no mention of that at all.
You might want to test on your end too. I'll let you know my findings.👍
Hello,
Yes, exactly what I need to tell you. The map field saves the location to the database with the format: lat,lng,zoom
, it is noted in the documentation https://docs.metabox.io/fields/map/#data
Apparently, if a field does not have a correct value in the database, it will not display properly on the site. And I think no need to update the doc in this case.
Hello I have the same problem, but I do not understand exactly what was the solution here, can this please be explained again?
To explain I import data with address into the field defined in metabox for the map display.
The import happens with WP All Import.
If I now have imported all the data, then no geodata is available in the map field, only if I manually open the entry and then go to update.
Since it is 72k entries I do not want to do this manually.
I will next try to import the data with latitude and longitude and then see if it works.
Is there no other solution here?
You need to add map field. And if it's not populated you need to update map custom field with lat,lng,zoom... example: update_post_meta($post->ID, 'map', '15.3344,22.334,14');
while importing you must update map field with that data.
but if you already imported a bunch of data maybe this function will help you (if you have longitude and latitude).
(use at your own risk)
https://pastebin.com/pSntYNLF
call the function: https://yourUrl.com/?save_all_posts=1