Last active
December 21, 2015 03:38
-
-
Save steffenr/6243299 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Set zoom for leaflet map on specific pages. | |
| $(document).bind('leaflet.map', function(e, map, lMap) { | |
| // Zoom out map on specific node pages. | |
| if ($('body').hasClass('node-type-YOURNODETYPE')) { | |
| lMap.setZoom(10); | |
| } | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Implements hook_leaflet_map_info_alter() | |
| */ | |
| function mymodulde_leaflet_map_info_alter(&$maps) { | |
| // Prevent zooming by scroll. | |
| $maps['google-roadmap']['settings']['doubleClickZoom'] = FALSE; | |
| $maps['google-roadmap']['settings']['scrollWheelZoom'] = FALSE; | |
| // Set zoom level for all maps. | |
| $maps['google-roadmap']['settings']['zoom'] = 15; | |
| } | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment