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.

geofield map

geofield formatter

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mordonez’s picture

Title: Allow overwrite Leaflet path options on formatter » Support to customize the vector overlays (Polygon, Polyline, Circle)
mordonez’s picture

mordonez’s picture

Status: Active » Needs review
mordonez’s picture

Issue summary: View changes
mordonez’s picture

fixing whitespace errors.

c-c-m’s picture

Status: Needs review » Reviewed & tested by the community

Patch applied successfully!

That's what I've done:

  1. Applied patch to leaflet module 7.x-1.x-dev
  2. Edit a CT which has a geofield field
  3. Edit geofield's formatter (in manage display tab): once you have selected leaflet as formatter there is where you can see the new options that are displayed on the image above, which include line's color, shape and opacity and fill's color and opacity

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.

mordonez’s picture

thanks @c-c-m to review and test the patch

here the same patch with views support you mentioned in #6

mordonez’s picture

Status: Reviewed & tested by the community » Needs review

change status to review the views integration

gcb’s picture

Status: Needs review » Closed (fixed)

Thanks @mordonez: rolled into 1.0 with some tweaking.

c-c-m’s picture

Glad to see this patch accepted. Good job.