Hide Map if empty setting not respected

Created on 22 May 2024, 7 months ago
Updated 6 June 2024, 6 months ago

Problem/Motivation

Checking the 'Hide Map if empty' setting for CiviCRM entity leaflet map still displays an empty map in the middle of the ocean.

Steps to reproduce

Create a CiviCRM contact map view using lat / long fields.
Set the contextual filter to pull the contact ID from the URL.
Limit to 1 contact without a lat / long value.
Set the map settings to Hide map if empty.
Map will still show

Proposed resolution

Add a hide_empty_map options settings check before rendering the map

if ((!empty($lat_value) && !empty($long_value)) || !($this->options['hide_empty_map'])) {
        $element = $this->leafletService->leafletRenderMap($js_settings['map'], $js_settings['features'], $map_height);
      }

Remaining tasks

Raising merge request to gitlab shortly

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024