[Resolved] Adding different marker image on a single map using taxonomies
This thread is resolved. Here is a description of the problem and solution.
Problem:
How to display different map marker image or icon or pin based on different category or taxonomy terms
Solution:
You can add different marker shortcode with different marker image and wrap the marker shortcode using [wpv-conditional] shortcode which will help you to display correct marker image based on category or taxonomy term.
The solution in that Thread is related to a Map displayed in a Loop of a View, where you have the Post Object of each post available and can check on it's term.
This will not work in a single Post as there only one post object is available and you cannot display several addresses for one post depending on terms as there is always only one set of terms per post.
Now, if this is in a View's loop, it works just fine, but I am not sure why Luo suggests such a complex approach.
You can do that much simpler.
1. Add the View where you will plot the map
2. Insert something like this in the Loop:
3. Register the WordPress native has_term() function in Toolset > Settings > Front End Content > Functions inside conditional evaluations
4. Add terms to the posts where you also add addresses
Of course the above conditional needs to be adapted to your needs.
But this is the working syntax of the MVS (Minimum Viable Solution).
I did want to do exactly what the other user successfully accomplished, one map, all posts with different icons. How do I Map displayed in a Loop of a View, where you have the Post Object of each post available and can check on it's term.
I successfully did have all posts in the map view but when i started to add the code in the previous support thread i somehow obtained a map with one post view.
Can you walk me through it. I would really appreciate it. I think it is a great feature but obviously I am just not getting it right.