| 1 |
<?php |
| 2 |
/** |
| 3 |
* KML/KMZ Shortcode |
| 4 |
* |
| 5 |
* Use with [leaflet-kml src="..."] |
| 6 |
* |
| 7 |
* @param array $atts user-input array |
| 8 |
* @return string JavaScript |
| 9 |
*/ |
| 10 |
|
| 11 |
// Exit if accessed directly |
| 12 |
if ( !defined( 'ABSPATH' ) ) exit; |
| 13 |
|
| 14 |
include_once(LEAFLET_MAP__PLUGIN_DIR . 'shortcodes/class.geojson-shortcode.php'); |
| 15 |
|
| 16 |
class Leaflet_Kml_Shortcode extends Leaflet_Geojson_Shortcode { |
| 17 |
/** |
| 18 |
* @var string $type how leaflet renders the src |
| 19 |
*/ |
| 20 |
public static $type = 'kml'; |
| 21 |
/** |
| 22 |
* @var string $default_src default src |
| 23 |
*/ |
| 24 |
public static $default_src = 'https://cdn.rawgit.com/mapbox/togeojson/master/test/data/polygon.kml'; |
| 25 |
} |