- Issue created by @jayhuskins
- Status changed to Needs review
about 1 year ago 11:26pm 27 November 2023 - 🇮🇹Italy itamair
Not clear how you would like them to cluster once they are close to others geometries that are not meant to be part of the same entity.
Should the Points not cluster with the Geometries that are part of the same entity/node, but cluster with other Points of other entities/nodes? ... and what about other Geometries of other entities/nodes?You should also clarify (first to yourself ... if not yet done) which is the logics you want to implement for clustering in all those combinations,
and hence try to leverage all the tools that the Leaflet module already provides you, such the following:- the Leaflet View style configuration allow to select an Exclude Flag that support Replacements Tokens (so you could add that boolean to your entity/node dat model / fields and use it in the Marker Clustering configuration;
- the Leaflet View style configuration allow to enable / disable Marker Clustering of Paths / Geometries;
- take advantage of existing Leaflet Views hooks, documented in the leaflet_views.api.php, so to eventually alter the Exclude Flag during the pre-processing JS phase, so to make the Exclude Flag true or false according to your specific logics (in case of Point or Geometry, etc.);
- rather then using 2 different geofield fields, seriously consider the better option to adopt an approach with 2 Paragraphs types/bundles, entity referenced from a single field, with a common (re-used) Geofield field, but configured differently (one allowing just Points and the other just Polygons), and adding into both Paragraphs a boolean field such as "Exclude from Clustering" that might be selectively set for each paragraph (geo - component) and then drive as Replacement Token the "Exclude Flag" Leaflet View style configuration mentioned above ...
-. last but not least you could even override with your customised / extended one the "Drupal.Leaflet.prototype.add_features" method implemented in the Drupal.Leaflet.prototype.add_features ...Hope all the above could make sense and be helpful to you.
Does it sounds confusing and pretty complicate?Well this Support issue of you is not the most clear and easy one, also ;-)
- Status changed to Closed: outdated
about 1 year ago 8:18pm 19 December 2023