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.
Hi, I am using leaflet,leaflet views on drupal 8. The field type i use for location content type is 'geofield'. I can display the leaflet map view for individual content. but when I create a view, it is always blank. There is nothing showing up.
Comment | File | Size | Author |
---|---|---|---|
#3 | 2902898-fix.patch | 1.92 KB | pitop |
Comments
Comment #2
pitop CreditAttribution: pitop commentedHi I had the same problem, incompatibility with the new version of Views.
Comment #3
pitop CreditAttribution: pitop commentedJust created this patch that try to fix this issue - pb for me when using the Leaflet map (old) Settings
Comment #4
alarcombe CreditAttribution: alarcombe commentedI think this is a duplicate of https://www.drupal.org/node/2839538
esp https://www.drupal.org/files/issues/leaflet-recognize_geofield-2839538.p... ?
Comment #5
ladamiak CreditAttribution: ladamiak commentedHi... I have the exact same problem.
As I can see, the problem is that the "Features" array is beeing rendered empty on the js output, as the code bellow.
"options":{"attribution":"OSM Mapnik"}}}},"features":[]}},
I realized that when we get to the "render()" function in leaflet_views\src\Plugin\views\style\Leaflet.php the object "$this->view->attachment_before" is empty.
I just don't know where it's beeing populated. :(
Comment #6
ladamiak CreditAttribution: ladamiak commentedjust for note, in order to show the markers on the map I've changed temporarily, in leaflet_views\src\Plugin\views\style\Leaflet.php, this code:
for this:
Comment #7
s-jack CreditAttribution: s-jack commentedThe patch seems to be working for me.
Thanks.
Comment #8
paul_canning CreditAttribution: paul_canning commentedThe patch will not apply to the 1.x-dev branch.
This is what I get from 'composer update drupal/leaflet'
Any ideas?
EDIT - I tried just using the patch from this issue (as it seems like the patch for the Leaflet MarkerCluster issue is mostly the same) and it still doesn't work. I just get a map that shows the entire world, no markers, despite my filtered nodes having a geolocation field. Is it correct that there is only basic settings for 'Leaflet" such as map type and size? "Leaflet (Old)" has much more indepth settings....
Comment #9
s-jack CreditAttribution: s-jack commentedHi,@paul_canning.
I have patched for leaflet dev-1.x.
My environment is geofield.
You may have to look for some problems in the geolocation field.
https://www.drupal.org/project/issues/geolocation?text=&status=Open&prio...
OSM maplink views quickly with marker cluster, but some more map type views blank or so slowly.
I installed marker cluster is dev-1.x.
I can't imagine the cause.
You should reinstall modules are geolocation field, leaflet as developer version and appropriate javascript libraries, then you try to apply some appropriate patches to them.
Try rebuild.
Comment #10
GaëlGDuplicate of #2839538