Uploaded image for project: 'ZABBIX FEATURE REQUESTS'
  1. ZABBIX FEATURE REQUESTS
  2. ZBXNEXT-9976

Add clustering option in geomap widget edit

XMLWordPrintable

    • Icon: New Feature Request New Feature Request
    • Resolution: Unresolved
    • Icon: Trivial Trivial
    • None
    • 7.2.5
    • Frontend (F)
    • None

      We have a need for some geomaps to have host clustering enabled and other maps to have clustering disabled.

      Currently clustering can only be controlled globally by adding the line "disableClusteringAtZoom: <integer>"

      to the /geomap/assets/js/class.widget.js in the _createClusterLayer() const clusters array.

      I have applied a modification that allows me to control this on a per instance bases. I don't feel comfortable submitting this change as I am not experienced enough to know the "right" way to go about doing this in the product.

       

      I added the "Cluster Level" field to widget.edit.php

          ->addField(
              (new CWidgetFieldTextBoxView($data['fields']['cluster_level']))

      I added the below line to the WidgetView.php file in the doAction function.

       'cluster_level' => $this->fields_values['cluster_level']

       

      finally, in the class.widget.js file for the geomap, i added the variable

       static cluster_level = null; 

      in the setContents(response) function I added:

       CWidgetGeoMap.cluster_level = response.cluster_level;

       

      in the const clusters definition I added:

       disableClusteringAtZoom:`${CWidgetGeoMap.cluster_level}`,

       

       

            vmurzins Valdis Murzins
            miscoop Charles Solomon
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: