Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Problem
There is currently no way to set the zoom level in Leaflet maps that are created using Leaflet Views integration.
Current status
A patch has been submitted. Review is needed.
Original message
I can't find the option to select the zoom of the map.
Is this only for me or that option really is not available?
Comment | File | Size | Author |
---|---|---|---|
#10 | leaflet-views-center-2762903-10.patch | 3.13 KB | PhilippVerpoort |
#9 | leaflet-views-zoom-2762903-9.patch | 2.5 KB | PhilippVerpoort |
#2 | 20160826-geofield-display-leaflet-options.PNG | 12.04 KB | GreenSkunk |
Comments
Comment #2
GreenSkunkZoom options show in the options in a geofield display settings in the corresponding content type?
/admin/structure/types/manage/[CONTENT-TYPE]/display
Comment #3
joco_sp CreditAttribution: joco_sp commentedI am using it in Views.
Format:Leaflet is not working for me, so I use Format:Leaflet map (old) and there is no option to select the zoom.
Comment #4
Carlos Miranda Levy CreditAttribution: Carlos Miranda Levy as a volunteer commentedI can confirm (although I'm using 8.x-1.0-beta1) there is no zoom option in Views.
The Views auto-zooms to display all plotted points though.
Comment #5
MrPeanut CreditAttribution: MrPeanut commentedComment #6
PhilippVerpoortAny updates on this?
Comment #7
benjamin.merkley CreditAttribution: benjamin.merkley at Portage CyberTech commentedIm experiencing a similar issue
Comment #8
paul_canning CreditAttribution: paul_canning commentedI am also using 'Leaflet (Old)' as the normal Leaflet format doesn't seem to work.
Can we please get zoom levels, and also the ability to add a default location when no pins are shown (in the case where exposed filters are used).
Comment #9
PhilippVerpoortI have created a patch which should provide this feature.
Comment #10
PhilippVerpoortI am also providing a second patch that should provide the ability to set the centre of the map for Leaflet maps created with Views, as requested by @paul_canning in #8.
This patch is building up on the one in #9 (the diff has been created against that commit). This patch is a bit more complicated and less straight-forward than the one in #9, as I also had to make changes to the
leaflet.drupal.js
file. Furthermore, the text field that allows users to enter the centre of the map in the Views configuration page isn't very sophisticated, and I would suggest replacing it with some type of text field that is more suitable for geolocation data.I suggest the maintainer proceeds with committing patch #9 to the repository (after it has been confirmed by others that it works). The patch in #10 should also work, and I encourage everyone to test it, but I suggest the maintainer takes a closer look at the changes before committing this one as well.
Comment #12
itamair CreditAttribution: itamair as a volunteer commentedLast dev and 1.0-beta8 release fixed and further enhanced this ...
Comment #13
itamair CreditAttribution: itamair as a volunteer commented