Maps SDK for Web

Class L.MapUtils


findLayersByName(layerName, map): Array

This method looks over all layers in the map instance and returns an array of matching layers. If layers are not found, returns empty array.

Name Description Required Type/Values Default
layerName Name of the layers you are looking for Yes String None
map Map instance Yes Map None

Returns an array of matching layers, if no element was found, returns empty array.

getPaddingOptions(components): Object

Name Description Required Type/Values Default
components Object describing how paddings should be calculated Yes Object None
components.popup Popup element which dimensions will be calculated No HTMLElement None
components.controls Object which values describes which control panel is measured and how. possible keys are 'top-left', 'top-right', 'bottom-left', 'bottom-right' and values: 'width', 'height', 'both'. No Object None

Returns an object reflecting measurements on control containers

var popup = marker.openPopup().getPopup();
var popupElement = popup.getElement();
var bounds = L.MapUtils.getPaddingOptions({
     popup: popupElement,
     controls: {
         'top-left': 'width', // only width will be taken into account
         'bottom-right': 'both'

setViewWithOffset(map, targetLatLng, targetZoom, options, offsetPoint)

Name Description Required Type/Values Default
map Map object that is associated with setView method Yes Map None
targetLatLng Point that is the original center of the transformation Yes LatLng None
targetZoom Zoom level that is going to be applied to setView Yes Number None
options Pan and zoom options Yes Object None
offsetPoint Point that represents the shift of the original center point Yes Point None