export const getCenterWithOffset = ({ map, lat, lng, xPixelOffset, yPixelOffset, }) => {
    var _a, _b, _c;
    const scale = Math.pow(2, ((_a = map.getZoom()) !== null && _a !== void 0 ? _a : 0));
    const worldCoordinateCenter = (_b = map.getProjection()) === null || _b === void 0 ? void 0 : _b.fromLatLngToPoint({
        lat,
        lng,
    });
    const pixelOffset = new google.maps.Point(xPixelOffset / scale || 0, yPixelOffset / scale || 0);
    if (worldCoordinateCenter) {
        const worldCoordinateNewCenter = new google.maps.Point(worldCoordinateCenter.x - pixelOffset.x, worldCoordinateCenter.y + pixelOffset.y);
        const newCenter = (_c = map
            .getProjection()) === null || _c === void 0 ? void 0 : _c.fromPointToLatLng(worldCoordinateNewCenter);
        return newCenter;
    }
    return null;
};
//# sourceMappingURL=getCenterWithOffset.js.map