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.
Adding a fullscreen button underneath the zoom controls would be a great default or optional feature.
I found this plugin that does exactly what I mean, maybe it can be integrated in the leaflet module?
http://brunob.github.io/leaflet.fullscreen/
Great module by the way!
Comments
Comment #1
danon1981 CreditAttribution: danon1981 commentedComment #2
interdruper CreditAttribution: interdruper commentedIt should be not difficult to get it running after doing minor changes to your theme's .info file and to leaflet.drupal.js file:
add the following lines:
Let me know if it works...
Comment #3
danon1981 CreditAttribution: danon1981 commentedThanks for the suggestion although I think this is a good feature to be included in the module not something that needs to be created for each individual use.
Comment #4
jmanny CreditAttribution: jmanny commentedThanks, but is not working for me. I'm using Leaflet 7.x-1.0-beta3, is it the version?
Comment #5
jmanny CreditAttribution: jmanny commentedGot it working, thanks to @interdruper.
For those using Leaflet Markercluster 7.x-1.0-beta1 add these two lines to leaflet_markercluster.drupal.js instead of leaflet.drupal.js
Chrome ok
Firefox ok
Safari 6.0.5 not working
Comment #6
danon1981 CreditAttribution: danon1981 commentedIf someone is going to follow the instructions above, also change the following to match the look of the controls.
Around line 8 of Control.FullScreen.js
Change
Into
And for hover effect make a sprite image.
Comment #7
vistree CreditAttribution: vistree commentedThis works great! Combining #2 and #6 work great for me!!
Can anyone explane how we can extend the leaflet.widget (https://drupal.org/project/leaflet_widget) to get fullscreen in edit mode?
Comment #8
suburbanmarx CreditAttribution: suburbanmarx commentedI too was able to make this work with leaflet-markercluster as mentioned in comment#5, however, wasn't able to make the map be fullscreen by default upon load.
Any ideas on how to do this? I thought there would be some statement I could modify in the javascript to set the default fullscreen, but haven't been able to find it. Will keep trying. Sorry for the ignorant question- I have no experience with javascript whatsoever.
Comment #9
jmanny CreditAttribution: jmanny commentedFullscreen by default is a great idea. If you have any news let us know.
Comment #10
RdeBoerFYI, http://drupal.org/project/ip_geoloc has had a Fullscreen option for a while. It is not full-screen by default, though.
Comment #11
Bram Linssen CreditAttribution: Bram Linssen commentedWith the function hook_leaflet_map_info() it is possible to set
fullscreenControl: true
without altering the leaflet.drupal.js or leaflet_markercluster.drupal.js file.Just add
'fullscreenControl' => TRUE,
to the settings array as in the example below.Add this function to a custom module and select the map.
(You still need to add the Control.FullScreen.css and Control.FullScreen.js files to the relevant webpages)
Comment #12
clemens.tolboomThanks for the hints. This is what I did including .info from #2
Comment #13
sano CreditAttribution: sano commentedNone of these instructions work for drupal installation which include the IP Geolocation Views & Maps module. While that module contains its own (working) implementation of the fullscreen control, it is missing some other features that patched base leaflet offers (dynamic styling of vector objects). That's one reason why somebody might want to use IPGV on some pages and Leaflet Views on another. Apparently this has some drawbacks. :-(Edit: The .css and .js files I downloaded were corrupted. After fixing that I still didn't see the control, but I realized that I have the Markercluster module installed, so I made the change as advised in #5 - and the control showed up. Thanks everybody.