Skip to main content

PDF for GravityView Hooks – gfpdf_gv_static_map_max_markers

Description​

Sets the most markers the Multiple Entries Map widget can place on its map. The default is 100.

The widget draws one map for every entry in the PDF. Markers are added in the order entries appear in the PDF. Entries with no location are skipped, and entries at the same spot share one marker. Once the map is full, later entries are left off and the caption under the map shows how many made it on, for example "Map shows 100 of 240 entries."

Lower the limit for a cleaner map, or raise it when your entries are spread out enough to fit more.

Version​

This hook was introduced in PDF for GravityView 2.0.

Arguments​

The following arguments are passed to functions that use this hook:

$max | int​

  • The most markers one map can hold.
  • Values below 1 are treated as 1.
  • The default value is 100.

Usage​

Allow up to 250 markers on the map:

add_filter( 'gfpdf_gv_static_map_max_markers', function( $max ) {
return 250;
} );

Keep the map to the first 25 entries:

add_filter( 'gfpdf_gv_static_map_max_markers', function( $max ) {
return 25;
} );
note

With several hundred markers, Google's request length limit can drop more markers than this setting does. Those aren't counted in the caption. See Differences from the website map.

Source Code​

This filter is located in src/Pdf/Maps/StaticMapRenderer.php of the PDF for GravityView extension.