Is there a way, either through PHP or JS, to adjust the amount of padding that markers are given when the map's centering is set to Auto-box? The problem is that some of the maps show only the marker's tip and not the whole marker, effectively making the marker invisible. I need to map's bounds to be increased to show the whole marker. I'm using Leaflet.
Comments
Comment #1
rdeboerHi okeedoak,
I feel this is very much a question for the Leaflet module issue queue.
Reassigning.
Comment #2
pvhee commentedThis is caused by Leaflet, not by the module.
If you want to manually fix the fitting of the markers in a custom module, you could register the following javascript:
Comment #3
okeedoak commentedThanks, I'll try this out.
Comment #4
codenamerhubarb commentedA quick hack solution for me was to edit leaflet.js (sites/all/libraries/leaflet/leaflet.js)...
Replace the 2 occurrences of "e.padding||[0,0]" with "e.padding||[50,50]"
Comment #5
mstrelan commentedI'm reopening this because leaflet has a native way of supporting this and no hacks are required. The
fitBounds()function can take padding as an argument. See http://leafletjs.com/reference.html#map-padding.#2348449: options not passed to several Leaflet JavaScript functions seems to touch on this, but we need somewhere to set options to be passed to fitBounds.
For now I will override Drupal.leaflet.fitBounds.
Comment #6
chucksimply commented#5 worked for me when overrides were made to the actual leaflet module in leaflet.drupal.js