Changeset 1562359 for leaflet-map
- Timestamp:
- 12/27/2016 03:37:05 AM (9 years ago)
- Location:
- leaflet-map
- Files:
-
- 2 edited
- 3 copied
-
tags/2.3.0 (copied) (copied from leaflet-map/trunk)
-
tags/2.3.0/leaflet-map.php (copied) (copied from leaflet-map/trunk/leaflet-map.php) (7 diffs)
-
tags/2.3.0/readme.txt (copied) (copied from leaflet-map/trunk/readme.txt) (4 diffs)
-
trunk/leaflet-map.php (modified) (7 diffs)
-
trunk/readme.txt (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
leaflet-map/tags/2.3.0/leaflet-map.php
r1562348 r1562359 6 6 Plugin Name: Leaflet Map 7 7 Description: A plugin for creating a Leaflet JS map with a shortcode. Boasts two free map tile services and three free geocoders. 8 Version: 2. 2.08 Version: 2.3.0 9 9 License: GPL2 10 10 */ … … 119 119 add_shortcode('leaflet-image', array(&$this, 'image_shortcode')); 120 120 add_shortcode('leaflet-geojson', array(&$this, 'geojson_shortcode')); 121 add_shortcode('leaflet-kml', array(&$this, 'kml_shortcode')); 121 122 122 123 /* allow maps on excerpts */ … … 178 179 // optional ajax geojson plugin 179 180 wp_register_script('leaflet_ajax_geojson_js', plugins_url('scripts/leaflet-ajax-geojson.js', __FILE__), Array('leaflet_js',), '1.0', false); 181 182 wp_register_script('tmcw_togeojson', 'https://cdn.rawgit.com/mapbox/togeojson/master/togeojson.js', Array('jquery'), '1.0', false); 183 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'), '1.0', false); 180 185 181 186 /* run an init function because other wordpress plugins don't play well with their window.onload functions */ … … 494 499 } 495 500 496 public function geojson_shortcode ( $atts ) { 497 501 public function general_shape_shortcode ( $atts, $wp_script, $L_method, $default = '' ) { 498 502 $leaflet_map_count = self::$leaflet_map_count; 499 503 500 wp_enqueue_script( 'leaflet_ajax_geojson_js');504 wp_enqueue_script( $wp_script ); 501 505 502 506 if ($atts) { … … 505 509 506 510 /* only required field for geojson */ 507 $src = empty($src) ? 'https://rawgit.com/bozdoz/567817310f102d169510d94306e4f464/raw/2fdb48dafafd4c8304ff051f49d9de03afb1718b/map.geojson': $src;511 $src = empty($src) ? $default : $src; 508 512 509 513 $style = array( … … 536 540 'stroke-width' : 'width', 537 541 }, 538 layer = L. ajaxGeoJson(src, {542 layer = L.{$L_method}(src, { 539 543 style : layerStyle, 540 544 onEachFeature : onEachFeature … … 587 591 588 592 return $geojson_script; 593 } 594 595 public function geojson_shortcode ( $atts ) { 596 597 return self::general_shape_shortcode( $atts, 'leaflet_ajax_geojson_js', 'ajaxGeoJson', 'https://rawgit.com/bozdoz/567817310f102d169510d94306e4f464/raw/2fdb48dafafd4c8304ff051f49d9de03afb1718b/map.geojson'); 598 599 } 600 601 public function kml_shortcode ( $atts ) { 602 603 return self::general_shape_shortcode( $atts, 'leaflet_ajax_kml_js', 'ajaxKML', 'https://cdn.rawgit.com/mapbox/togeojson/master/test/data/polygon.kml'); 604 589 605 } 590 606 -
leaflet-map/tags/2.3.0/readme.txt
r1562348 r1562359 8 8 Requires at least: 3.0.1 9 9 Tested up to: 4.7 10 Version: 2. 2.011 Stable tag: 2. 2.010 Version: 2.3.0 11 Stable tag: 2.3.0 12 12 License: GPLv2 13 13 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 63 63 64 64 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 identify a geojson property with `popup_property`. 65 66 * Can I add kml? 67 68 Sure!? Use the same attributes as leaflet-geojson (above), but use the `[leaflet-kml]` shortcode. 65 69 66 70 * Can I add a message to a marker? … … 103 107 == Changelog == 104 108 109 = 2.3.0 = 110 * Added KML support `[leaflet-kml]`; 111 105 112 = 2.2.0 = 106 113 * Added popup_text and popup_property to leaflet-geojson to bind popups via a shortcode property or geojson properties … … 171 178 == Upgrade Notice == 172 179 180 = 2.3.0 = 181 Added KML support `[leaflet-kml]`; 182 173 183 = 2.2.0 = 174 184 Added popup_text and popup_property to leaflet-geojson to bind popups via a shortcode property or geojson properties -
leaflet-map/trunk/leaflet-map.php
r1562348 r1562359 6 6 Plugin Name: Leaflet Map 7 7 Description: A plugin for creating a Leaflet JS map with a shortcode. Boasts two free map tile services and three free geocoders. 8 Version: 2. 2.08 Version: 2.3.0 9 9 License: GPL2 10 10 */ … … 119 119 add_shortcode('leaflet-image', array(&$this, 'image_shortcode')); 120 120 add_shortcode('leaflet-geojson', array(&$this, 'geojson_shortcode')); 121 add_shortcode('leaflet-kml', array(&$this, 'kml_shortcode')); 121 122 122 123 /* allow maps on excerpts */ … … 178 179 // optional ajax geojson plugin 179 180 wp_register_script('leaflet_ajax_geojson_js', plugins_url('scripts/leaflet-ajax-geojson.js', __FILE__), Array('leaflet_js',), '1.0', false); 181 182 wp_register_script('tmcw_togeojson', 'https://cdn.rawgit.com/mapbox/togeojson/master/togeojson.js', Array('jquery'), '1.0', false); 183 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'), '1.0', false); 180 185 181 186 /* run an init function because other wordpress plugins don't play well with their window.onload functions */ … … 494 499 } 495 500 496 public function geojson_shortcode ( $atts ) { 497 501 public function general_shape_shortcode ( $atts, $wp_script, $L_method, $default = '' ) { 498 502 $leaflet_map_count = self::$leaflet_map_count; 499 503 500 wp_enqueue_script( 'leaflet_ajax_geojson_js');504 wp_enqueue_script( $wp_script ); 501 505 502 506 if ($atts) { … … 505 509 506 510 /* only required field for geojson */ 507 $src = empty($src) ? 'https://rawgit.com/bozdoz/567817310f102d169510d94306e4f464/raw/2fdb48dafafd4c8304ff051f49d9de03afb1718b/map.geojson': $src;511 $src = empty($src) ? $default : $src; 508 512 509 513 $style = array( … … 536 540 'stroke-width' : 'width', 537 541 }, 538 layer = L. ajaxGeoJson(src, {542 layer = L.{$L_method}(src, { 539 543 style : layerStyle, 540 544 onEachFeature : onEachFeature … … 587 591 588 592 return $geojson_script; 593 } 594 595 public function geojson_shortcode ( $atts ) { 596 597 return self::general_shape_shortcode( $atts, 'leaflet_ajax_geojson_js', 'ajaxGeoJson', 'https://rawgit.com/bozdoz/567817310f102d169510d94306e4f464/raw/2fdb48dafafd4c8304ff051f49d9de03afb1718b/map.geojson'); 598 599 } 600 601 public function kml_shortcode ( $atts ) { 602 603 return self::general_shape_shortcode( $atts, 'leaflet_ajax_kml_js', 'ajaxKML', 'https://cdn.rawgit.com/mapbox/togeojson/master/test/data/polygon.kml'); 604 589 605 } 590 606 -
leaflet-map/trunk/readme.txt
r1562348 r1562359 8 8 Requires at least: 3.0.1 9 9 Tested up to: 4.7 10 Version: 2. 2.011 Stable tag: 2. 2.010 Version: 2.3.0 11 Stable tag: 2.3.0 12 12 License: GPLv2 13 13 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 63 63 64 64 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 identify a geojson property with `popup_property`. 65 66 * Can I add kml? 67 68 Sure!? Use the same attributes as leaflet-geojson (above), but use the `[leaflet-kml]` shortcode. 65 69 66 70 * Can I add a message to a marker? … … 103 107 == Changelog == 104 108 109 = 2.3.0 = 110 * Added KML support `[leaflet-kml]`; 111 105 112 = 2.2.0 = 106 113 * Added popup_text and popup_property to leaflet-geojson to bind popups via a shortcode property or geojson properties … … 171 178 == Upgrade Notice == 172 179 180 = 2.3.0 = 181 Added KML support `[leaflet-kml]`; 182 173 183 = 2.2.0 = 174 184 Added popup_text and popup_property to leaflet-geojson to bind popups via a shortcode property or geojson properties
Note: See TracChangeset
for help on using the changeset viewer.