-
New Feature Request
-
Resolution: Unresolved
-
Trivial
-
None
-
7.2.5
-
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}`,