Populating RoundMarkers
-
Hello,
I’m trying to populate a map using the tutorial here – https://interactivegeomaps.com/docs/available-filters-to-manipulate-data/
However I’m not using regions in this map but want the venues to show as round markers (I guess icon markers are available in the Pro version?)
This is my code but no venues are showing on the map. Can you point out where I went wrong please?
add_filter( 'igm_add_meta', 'igm_cpt_addon_venues', 1 ); function igm_cpt_addon_venues( $meta ){ if ( intval( $meta['id'] ) !== 1253 ) { return $meta; } $venueObjects = []; $args = array( 'posts_per_page' => -1, 'post_status' => 'publish', 'post_type' => 'venue', ); $venues = get_posts( $args ); foreach ( $venues as $venue ) { $venueID = $venue->ID; $tooltipContent = wp_trim_words( $venue->post_content, 20, "..." ); $latitude = get_field('location', $venueID)['latitude']; $longitude = get_field('location', $venueID)['latitude']; $entry = array( 'title' => $venue->post_title, 'tooltipContent' => $tooltipContent, 'content' => get_permalink( $venueID ), 'useDefaults' => '1', 'action' => 'open_url', 'latitude' => $latitude, 'longitude' => $longitude ); array_push( $venueObjects, $entry ); } $meta['roundMarkers'] = $venueObjects; return $meta; }
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
The topic ‘Populating RoundMarkers’ is closed to new replies.