Tell us what you are trying to do? Hi, I have a map in Custom Search. When nothing is found, the Google Map will display africa. So I need to know how to display some default location Charleston SC?
Is there any documentation that you are following?
I have this second one in place but it does not seem to be working. I might not be understanding exactly how to implement it. That's where you guys come in 😉
Is there a similar example that we can see?
hidden link
If you try to search a zip that does not contain one of the locations it defaults to Africa on the map.
Can you clarify, are you using Blocks or legacy Views? The solution would be different, depending on whether you are inserting the map via the Map block that is fed by a View, or whether you are inserting it via shortcodes into the output of a View.
Not sure if this helps answer your question. This is how I'm looping the error message. This is also where in the instruction it told me to add the shortcode. The design of the page is built in DIVI. Let me know if this helps or if you need anything else.
Hi, the solution suggested in the link you posted involves placing a Marker shortcode inside the wpv-no-items-found section of the View's loop. The Marker can be set to an arbitrary location, like Charleston SC. This would effectively display a map centered over a marker on Charleston, SC when no results are found. If you don't want to display a marker here, only center the map, you could upload a custom empty image icon in Toolset > Settings > Maps, and select that transparent icon instead of a standard marker icon. I'm attaching a transparent image file you could use here.
Sure, I can help guide you. If you already imported the custom transparent marker icon, skip to #3.
1. Click the image name "transparent-32x32.png" in my previous reply to trigger the popup that displays the full size transparent icon. Right click the icon in the area shown in the icon-popup.png screenshot to save that image to your desktop somewhere.
2. Go to Toolset > Settings > Maps, the clck "Add Marker" to upload the transparent-32x32.png image you just downloaded.
3. In the Loop Editor of your View, click your mouse in the code editor to place the cursor just before or just after the line I outlined in red in my screenshot "1879331-Screen_Shot_2020_12_17_at_9.16.51_AM.png" in my previous reply. Then click the Fields and Views button and click Marker to begin creating a Marker shortcode.
4. In the Marker tab of the Marker popup, set the Map ID to correspond to your existing Map ID. I believe in your case that will be map-13 buty ou should confirm the correct ID in the Map shorftocde. Next set the new marker ID to be marker-no-items-found, and choose the desired centerpoint of the map by entering an address and choosing one of the suggested options. See marker-tab.png.
5. In the Marker icons tab of the popup, choose the option "No, use other icons," then select the transparent icon for this marker. See marker-icon-tab.png
6. Click "Insert shortcode" to generate and insert the marker shortcode. You should now find a wpv-map-marker shortcode inside the wpv-no-items-found shortcodes in the View's Loop Editor. When the View has no search results, this marker will be placed over the address you chose, and the map shold zoom and center over that transparent marker.
Let me know if you get stuck on one of these steps.