Global

Methods

calcBorder(center, length) → {float}

calculate x or y pixel from center and height/width
Parameters:
Name Type Description
center float xcenter or ycenter pixel from element
length float width or height from element
Source:
Returns:
returns borderpixel
Type
float

calcCenter(center, length) → {float}

calculate xcenter or ycenter pixel from pixel and height/width
Parameters:
Name Type Description
center float xcenter or ycenter pixel from element
length float width or height from element
Source:
Returns:
returns centerpixel
Type
float

createLabelIcon(labelClass, element) → {divIcon}

Create the Location Labels as custom div markers instead of an image. height and width is hardcoded into the div.
Parameters:
Name Type Description
labelClass string custom classname for divIcon
element Object custom element with location-name and location-adress
Source:
Returns:
returns icon
Type
divIcon

detectOverlap(elements) → {Array}

detects overlapping elements and returns a list with overlapping arrays.
Parameters:
Name Type Description
elements Object list of elements
Source:
Returns:
returns multidimensional array of overlapping elements.
Type
Array

isOverlapping(rect1, rect1) → {boolean}

Tests if 2 rectangles are overlapping, returns true or false
Parameters:
Name Type Description
rect1 element and rect2 are 2 elements
rect1 element and rect2 are 2 elements
Source:
Returns:
true if overlapping, false else
Type
boolean

markerDelAgain()

Removes all Markers from the map. Needed for different Zoom levels.
Source:

merge(left, {Object, dimension) → {Array.<Object>}

merges lists of elements together
Parameters:
Name Type Description
left Object list of elements
{Object right - list of elements
dimension boolean 0 for x dimension, 1 for y dimension
Source:
Returns:
returns Array of elements with new overlaps
Type
Array.<Object>

orderRepair(elements, dimension) → {Array.<Object>}

Modified version of MERGE-SORT. removeOverlap can introduce orthogonal order errors. orderRepair pushes elements with a wrong orthogonal order on the same spot. ( seperate for x and y direction ) After that, removeOverlap can be applied again to the new overlapping elements.
Parameters:
Name Type Description
elements Object list of elements
dimension boolean 0 for x dimension, 1 for y dimension
Source:
Returns:
returns Array of elements with new overlaps
Type
Array.<Object>

removeOverlap(rect1, rect1)

removes overlap of 2 elements in the shortest overlap direction
Parameters:
Name Type Description
rect1 element and rect2 are 2 elements
rect1 element and rect2 are 2 elements
Source:

start()

Initialize all found elements and create the markers with corrected order and no overlap
Source: