Skip to content

Releases: pixelwatt/cmb2-mapbox

v2.0.0-beta1

Choose a tag to compare

@pixelwatt pixelwatt released this 18 May 01:24

Method Theme Integration

The plugin can now register its settings inside the Method theme's unified options page instead of its own admin page. Enable via:

add_filter( 'cmb2_mapbox_use_method', '__return_true' );

When the filter returns true:

  • The standalone "CMB2 Mapbox" options page is suppressed.
  • A new cmb2_mapbox_register_custom_options() callback hooks into method_options_before_fields and appends the Access Token and Map Center fields to Method's options.
  • All option reads pull from the method_options option key instead of cmb2_mapbox.

⚠️ Breaking — Option Key Renames

The two stored option keys have been renamed to be namespace-safe when sharing an option array with other Method modules:

Old New
api_token mapbox_api_token
map_center mapbox_map_center

Existing standalone installs will need to re-enter their access token and map center (or migrate the values manually) after upgrading.

Geocoding on Save

New cmb2_mapbox_geocode( $pid, $kdata, $serialized ) helper performs a forward geocode against the Mapbox Search/Geocode v6 API using the plugin's access token.

  • New field arg geocode_serialized_key points at a post meta key containing a serialized address array (e.g. street/city/state/zip). When set, the field UI renders a Geocode on Save checkbox.
  • Ticking the checkbox before saving will look up the linked address, then overwrite the field's lng, lat, and lnglat values with the geocoded coordinates.
  • The sanitize callback (cmb2_sanitize_mapbox_map_callback) now receives $object_id, $field_args, and $field (signature widened from 2 args to 5; filter priority moved from 10 to 48).

Library Updates

  • Mapbox GL JS: 3.18.0 → 3.23.1
  • mapbox-gl-draw: 1.4.3 → 1.5.1

Internal

  • get_option() calls now route through a single cmb2_mapbox_method() check so the option key resolves correctly in both standalone and Method-integrated modes.
  • CMB2_MB_Map::set_options() defaults updated to the new option key names.

1.5.3

Choose a tag to compare

@pixelwatt pixelwatt released this 04 Apr 03:56

Updated Mapbox libraries to latest versions

1.5.1

Choose a tag to compare

@pixelwatt pixelwatt released this 09 Jul 19:27
1.5.1
c19dff9

Changes:

  • Added key "pitch" to the set_map_options() method for specifying a map's pitch when using the CMB2_MB_Map php class to build a map.
  • Added lnglat sanitization. Now, spaces are removed from the combined lnglate field if present, the lnglat field will automatically be filled with individual lng and lat values if they are specified but lnglat is not, and individual lng and lat values will be filled if lnglat has been specified by indivual values have not.

1.5.0

Choose a tag to compare

@theboldagency theboldagency released this 30 Mar 00:15
1.5.0
10511ea

Added CMB2_MB_Map, map center fallbacks, better array key checks, and option to set default editor zoom.

1.0.3

Choose a tag to compare

@pixelwatt pixelwatt released this 09 Mar 12:15
db37aa5

Minor fixes.

1.0.2

Choose a tag to compare

@pixelwatt pixelwatt released this 08 Mar 21:10
a0f6452

This release upgrades mapbox-gl to v2.1.1 and mapbox-gl-draw to v1.2.2

Input ID fix.

Choose a tag to compare

@pixelwatt pixelwatt released this 02 Dec 22:24
932900b

This version fixes references to hidden input IDs that caused the field to not place markers unless the meta key was set as "map"