# leaflet-map/trunk/shortcodes/class.kml-shortcode.php

Leaflet Map, version trunk. 37 lines.

- Page: https://pluginprobe.com/plugins/leaflet-map/trunk/code/shortcodes/class.kml-shortcode.php
- Raw: https://pluginprobe.com/plugins/leaflet-map/trunk/raw/shortcodes/class.kml-shortcode.php
- Modified: 2021-06-30T04:22:06+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/leaflet-map/trunk/code/shortcodes/class.kml-shortcode.php#L10-L20`.

```php
<?php
/**
 * KML/KMZ Shortcode
 *
 * Use with [leaflet-kml src="..."]
 * 
 * @category Shortcode
 * @author   Benjamin J DeLong <ben@bozdoz.com>
 */

// Exit if accessed directly
if (!defined('ABSPATH')) {
    exit;
}

require_once LEAFLET_MAP__PLUGIN_DIR . 'shortcodes/class.geojson-shortcode.php';

/**
 * Leaflet KML Shortcode
 */
class Leaflet_Kml_Shortcode extends Leaflet_Geojson_Shortcode
{
    
    /**
     * How leaflet renders the src
     * 
     * @var string $type 
     */
    protected $type = 'kml';
    
    /**
     * Default src
     * 
     * @var string $default_src
     */
    protected $default_src = 'https://cdn.jsdelivr.net/gh/mapbox/togeojson@master/test/data/polygon.kml';
}
```
