WP Manifestindependent plugin directory
manifest / content / cmb2-field-leaflet-geocoder

CMB2 Field Type: Leaflet Maps

Leaflet (with Geocoder) field type for CMB2.

★ 8stars
739composer installs

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/villeristi/cmb2-field-leaflet-geocoder/archive/refs/heads/master.zip

On Packagist as villeristi/cmb2-field-leaflet-geocoder:

composer require villeristi/cmb2-field-leaflet-geocoder
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

A Leaflet (with Geocoder) field type for CMB2.

Installation

Composer

composer require villeristi/cmb2-field-leaflet-geocoder

Manual

  1. Download the plugin
  2. Place the plugin folder in your /wp-content/plugins/ directory
  3. Activate the plugin in the plugins dashboard

Usage

array(
  'id' => $prefix . 'location',
  'name' => __('Coordinates'),
  'desc' => __('Drag the marker after finding the right spot to set the exact coordinates'),
  'type' => 'leaflet_map',
  /*
  For these extra attributes, please consult Leaflet [documentation](http://leafletjs.com/reference-1.0.0.html)
  'attributes' = array(
    'tilelayer'           => 'http://{s}.tile.osm.org/{z}/{x}/{y}.png',
    'searchbox_position'  => 'topright'; // topright, bottomright, topleft, bottomleft,
    'search'              => __( 'Search...' ),
    'not_found'           => __( 'Not found' ),
    'initial_coordinates' => [
        'lat' => 61.9241, // Go Finland!
        'lng' => 25.7482  // Go Finland!
    ],
    'initial_zoom'        => 4 // Zoomlevel when there's no coordinates set,
    'default_zoom'        => 8 // Zoomlevel after the coordinates have been set & page saved
  )
  */
),