Hello,
I have a lot of custom house objects. Evey post has two fields (number), one is latitude and one is longitude
For example:
longitude: 8.42224000000000
latitude: 46.81695480000000
How can I show my custom posts on a map with two custom fields? When I`m configuring the maps in blocks editor, I can choose only one field. And the option "View block" is showing no results.
You can see an test example here: hidden link (needs a bit for loading because of many objects)
[wpv-map-marker map_id="my-map" marker_id="my-marker" lat='Types shortcode' long='Types shortcode' marker_title="This is a marker" ]This is the content of the marker popup.[/wpv-map-marker]
Notice the Long and lat attributes in the shortcode.
thanks for your reply. Where do I have to insert the shortcode? And what means "Types shortcode" for lat and long? Is ist the custom field name (in my example "latitude") or ist is the Types Shortcode like [types field='latitude' format='FIELD_VALUE'][/types]?
[wpv-map-marker map_id="cote-dazur" marker_id="marker-4" lat="[types field='latitude' format='FIELD_VALUE'][/types]" lon="[types field='longitude' format='FIELD_VALUE'][/types]" marker_title="Ferienhaus"]This is the content of the marker popup.[/wpv-map-marker]
But where do I have to import this (using blocks editor)??
That's correct. The shortcode will need to be added to a Classic block or the Fields and Text block.
So long as the map block is on the page and the the map id in the marker shortcode is correct then it should populate your map with the correct markers.
Hi Shane, thanks for helping me. I used the Fields and Text block and imported the code there. Then I made the field invisible. All objects are shown in the maps. Thank you!