Forums › Forums › Search & Filter Pro › Mashup Maps Integration
Tagged: google maps, Map Marker, maps, Maps Integration, Mashup Map, OpenStreetMap
- This topic has 8 replies, 3 voices, and was last updated 1 year, 10 months ago by Trevor.
-
Anonymous(Private) January 25, 2021 at 2:30 pm #273890
Dear Trevor,
I am trying to build a search that shows a map with different markers in the search results.
For the preparation I read through the forum and saw that you once did it using a mashup map such as wpgmaps.com – hence I bought it and set up everything.
Actually I dont know what the next steps are. The Link you provided in another topic, goes to a 404 page.
Can you tell me what you did, to achieve this in the past?
Would love to hear from you,
PhilippTrevor(Private) January 25, 2021 at 6:10 pm #273929To test whether it worked, I used our Using a Shortcode display results method, following the guide here, and the customising section (so I had my own copy of the results.php file):
https://searchandfilter.com/documentation/search-results/using-a-shortcode/#customising-the-results
On each post for which there was a map needed, I made a map in wpgmaps and noted the ID.
Using Advanced Custom Fields, I created a ‘map_id’ custom field for these posts, and then added against each post the relevant map ID. I also made a parent map, and noted that map ID.
Before the while loop starts in the results.php template (‘the template’ from now on), I defined two variables:
$post_content_output = '';
$map_output = '[wpgmza id="2" mashup=true mashup_ids="';
where 2 is the parent map ID (so change to suit).
As each loop of while is run, you output the strings into
$post_content_output
and add the post map ID to$map_output
, with a comma after each ID.When the loop has finished, you need to trim the last comma off
$map_output
, then add'" parent_id="2"]'
to it. That should complete it as a mashup shortcode.Then you have two variables to echo to the page (one as a do_shortcode function).
I no longer have a copy of the results.php I used, sorry, so you would need to code this yourself, but the logic is as above.
This was the reference I used:
https://www.wpgmaps.com/documentation/advanced-map-options/map-shortcode-parameters/
Anonymous(Private) January 27, 2021 at 12:23 pm #274247Hi Trevor,
thank you for the detailed explanation.
As I am a webdesigner and not a developer, this goes beyond my experience: I will search for an alternative or an web developer who can help me out.
This ticket can be closed.
Have a nice day,
PhilippAnonymous(Private) January 3, 2023 at 3:48 pm #276703Hello Trevor – if this thread is still open I would like to jump in. I think what I am trying to do is the same thing… I have pro wpgmaps, i have pro Search and Filter. I have the php mashup code. What I am missing is – anything working. I may need to revisit the map plugin docs. So – what I am trying to do, is sort and filter 600+ providers, and as they filter, they appear as pins on the map based on their address. I can add the map ID to each provider record, thats easy enough with an import. But – do I also need to add them individually to the map somehow? Or how else do they get tied to the locations in the map? Thats my missing link and I realize it may not be a Search & Filter issue, either.
-
AuthorPosts