Problem/Motivation

Currently you need to patch Views GeoJSON to make everything working: #1799870: Add hook views_geojson_feature_alter
It would be nice if we could solve this in another way - or get the Views GeoJson patch finally in :D

Proposed resolution

The approach in the attached patch feels a bit hacky but seems to do the trick.
I (ab)use GeoclusterConfigViewsDisplayExtender::query() to inject artificial fields into the views configuration. Views GeoJSON renders those fields into the feature properties and our JS can pick them up and act on the values as we wish.
The good thing about this is that it's done automatically and we don't have to bother the user that configures the view with name conventions and what not. Downside is that I don't know how stable / compatible this is.

Remaining tasks

Reviews needed.

User interface changes

None - that's the great thing actually.

API changes

None.

Comments

basvredeling’s picture

I like the approach. But how would it deal with non-leaflet maps?

basvredeling’s picture