Skip to main content

Filter: gfpdf_gv_static_map_viewport

Filter the viewport (centre + zoom) used for the Static Map.

Defaults to null on every map — the PDF never derives a centre from the request — so returning a value here is the only way to override the default marker-fit framing. Return null to keep it, or an array [ 'lat' => float, 'lng' => float, 'zoom' => int\|null ] to force a centre. A null zoom keeps the View's configured zoom.

Parameters

NameTypeDescription
$viewportarray|nullAlways null by default.
$view\View
$entryarray
$field\GV\Field|\GV\Widget|nullThe entry_map field being rendered — or, on a map drawn over a whole result set, the Map widget it is drawn for.
$contextstringRenderContext::SINGLE or RenderContext::DIRECTORY.

Since

  • 2.0

Source

Defined in src/Pdf/Maps/StaticMapRenderer.php at line 1540