Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The default formatter doesn't allow overwrite the default options and constants shared between vector overlays (Polygon, Polyline, Circle).
I attach a patch that extends the default formatter and allow to overwrite the leaflet's options.
The first image show the formatter form and the second image a map with multi-value geofields.
Comments
Comment #1
mordonez CreditAttribution: mordonez commentedComment #2
mordonez CreditAttribution: mordonez commentedComment #3
mordonez CreditAttribution: mordonez commentedComment #4
mordonez CreditAttribution: mordonez commentedComment #5
mordonez CreditAttribution: mordonez commentedfixing whitespace errors.
Comment #6
c-c-m CreditAttribution: c-c-m commentedPatch applied successfully!
That's what I've done:
Thank you very much for your work mordonez, I really think this provides a necessary step forward in customizing maps that was leaflet module was lacking till now.
I have to admit, however, that the image you provided on this issue's description which displays several results and clusters I expected a different behaviour based on views instead of geofield formatter which only works per node basis. I really think this should also be implemented in leaflet_views submodule in order to extend this functionallity on a views-based map. I've never done such a thing, but I'll try to do it or help you if you need my help.
Comment #7
mordonez CreditAttribution: mordonez commentedthanks @c-c-m to review and test the patch
here the same patch with views support you mentioned in #6
Comment #8
mordonez CreditAttribution: mordonez commentedchange status to review the views integration
Comment #9
gcbThanks @mordonez: rolled into 1.0 with some tweaking.
Comment #10
c-c-m CreditAttribution: c-c-m commentedGlad to see this patch accepted. Good job.