I'm trying to get a leaflet map running that can show the output from a couple different views as layers on a single leaflet map, and as far as I can tell there's currently no way to do this. I need to get this working one way or another, so I'll be putting some time on this. My question is whether or not there are already plans for how this should work, and if there are, then what can I do to that end?

So far I've been toying with having views render everything GeoJSON, and maybe then have a leaflet map read that, and I've looked into using relationships to pull more data onto the map, but the display format only allows one map data field. Neither approach has led very far, and both seem overly complicated.

Comments

pvhee’s picture

Status: Active » Closed (duplicate)
pvhee’s picture

Version: 7.x-1.0-alpha1 » 7.x-1.x-dev
Status: Closed (duplicate) » Active

Reopening, since allowing leaflet to render data from multiple views (similar to what OpenLayers does) would be a useful extension.

iwhitcomb’s picture

I'd like to second this. Layering support in views and/or the API would definitely give OpenLayers a run for its money.

I'm loving leaflet btw.

pvhee’s picture

I'll be committing a sandbox project on this soon, which allows you to create Leaflet data layers in Views that can then be put on a map using Leaflet's API functions.

pvhee’s picture

A link to the Leaflet Views Data sandbox with simple API documentation can be found here: http://drupal.org/sandbox/pvhee/1949922

RdeBoer’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

stephen Piscura’s picture

pvhee,

Is this intended to remain in a separate module, or do you hope to integrate it into the Leaflet module itself?

milos.kroulik’s picture

Issue summary: View changes
Status: Closed (fixed) » Active

Is that mentioned sandbox the only solution? It has only 2 commits and really doesn't look well maintained. Furthermore, I would like to see some GUI solution comparable to the OpenLayers module.

das-peter’s picture

I've started working on a way to combine Views here: #2371975: Use Attachment displays to combine data from multiple Leaflet views

Orkut Murat Yılmaz’s picture

Version: 7.x-1.x-dev » 10.0.x-dev

Hello all,

Sorry for reopening the same issue, but is there a solution for showing different views (or at least displays of same view) on the layers we can switch?

Best,
Orkut

Orkut Murat Yılmaz’s picture

Sorry for this comment, but I've just read the new version announcement.

Thanks for this great work.

Orkut Murat Yılmaz’s picture

Status: Active » Closed (works as designed)
Orkut Murat Yılmaz’s picture

Status: Closed (works as designed) » Active

Hello again,

The current version's Leaflet Views Grouping with overlays feature works well for me. Thanks for adding that one, once again.

However, in some different scenarios, using different views (and/or displays) as overlay layers would be great. Also, using it with the exposed filter option, would be a better feature.

Reopening the issue, with all due respect.

Best,
Orkut

itamair’s picture

Status: Active » Needs review

@Orkut Murat Yılmaz sorry there are no real plans to implement this feature, that collected some interest and no real implementation, over the last 9 years, and since Leaflet 7.x branch.
Whoever really needs this should try to implement it helping himself, without just claiming and waiting for someone else concrete support or contribution (also because this doesn't look a quick add-on to be implemented).
Better POCs, well tested (and not regressive, so as Drupal/Php code compliant) Patches are welcome here ...
or even a fork into a parallel module.

Orkut Murat Yılmaz’s picture

@itamair thanks for your beautiful and detailed explanation.

itamair’s picture

Status: Needs review » Closed (won't fix)
Orkut Murat Yılmaz’s picture

Hello again,

I came across Leaflet Layers GeoJSON and it looks promising. If someone comes this issue after searching for solution, can give it a try.

Thanks for everything.

Best,
Orkut

_kom__’s picture

@Orkut Murat Yılmaz thanks for this link, looks great.

itamair’s picture

Well. It is nice if it looks promising but Leaflet Layers GeoJSON module code base is not great in terms of Drupal & PHP coding standards ... (at least in this state of its development)