Changeset 1771879 for leaflet-map
- Timestamp:
- 11/20/2017 11:03:44 PM (8 years ago)
- Location:
- leaflet-map
- Files:
-
- 2 added
- 3 deleted
- 6 edited
- 25 copied
-
tags/2.9 (copied) (copied from leaflet-map/trunk)
-
tags/2.9/CODE_OF_CONDUCT.md (copied) (copied from leaflet-map/trunk/CODE_OF_CONDUCT.md)
-
tags/2.9/CONTRIBUTING.md (copied) (copied from leaflet-map/trunk/CONTRIBUTING.md)
-
tags/2.9/LICENSE (copied) (copied from leaflet-map/trunk/LICENSE)
-
tags/2.9/README.md (copied) (copied from leaflet-map/trunk/README.md)
-
tags/2.9/class.admin.php (copied) (copied from leaflet-map/trunk/class.admin.php)
-
tags/2.9/class.geocoder.php (copied) (copied from leaflet-map/trunk/class.geocoder.php)
-
tags/2.9/class.leaflet-map.php (copied) (copied from leaflet-map/trunk/class.leaflet-map.php) (2 diffs)
-
tags/2.9/class.plugin-option.php (copied) (copied from leaflet-map/trunk/class.plugin-option.php)
-
tags/2.9/class.plugin-settings.php (copied) (copied from leaflet-map/trunk/class.plugin-settings.php)
-
tags/2.9/leaflet-map.php (copied) (copied from leaflet-map/trunk/leaflet-map.php) (1 diff)
-
tags/2.9/readme.txt (copied) (copied from leaflet-map/trunk/readme.txt) (4 diffs)
-
tags/2.9/scripts/construct-leaflet-map.js (copied) (copied from leaflet-map/trunk/scripts/construct-leaflet-map.js)
-
tags/2.9/scripts/get-shortcode.js (copied) (copied from leaflet-map/trunk/scripts/get-shortcode.js)
-
tags/2.9/scripts/leaflet-ajax-geojson.js (copied) (copied from leaflet-map/trunk/scripts/leaflet-ajax-geojson.js) (3 diffs)
-
tags/2.9/shortcodes (copied) (copied from leaflet-map/trunk/shortcodes)
-
tags/2.9/shortcodes/class.geojson-shortcode.php (copied) (copied from leaflet-map/trunk/shortcodes/class.geojson-shortcode.php) (3 diffs)
-
tags/2.9/shortcodes/class.gpx-shortcode.php (added)
-
tags/2.9/shortcodes/class.image-shortcode.php (copied) (copied from leaflet-map/trunk/shortcodes/class.image-shortcode.php)
-
tags/2.9/shortcodes/class.kml-shortcode.php (copied) (copied from leaflet-map/trunk/shortcodes/class.kml-shortcode.php) (1 diff)
-
tags/2.9/shortcodes/class.map-shortcode.php (copied) (copied from leaflet-map/trunk/shortcodes/class.map-shortcode.php)
-
tags/2.9/shortcodes/class.marker-shortcode.php (copied) (copied from leaflet-map/trunk/shortcodes/class.marker-shortcode.php)
-
tags/2.9/shortcodes/class.shortcode.php (copied) (copied from leaflet-map/trunk/shortcodes/class.shortcode.php)
-
tags/2.9/style.css (copied) (copied from leaflet-map/trunk/style.css)
-
tags/2.9/templates/admin.php (deleted)
-
tags/2.9/templates/find-on-map.php (deleted)
-
tags/2.9/templates/settings.php (copied) (copied from leaflet-map/trunk/templates/settings.php)
-
tags/2.9/templates/shortcode-helper.php (copied) (copied from leaflet-map/trunk/templates/shortcode-helper.php)
-
trunk/class.leaflet-map.php (modified) (2 diffs)
-
trunk/leaflet-map.php (modified) (1 diff)
-
trunk/readme.txt (modified) (4 diffs)
-
trunk/scripts/leaflet-ajax-geojson.js (modified) (3 diffs)
-
trunk/scripts/leaflet-ajax-kml.js (deleted)
-
trunk/shortcodes/class.geojson-shortcode.php (modified) (3 diffs)
-
trunk/shortcodes/class.gpx-shortcode.php (added)
-
trunk/shortcodes/class.kml-shortcode.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
leaflet-map/tags/2.9/class.leaflet-map.php
r1712964 r1771879 44 44 'file' => 'class.kml-shortcode.php', 45 45 'class' => 'Leaflet_Kml_Shortcode' 46 ), 47 'leaflet-gpx' => array( 48 'file' => 'class.gpx-shortcode.php', 49 'class' => 'Leaflet_Gpx_Shortcode' 46 50 ), 47 51 'leaflet-line' => array( … … 178 182 179 183 // optional ajax geojson plugin 180 wp_register_script('leaflet_ajax_geojson_js', plugins_url('scripts/leaflet-ajax-geojson.js', __FILE__), Array('leaflet_js',), self::$version, false);181 182 184 wp_register_script('tmcw_togeojson', 'https://cdn.rawgit.com/mapbox/togeojson/master/togeojson.js', Array('jquery'), self::$version, false); 183 185 184 wp_register_script('leaflet_ajax_ kml_js', plugins_url('scripts/leaflet-ajax-kml.js', __FILE__), Array('tmcw_togeojson', 'leaflet_js', 'leaflet_ajax_geojson_js'), self::$version, false);185 186 wp_register_script('leaflet_ajax_geojson_js', plugins_url('scripts/leaflet-ajax-geojson.js', __FILE__), Array('tmcw_togeojson', 'leaflet_js'), self::$version, false); 187 186 188 /* run a construct function in the document head for subsequent functions to use (it is lightweight) */ 187 189 wp_enqueue_script('leaflet_map_construct', plugins_url('scripts/construct-leaflet-map.js', __FILE__), Array(), self::$version, false); -
leaflet-map/tags/2.9/leaflet-map.php
r1720896 r1771879 6 6 Author: bozdoz 7 7 Author URI: https://twitter.com/bozdoz/ 8 Version: 2. 8.68 Version: 2.9 9 9 License: GPL2 10 10 -
leaflet-map/tags/2.9/readme.txt
r1720896 r1771879 7 7 Tags: leaflet, map, mobile, javascript, openstreetmap, mapquest, interactive 8 8 Requires at least: 3.0.1 9 Tested up to: 4. 8.110 Version: 2. 8.611 Stable tag: 2. 8.69 Tested up to: 4.9 10 Version: 2.9 11 Stable tag: 2.9 12 12 License: GPLv2 13 13 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 80 80 Yes, just give it a source URL: `[leaflet-geojson src="https://example.com/path/to.geojson"]` It will also support leaflet geojson styles or geojson.io styles. Add a popup message with `[leaflet-geojson popup_text="hello!"]`, or add HTML by adding it to the content of the shortcode: `[leaflet-geojson]<a href="#">Link here</a>[/leaflet-geojson]` or identify a geojson property with `popup_property`, and each shape will use its own popup text if available. 81 81 82 = Can I add kml ? =83 84 Sure!? Use the same attributes as leaflet-geojson (above), but use the `[leaflet-kml]` shortcode.82 = Can I add kml/gpx? = 83 84 Sure!? Use the same attributes as leaflet-geojson (above), but use the `[leaflet-kml]` or `[leaflet-gpx]` shortcode. 85 85 86 86 = Can I add a message to a marker? = … … 122 122 123 123 = 2.8.6 = 124 * Added [leaflet-gpx] for GPX format 125 126 = 2.8.6 = 124 127 * Fix image shortcode ratio 125 128 … … 262 265 263 266 = 2.8.6 = 267 Added [leaflet-gpx] for GPX format 268 269 = 2.8.6 = 264 270 Fix image shortcode ratio 265 271 -
leaflet-map/tags/2.9/scripts/leaflet-ajax-geojson.js
r1562379 r1771879 1 1 L.AjaxGeoJSON = L.GeoJSON.extend({ 2 options : {}, 2 options : { 3 type: 'json' // 'json|kml|gpx' 4 }, 3 5 4 6 initialize : function (url, options) { … … 10 12 onAdd : function (map) { 11 13 var _this = this, 14 type = this.options.type, 12 15 xhr; 13 16 … … 23 26 if (xhr.readyState === xhr.DONE && 24 27 xhr.status === 200) { 25 data = JSON.parse( xhr.responseText ); 28 if (type === 'json') { 29 data = JSON.parse( xhr.responseText ); 30 } else if (['kml', 'gpx'].indexOf(type) !== -1) { 31 data = window.toGeoJSON[ type ]( xhr.responseXML ); 32 } 26 33 _this.json = data; 27 34 _this.layer.addData( data ); -
leaflet-map/tags/2.9/shortcodes/class.geojson-shortcode.php
r1710942 r1771879 16 16 class Leaflet_Geojson_Shortcode extends Leaflet_Shortcode { 17 17 /** 18 * @var string $wp_script to enqueue19 */20 public static $wp_script = 'leaflet_ajax_geojson_js';21 /**22 * @var string $L_method how leaflet renders the src23 */24 public static $L_method = 'ajaxGeoJson';25 /**26 18 * @var string $default_src default src 27 19 */ 28 20 public static $default_src = 'https://rawgit.com/bozdoz/567817310f102d169510d94306e4f464/raw/2fdb48dafafd4c8304ff051f49d9de03afb1718b/map.geojson'; 21 22 /** 23 * @var string $type how leaflet renders the src 24 */ 25 public static $type = 'json'; 29 26 30 27 protected function getHTML ($atts, $content) { … … 35 32 if ($atts) extract($atts); 36 33 37 wp_enqueue_script( $class::$wp_script);34 wp_enqueue_script( 'leaflet_ajax_geojson_js' ); 38 35 39 36 if ($content) { … … 76 73 'stroke-width' : 'width', 77 74 }, 78 layer = L.<?php echo $class::$L_method; ?>(src, { 75 layer = L.ajaxGeoJson(src, { 76 type: '<?php echo $class::$type; ?>', 79 77 style : layerStyle, 80 78 onEachFeature : onEachFeature -
leaflet-map/tags/2.9/shortcodes/class.kml-shortcode.php
r1710942 r1771879 16 16 class Leaflet_Kml_Shortcode extends Leaflet_Geojson_Shortcode { 17 17 /** 18 * @var string $ wp_script to enqueue18 * @var string $type how leaflet renders the src 19 19 */ 20 public static $wp_script = 'leaflet_ajax_kml_js'; 21 /** 22 * @var string $L_method how leaflet renders the src 23 */ 24 public static $L_method = 'ajaxKML'; 20 public static $type = 'kml'; 25 21 /** 26 22 * @var string $default_src default src -
leaflet-map/trunk/class.leaflet-map.php
r1712964 r1771879 44 44 'file' => 'class.kml-shortcode.php', 45 45 'class' => 'Leaflet_Kml_Shortcode' 46 ), 47 'leaflet-gpx' => array( 48 'file' => 'class.gpx-shortcode.php', 49 'class' => 'Leaflet_Gpx_Shortcode' 46 50 ), 47 51 'leaflet-line' => array( … … 178 182 179 183 // optional ajax geojson plugin 180 wp_register_script('leaflet_ajax_geojson_js', plugins_url('scripts/leaflet-ajax-geojson.js', __FILE__), Array('leaflet_js',), self::$version, false);181 182 184 wp_register_script('tmcw_togeojson', 'https://cdn.rawgit.com/mapbox/togeojson/master/togeojson.js', Array('jquery'), self::$version, false); 183 185 184 wp_register_script('leaflet_ajax_ kml_js', plugins_url('scripts/leaflet-ajax-kml.js', __FILE__), Array('tmcw_togeojson', 'leaflet_js', 'leaflet_ajax_geojson_js'), self::$version, false);185 186 wp_register_script('leaflet_ajax_geojson_js', plugins_url('scripts/leaflet-ajax-geojson.js', __FILE__), Array('tmcw_togeojson', 'leaflet_js'), self::$version, false); 187 186 188 /* run a construct function in the document head for subsequent functions to use (it is lightweight) */ 187 189 wp_enqueue_script('leaflet_map_construct', plugins_url('scripts/construct-leaflet-map.js', __FILE__), Array(), self::$version, false); -
leaflet-map/trunk/leaflet-map.php
r1720896 r1771879 6 6 Author: bozdoz 7 7 Author URI: https://twitter.com/bozdoz/ 8 Version: 2. 8.68 Version: 2.9 9 9 License: GPL2 10 10 -
leaflet-map/trunk/readme.txt
r1720896 r1771879 7 7 Tags: leaflet, map, mobile, javascript, openstreetmap, mapquest, interactive 8 8 Requires at least: 3.0.1 9 Tested up to: 4. 8.110 Version: 2. 8.611 Stable tag: 2. 8.69 Tested up to: 4.9 10 Version: 2.9 11 Stable tag: 2.9 12 12 License: GPLv2 13 13 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 80 80 Yes, just give it a source URL: `[leaflet-geojson src="https://example.com/path/to.geojson"]` It will also support leaflet geojson styles or geojson.io styles. Add a popup message with `[leaflet-geojson popup_text="hello!"]`, or add HTML by adding it to the content of the shortcode: `[leaflet-geojson]<a href="#">Link here</a>[/leaflet-geojson]` or identify a geojson property with `popup_property`, and each shape will use its own popup text if available. 81 81 82 = Can I add kml ? =83 84 Sure!? Use the same attributes as leaflet-geojson (above), but use the `[leaflet-kml]` shortcode.82 = Can I add kml/gpx? = 83 84 Sure!? Use the same attributes as leaflet-geojson (above), but use the `[leaflet-kml]` or `[leaflet-gpx]` shortcode. 85 85 86 86 = Can I add a message to a marker? = … … 122 122 123 123 = 2.8.6 = 124 * Added [leaflet-gpx] for GPX format 125 126 = 2.8.6 = 124 127 * Fix image shortcode ratio 125 128 … … 262 265 263 266 = 2.8.6 = 267 Added [leaflet-gpx] for GPX format 268 269 = 2.8.6 = 264 270 Fix image shortcode ratio 265 271 -
leaflet-map/trunk/scripts/leaflet-ajax-geojson.js
r1562379 r1771879 1 1 L.AjaxGeoJSON = L.GeoJSON.extend({ 2 options : {}, 2 options : { 3 type: 'json' // 'json|kml|gpx' 4 }, 3 5 4 6 initialize : function (url, options) { … … 10 12 onAdd : function (map) { 11 13 var _this = this, 14 type = this.options.type, 12 15 xhr; 13 16 … … 23 26 if (xhr.readyState === xhr.DONE && 24 27 xhr.status === 200) { 25 data = JSON.parse( xhr.responseText ); 28 if (type === 'json') { 29 data = JSON.parse( xhr.responseText ); 30 } else if (['kml', 'gpx'].indexOf(type) !== -1) { 31 data = window.toGeoJSON[ type ]( xhr.responseXML ); 32 } 26 33 _this.json = data; 27 34 _this.layer.addData( data ); -
leaflet-map/trunk/shortcodes/class.geojson-shortcode.php
r1710942 r1771879 16 16 class Leaflet_Geojson_Shortcode extends Leaflet_Shortcode { 17 17 /** 18 * @var string $wp_script to enqueue19 */20 public static $wp_script = 'leaflet_ajax_geojson_js';21 /**22 * @var string $L_method how leaflet renders the src23 */24 public static $L_method = 'ajaxGeoJson';25 /**26 18 * @var string $default_src default src 27 19 */ 28 20 public static $default_src = 'https://rawgit.com/bozdoz/567817310f102d169510d94306e4f464/raw/2fdb48dafafd4c8304ff051f49d9de03afb1718b/map.geojson'; 21 22 /** 23 * @var string $type how leaflet renders the src 24 */ 25 public static $type = 'json'; 29 26 30 27 protected function getHTML ($atts, $content) { … … 35 32 if ($atts) extract($atts); 36 33 37 wp_enqueue_script( $class::$wp_script);34 wp_enqueue_script( 'leaflet_ajax_geojson_js' ); 38 35 39 36 if ($content) { … … 76 73 'stroke-width' : 'width', 77 74 }, 78 layer = L.<?php echo $class::$L_method; ?>(src, { 75 layer = L.ajaxGeoJson(src, { 76 type: '<?php echo $class::$type; ?>', 79 77 style : layerStyle, 80 78 onEachFeature : onEachFeature -
leaflet-map/trunk/shortcodes/class.kml-shortcode.php
r1710942 r1771879 16 16 class Leaflet_Kml_Shortcode extends Leaflet_Geojson_Shortcode { 17 17 /** 18 * @var string $ wp_script to enqueue18 * @var string $type how leaflet renders the src 19 19 */ 20 public static $wp_script = 'leaflet_ajax_kml_js'; 21 /** 22 * @var string $L_method how leaflet renders the src 23 */ 24 public static $L_method = 'ajaxKML'; 20 public static $type = 'kml'; 25 21 /** 26 22 * @var string $default_src default src
Note: See TracChangeset
for help on using the changeset viewer.