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