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
Comment #1
pvhee CreditAttribution: pvhee commentedHave a look at #1338326: Added support for views and some configuration options
Comment #2
pvhee CreditAttribution: pvhee commentedReopening, since allowing leaflet to render data from multiple views (similar to what OpenLayers does) would be a useful extension.
Comment #3
iwhitcomb CreditAttribution: iwhitcomb commentedI'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.
Comment #4
pvhee CreditAttribution: pvhee commentedI'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.
Comment #5
pvhee CreditAttribution: pvhee commentedA link to the Leaflet Views Data sandbox with simple API documentation can be found here: http://drupal.org/sandbox/pvhee/1949922
Comment #6
RdeBoerComment #8
stephen Piscura CreditAttribution: stephen Piscura commentedpvhee,
Is this intended to remain in a separate module, or do you hope to integrate it into the Leaflet module itself?
Comment #9
milos.kroulik CreditAttribution: milos.kroulik commentedIs 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.
Comment #10
das-peter CreditAttribution: das-peter commentedI've started working on a way to combine Views here: #2371975: Use Attachment displays to combine data from multiple Leaflet views
Comment #11
Orkut Murat YılmazHello 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
Comment #12
Orkut Murat YılmazSorry for this comment, but I've just read the new version announcement.
Thanks for this great work.
Comment #13
Orkut Murat YılmazComment #14
Orkut Murat YılmazHello 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
Comment #15
itamair CreditAttribution: itamair as a volunteer commented@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.
Comment #16
Orkut Murat Yılmaz@itamair thanks for your beautiful and detailed explanation.
Comment #17
itamair CreditAttribution: itamair as a volunteer commentedComment #18
Orkut Murat YılmazHello 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
Comment #19
_kom__ CreditAttribution: _kom__ commented@Orkut Murat Yılmaz thanks for this link, looks great.
Comment #20
itamair CreditAttribution: itamair as a volunteer commentedWell. 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)