Hey there,

first I want to thank you for this really great module! It works perfectly!

But I have one question: Why is Leaflet needed to install the module. On my page I use OpenLayers and have no need for Leaflet.

Thank you!

Dirk

Comments

Dirkozoid created an issue. See original summary.

RdeBoer’s picture

Component: Documentation » Code
Assigned: Dirkozoid » RdeBoer
Category: Support request » Task

Hi Dirk,

It's because of this:

  // This call is the only reason we require Leaflet.
  // @todo: Refactor and remove this dependency.
  $components = leaflet_process_geofield(array($geofield_result));

In other words, while the Leaflet maps aren't necessarily used, the Leaflet module has a handy utility function to process geofields.

I never got round to doing the @todo !

Rik

Dirkozoid’s picture

Hi Rik,

sorry, I missed your answer. Thank you for your reply!

Best

Dirk

RdeBoer’s picture

No worries. You're welcome.
Rik

Joel MMCC’s picture

Does OpenLayers have a similar utility function? If so, then would it not be possible to either detect which is present and call that, or provide an Admin setting specifying which to use, and call the appropriate function there? That way you don’t have to re-invent the wheel and roll your own.

I see that OpenLayers does have functions for parsing GeoJSON.