Class: BoundsEdgeLocationStrategy

lucid.maps.limbs.location. BoundsEdgeLocationStrategy

A location strategy that uses the corner or an edge-centre-point of the target's bounding box.This location strategy takes the bounding box of the target shapeand determines which corner or edge of the bounding box is nearest the map viewport.The point location of the 2D shape is taken to be either the closest corner ora point along the nearest edge of the bounding box.

new BoundsEdgeLocationStrategy(options)

Parameters:
Name Type Description
options lucid.maps.limbs.location.CentreLocationStrategyOptions The options controlling the location calculation.
Source:

Methods

<inner> computeHorizontalEdgeXCoordinate(targetBounds, mapBounds) → {number}

Determine an 'appropriate' point along the horizontal edge of the target bounds.
Parameters:
Name Type Description
targetBounds google.maps.LatLngBounds The bounds of the target object.
mapBounds google.maps.LatLngBounds The bounds of the current map view.
Source:
Returns:
The x-coordinate along the horizontal edge of the target bounds that is closest to the map bounds.
Type
number

<inner> computeVerticalEdgeYCoordinate(targetBounds, mapBounds) → {number}

Determine an 'appropriate' point along the vertical edge of the target bounds.
Parameters:
Name Type Description
targetBounds google.maps.LatLngBounds The bounds of the target object.
mapBounds google.maps.LatLngBounds The bounds of the current map view.
Source:
Returns:
The y-coordinate along the vertical edge of the target bounds that is closest to the map bounds.
Type
number

<inner> nearestCornerOrEdgePoint(targetBounds, mapBounds) → {google.maps.LatLng}

Determine in which of eight zones (N, NE, E, SE, S, SW, W, NW) the target object lies.Then calculate the nearest corner point or point along the nearest edge to the map view.When the target lies beyond the corner of the map (NE, NW, SE, SW)then the corner of the target's bounding box is used as the 'nearest' point.When the target lies beyond the side of the map (N, S, E, W)then a point on the closest edge of bounding box is used as the 'nearest' point.
Parameters:
Name Type Description
targetBounds google.maps.LatLngBounds The bounds of the target object.
mapBounds google.maps.LatLngBounds The bounds of the current map view.
Source:
Returns:
The point on the target bounds that is closest to the map bounds.
Type
google.maps.LatLng