Skip to content

Commit e53d5aa

Browse files
author
bozdoz
committed
added default gpx src; added examples for kml and gpx
1 parent 5972fec commit e53d5aa

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,6 @@
2727
"homepage": "https://github.com/bozdoz/wp-plugin-leaflet-map#readme",
2828
"devDependencies": {
2929
"minify": "^3.0.2"
30-
}
30+
},
31+
"dependencies": {}
3132
}

shortcodes/class.gpx-shortcode.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,11 @@ class Leaflet_Gpx_Shortcode extends Leaflet_Geojson_Shortcode
2828
* @var string $type
2929
*/
3030
public static $type = 'gpx';
31+
32+
/**
33+
* Default src
34+
*
35+
* @var string $default_src
36+
*/
37+
public static $default_src = 'https://cdn.rawgit.com/mapbox/togeojson/master/test/data/run.gpx';
3138
}

templates/shortcode-helper.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,21 @@
9797
'[leaflet-map address="las vegas" boxZoom=false doubleClickZoom=false dragging=false keyboard=false scrollwheel=0 attribution=0]',
9898
),
9999
__("Add GeoJSON by URL (with popups)", 'leaflet-map') => array(
100-
'[leaflet-map doubleClickZoom=true scrollwheel=true]',
101-
'[leaflet-geojson src=https://cdn.rawgit.com/bozdoz/064a7101b95a324e8852fe9381ab9a18/raw/03f4f54b13a3a7e256732760a8b679818d9d36fc/map.geojson fitbounds popup_property="popup-text"]'
100+
'[leaflet-map fitbounds doubleClickZoom scrollwheel]',
101+
'[leaflet-geojson src=https://cdn.rawgit.com/bozdoz/064a7101b95a324e8852fe9381ab9a18/raw/03f4f54b13a3a7e256732760a8b679818d9d36fc/map.geojson]{popup-text}[/leaflet-geojson]'
102+
),
103+
__("Add KML by URL", 'leaflet-map') => array(
104+
'[leaflet-map fitbounds]',
105+
'[leaflet-kml src=https://cdn.rawgit.com/mapbox/togeojson/master/test/data/polygon.kml fillColor=red color=white]'
106+
),
107+
__("Add GPX by URL", 'leaflet-map') => array(
108+
'[leaflet-map fitbounds]',
109+
'[leaflet-gpx src=https://cdn.rawgit.com/mapbox/togeojson/master/test/data/run.gpx color=black]'
102110
),
103111
__("Image Map", 'leaflet-map') => array(
104112
'[leaflet-image zoom=1 zoomcontrol scrollwheelzoom attribution=0]',
105113
'[leaflet-marker]'
106-
)
114+
),
107115
);
108116

109117
foreach ($examples as $title => $collection) {

0 commit comments

Comments
 (0)