| 1 |
<?php |
| 2 |
/** |
| 3 |
* KML/KMZ Shortcode |
| 4 |
* |
| 5 |
* Use with [leaflet-kml src="..."] |
| 6 |
* |
| 7 |
* @category Shortcode |
| 8 |
* @author Benjamin J DeLong <ben@bozdoz.com> |
| 9 |
*/ |
| 10 |
|
| 11 |
// Exit if accessed directly |
| 12 |
if (!defined('ABSPATH')) { |
| 13 |
exit; |
| 14 |
} |
| 15 |
|
| 16 |
require_once LEAFLET_MAP__PLUGIN_DIR . 'shortcodes/class.geojson-shortcode.php'; |
| 17 |
|
| 18 |
/** |
| 19 |
* Leaflet KML Shortcode |
| 20 |
*/ |
| 21 |
class Leaflet_Kml_Shortcode extends Leaflet_Geojson_Shortcode |
| 22 |
{ |
| 23 |
|
| 24 |
/** |
| 25 |
* How leaflet renders the src |
| 26 |
* |
| 27 |
* @var string $type |
| 28 |
*/ |
| 29 |
protected $type = 'kml'; |
| 30 |
|
| 31 |
/** |
| 32 |
* Default src |
| 33 |
* |
| 34 |
* @var string $default_src |
| 35 |
*/ |
| 36 |
protected $default_src = 'https://cdn.jsdelivr.net/gh/mapbox/togeojson@master/test/data/polygon.kml'; |
| 37 |
} |