MCPcopy Create free account
hub / github.com/tomchentw/react-google-maps / getLayoutStylesByPosition

Function getLayoutStylesByPosition

src/utils/OverlayViewHelper.js:56–69  ·  view source on GitHub ↗
(mapCanvasProjection, offset, position)

Source from the content-addressed store, hash-verified

54}
55
56function 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
71export function getLayoutStyles(mapCanvasProjection, offset, props) {
72 if (props.bounds) {

Callers 1

getLayoutStylesFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected