Function
getLayoutStylesByPosition
(mapCanvasProjection, offset, position)
Source from the content-addressed store, hash-verified
| 54 | } |
| 55 | |
| 56 | function getLayoutStylesByPosition(mapCanvasProjection, offset, position) { |
| 57 | const point = mapCanvasProjection.fromLatLngToDivPixel(position) |
| 58 | if (point) { |
| 59 | const { x, y } = point |
| 60 | return { |
| 61 | left: `${x + offset.x}px`, |
| 62 | top: `${y + offset.y}px`, |
| 63 | } |
| 64 | } |
| 65 | return { |
| 66 | left: `-9999px`, |
| 67 | top: `-9999px`, |
| 68 | } |
| 69 | } |
| 70 | |
| 71 | export function getLayoutStyles(mapCanvasProjection, offset, props) { |
| 72 | if (props.bounds) { |
Tested by
no test coverage detected