Changeset 2007357 for leaflet-map
- Timestamp:
- 01/07/2019 12:38:33 AM (7 years ago)
- Location:
- leaflet-map
- Files:
-
- 19 edited
- 13 copied
-
tags/2.13.0 (copied) (copied from leaflet-map/trunk)
-
tags/2.13.0/README.md (copied) (copied from leaflet-map/trunk/README.md) (1 diff)
-
tags/2.13.0/class.geocoder.php (copied) (copied from leaflet-map/trunk/class.geocoder.php)
-
tags/2.13.0/class.leaflet-map.php (copied) (copied from leaflet-map/trunk/class.leaflet-map.php) (1 diff)
-
tags/2.13.0/class.plugin-option.php (copied) (copied from leaflet-map/trunk/class.plugin-option.php)
-
tags/2.13.0/class.plugin-settings.php (copied) (copied from leaflet-map/trunk/class.plugin-settings.php)
-
tags/2.13.0/leaflet-map.php (copied) (copied from leaflet-map/trunk/leaflet-map.php) (2 diffs)
-
tags/2.13.0/readme.txt (copied) (copied from leaflet-map/trunk/readme.txt) (2 diffs)
-
tags/2.13.0/scripts/construct-leaflet-map.js (copied) (copied from leaflet-map/trunk/scripts/construct-leaflet-map.js) (5 diffs)
-
tags/2.13.0/scripts/construct-leaflet-map.min.js (modified) (1 diff)
-
tags/2.13.0/shortcodes/class.circle-shortcode.php (modified) (2 diffs)
-
tags/2.13.0/shortcodes/class.geojson-shortcode.php (modified) (3 diffs)
-
tags/2.13.0/shortcodes/class.gpx-shortcode.php (modified) (1 diff)
-
tags/2.13.0/shortcodes/class.image-shortcode.php (copied) (copied from leaflet-map/trunk/shortcodes/class.image-shortcode.php)
-
tags/2.13.0/shortcodes/class.line-shortcode.php (modified) (1 diff)
-
tags/2.13.0/shortcodes/class.map-shortcode.php (copied) (copied from leaflet-map/trunk/shortcodes/class.map-shortcode.php) (1 diff)
-
tags/2.13.0/shortcodes/class.marker-shortcode.php (modified) (2 diffs)
-
tags/2.13.0/templates/settings.php (copied) (copied from leaflet-map/trunk/templates/settings.php)
-
tags/2.13.0/templates/shortcode-helper.php (copied) (copied from leaflet-map/trunk/templates/shortcode-helper.php) (1 diff)
-
trunk/README.md (modified) (1 diff)
-
trunk/class.leaflet-map.php (modified) (1 diff)
-
trunk/leaflet-map.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/scripts/construct-leaflet-map.js (modified) (5 diffs)
-
trunk/scripts/construct-leaflet-map.min.js (modified) (1 diff)
-
trunk/shortcodes/class.circle-shortcode.php (modified) (2 diffs)
-
trunk/shortcodes/class.geojson-shortcode.php (modified) (3 diffs)
-
trunk/shortcodes/class.gpx-shortcode.php (modified) (1 diff)
-
trunk/shortcodes/class.line-shortcode.php (modified) (1 diff)
-
trunk/shortcodes/class.map-shortcode.php (modified) (1 diff)
-
trunk/shortcodes/class.marker-shortcode.php (modified) (2 diffs)
-
trunk/templates/shortcode-helper.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
leaflet-map/tags/2.13.0/README.md
r2006129 r2007357 1 1 # Leaflet Map WordPress Plugin 2 2 3 3  4 4  5 5 -
leaflet-map/tags/2.13.0/class.leaflet-map.php
r2006129 r2007357 25 25 * @var string major minor patch version 26 26 */ 27 public static $leaflet_version = '1. 3.4';27 public static $leaflet_version = '1.4.0'; 28 28 29 29 /** -
leaflet-map/tags/2.13.0/leaflet-map.php
r2006129 r2007357 9 9 * Text Domain: leaflet-map 10 10 * Domain Path: /languages/ 11 * Version: 2.1 2.011 * Version: 2.13.0 12 12 * License: GPL2 13 13 * Leaflet Map is free software: you can redistribute it and/or modify … … 30 30 } 31 31 32 define('LEAFLET_MAP__PLUGIN_VERSION', '2.1 2.0');32 define('LEAFLET_MAP__PLUGIN_VERSION', '2.13.0'); 33 33 define('LEAFLET_MAP__PLUGIN_FILE', __FILE__); 34 34 define('LEAFLET_MAP__PLUGIN_DIR', plugin_dir_path(__FILE__)); -
leaflet-map/tags/2.13.0/readme.txt
r2006129 r2007357 8 8 Requires at least: 3.0.1 9 9 Tested up to: 5.0.2 10 Version: 2.1 2.011 Stable tag: 2.1 2.010 Version: 2.13.0 11 Stable tag: 2.13.0 12 12 License: GPLv2 13 13 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 156 156 == Changelog == 157 157 158 = 2.13.0 = 159 * Updated LeafletJS to 1.4.0 160 * Replaced `fit_markers` with `fitbounds`, which now fits all shapes in map view 161 158 162 = 2.12.0 = 159 163 * Re-added Google Geocoder (optional), since they forced billing accounts -
leaflet-map/tags/2.13.0/scripts/construct-leaflet-map.js
r2006129 r2007357 26 26 27 27 /** 28 * Same as above, but what if someone wants to execute a function 29 * before other functions? 30 */ 31 this.unshift = function (fnc) { 32 if (ready) { 33 fnc(); 34 } else { 35 callbacks.unshift(fnc); 36 } 37 } 38 39 /** 28 40 * execute all callbacks once page/Leaflet is loaded 29 41 */ … … 42 54 }; 43 55 44 this.getCurrentMarkerGroup = function () { 56 /** 57 * Get/Create L.FeatureGroup for ALL shapes; used for `fitbounds` 58 * @since 2.13.0 59 */ 60 this.getCurrentGroup = function () { 45 61 // marker groups are mapid -> feature group 46 62 var mapid = this.maps.length; … … 51 67 }; 52 68 69 /** 70 * backwards-compatible getCurrentGroup 71 * @deprecated 2.13.0 72 */ 73 this.getCurrentMarkerGroup = this.getCurrentGroup; 74 75 /** 76 * get FeatureGroup and add to map 77 * 78 * ! This is extracted so that it can be overwritten by plugins 79 */ 53 80 this.getGroup = function (map) { 54 81 return new L.FeatureGroup().addTo(map); 55 82 }; 56 83 84 /** 85 * group is created and event is added 86 */ 57 87 this.newMarkerGroup = function (map) { 58 88 var mg = this.getGroup(map); … … 62 92 // custom attribute 63 93 if (map._shouldFitBounds) { 64 mg.on('layeradd', function ( d) {94 mg.on('layeradd', function (event) { 65 95 // needs a timeout so that it doesn't 66 96 // opt out of a bound change 97 if (event.layer instanceof L.FeatureGroup) { 98 // wait for featuregroup/ajax-geojson to be ready 99 event.layer.on('ready', function () { 100 map.fitBounds(mg.getBounds()); 101 }) 102 } 103 67 104 window.clearTimeout(this.timeout); 68 105 this.timeout = window.setTimeout(function() { 69 map.fitBounds(mg.getBounds()); 106 try { 107 map.fitBounds(mg.getBounds()); 108 } catch (e) { 109 // ajax-geojson might not have valid bounds yet 110 } 70 111 }, 100); 71 112 }, mg); … … 87 128 this.markers = []; 88 129 this.lines = []; 130 this.circles = []; 131 this.geojsons = []; 89 132 } 90 133 -
leaflet-map/tags/2.13.0/scripts/construct-leaflet-map.min.js
r1946454 r2007357 1 !function(){var t=window.WPLeafletMapPlugin;if(window.WPLeafletMapPlugin=new function(){var t=!1,n=[];this.push=function(i){t?i():n.push(i)},this. init=function(){t=!0;for(var i=0,e=n.length;i<e;i++)n[i]()},this.getCurrentMap=function(){return this.maps[this.maps.length-1]},this.getCurrentMarkerGroup=function(){var t=this.maps.length;return this.markergroups[t]||(this.markergroups[t]=this.newMarkerGroup(this.maps[t-1])),this.markergroups[t]},this.getGroup=function(t){return(new L.FeatureGroup).addTo(t)},this.newMarkerGroup=function(t){var n=this.getGroup(t);return n.timeout=null,t.fit_markers&&n.on("layeradd",function(i){window.clearTimeout(this.timeout),this.timeout=window.setTimeout(function(){t.fitBounds(n.getBounds())},100)},n),n},this.unescape=function(t){var n=document.createElement("div");return n.innerHTML=t,n.innerText},this.maps=[],this.images=[],this.markergroups={},this.markers=[],this.lines=[]},t){for(var n=0,i=t.length;n<i;n++)window.WPLeafletMapPlugin.push(t[n]);t.splice(0);for(var e in t)t.hasOwnProperty(e)&&(window.WPLeafletMapPlugin[e]=t[e])}window.addEventListener?window.addEventListener("load",window.WPLeafletMapPlugin.init,!1):window.attachEvent&&window.attachEvent("onload",window.WPLeafletMapPlugin.init)}();1 !function(){var t=window.WPLeafletMapPlugin;if(window.WPLeafletMapPlugin=new function(){var t=!1,n=[];this.push=function(i){t?i():n.push(i)},this.unshift=function(i){t?i():n.unshift(i)},this.init=function(){t=!0;for(var i=0,e=n.length;i<e;i++)n[i]()},this.getCurrentMap=function(){return this.maps[this.maps.length-1]},this.getCurrentGroup=function(){var t=this.maps.length;return this.markergroups[t]||(this.markergroups[t]=this.newMarkerGroup(this.maps[t-1])),this.markergroups[t]},this.getCurrentMarkerGroup=this.getCurrentGroup,this.getGroup=function(t){return(new L.FeatureGroup).addTo(t)},this.newMarkerGroup=function(t){var n=this.getGroup(t);return n.timeout=null,t._shouldFitBounds&&n.on("layeradd",function(i){i.layer instanceof L.FeatureGroup&&i.layer.on("ready",function(){t.fitBounds(n.getBounds())}),window.clearTimeout(this.timeout),this.timeout=window.setTimeout(function(){try{t.fitBounds(n.getBounds())}catch(t){}},100)},n),n},this.unescape=function(t){var n=document.createElement("div");return n.innerHTML=t,n.innerText},this.maps=[],this.images=[],this.markergroups={},this.markers=[],this.lines=[],this.circles=[],this.geojsons=[]},t){for(var n=0,i=t.length;n<i;n++)window.WPLeafletMapPlugin.push(t[n]);t.splice(0);for(var e in t)t.hasOwnProperty(e)&&(window.WPLeafletMapPlugin[e]=t[e])}window.addEventListener?window.addEventListener("load",window.WPLeafletMapPlugin.init,!1):window.attachEvent&&window.attachEvent("onload",window.WPLeafletMapPlugin.init)}(); -
leaflet-map/tags/2.13.0/shortcodes/class.circle-shortcode.php
r1943982 r2007357 62 62 lat = <?php echo $lat; ?>, 63 63 lng = <?php echo $lng; ?>, 64 radius = <?php echo $radius; ?>; 64 radius = <?php echo $radius; ?>, 65 group = window.WPLeafletMapPlugin.getCurrentGroup(); 65 66 66 67 // update lat lng to previous map's center … … 72 73 var circle = L.circle([lat, lng], {radius: radius}); 73 74 circle.setStyle(<?php echo $style_json; ?>); 74 circle.addTo( previous_map ); 75 circle.addTo( group ); 76 77 window.WPLeafletMapPlugin.circles.push( circle ); 78 75 79 if (fitbounds) { 76 80 // zoom the map to the polyline -
leaflet-map/tags/2.13.0/shortcodes/class.geojson-shortcode.php
r1943975 r2007357 87 87 window.WPLeafletMapPlugin = window.WPLeafletMapPlugin || []; 88 88 window.WPLeafletMapPlugin.push(function () { 89 var previous_map = window.WPLeafletMapPlugin.getCurrentMap(), 90 src = '<?php echo $src; ?>', 89 var src = '<?php echo $src; ?>', 91 90 default_style = <?php echo $style_json; ?>, 92 91 rewrite_keys = { … … 100 99 type: '<?php echo $class::$type; ?>', 101 100 style : layerStyle, 102 onEachFeature : onEachFeature 101 onEachFeature : onEachFeature, 103 102 }), 104 103 fitbounds = <?php echo $fitbounds; ?>, 105 104 popup_text = window.WPLeafletMapPlugin.unescape('<?php echo $popup_text; ?>'), 106 popup_property = '<?php echo $popup_property; ?>'; 105 popup_property = '<?php echo $popup_property; ?>', 106 group = window.WPLeafletMapPlugin.getCurrentGroup(); 107 layer.addTo( group ); 108 window.WPLeafletMapPlugin.geojsons.push( layer ); 107 109 if (fitbounds) { 108 110 layer.on('ready', function () { … … 110 112 }); 111 113 } 112 layer.addTo( previous_map );113 114 function layerStyle (feature) { 114 115 var props = feature.properties || {}; -
leaflet-map/tags/2.13.0/shortcodes/class.gpx-shortcode.php
r1851128 r2007357 29 29 */ 30 30 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'; 31 38 } -
leaflet-map/tags/2.13.0/shortcodes/class.line-shortcode.php
r1943975 r2007357 81 81 var previous_map = window.WPLeafletMapPlugin.getCurrentMap(), 82 82 line = L.polyline(<?php echo $location_json; ?>, <?php echo $style_json; ?>), 83 fitbounds = <?php echo $fitbounds; ?>; 84 line.addTo( previous_map ); 83 fitbounds = <?php echo $fitbounds; ?>, 84 group = window.WPLeafletMapPlugin.getCurrentGroup(); 85 line.addTo( group ); 85 86 if (fitbounds) { 86 87 // zoom the map to the polyline -
leaflet-map/tags/2.13.0/shortcodes/class.map-shortcode.php
r2006129 r2007357 81 81 $doubleclickzoom : $settings->get('double_click_zoom'); 82 82 83 // backwards-compatible fit_markers83 // @deprecated backwards-compatible fit_markers 84 84 $atts['fit_markers'] = array_key_exists('fit_markers', $atts) ? 85 85 $fit_markers : $settings->get('fit_markers'); -
leaflet-map/tags/2.13.0/shortcodes/class.marker-shortcode.php
r1943975 r2007357 171 171 map = window.WPLeafletMapPlugin.getCurrentMap(), 172 172 is_image = map.is_image_map, 173 markergroup = window.WPLeafletMapPlugin.getCurrentMarkerGroup();173 group = window.WPLeafletMapPlugin.getCurrentGroup(); 174 174 <?php 175 175 if (empty($lat) && empty($lng)) { … … 196 196 }); 197 197 } 198 199 marker.addTo( markergroup ); 198 marker.addTo( group ); 200 199 <?php 201 200 $this->LM->add_popup_to_shape($atts, $content, 'marker'); -
leaflet-map/tags/2.13.0/templates/shortcode-helper.php
r2006129 r2007357 98 98 ), 99 99 __("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]' 102 110 ), 103 111 __("Image Map", 'leaflet-map') => array( 104 112 '[leaflet-image zoom=1 zoomcontrol scrollwheelzoom attribution=0]', 105 113 '[leaflet-marker]' 106 ) 114 ), 107 115 ); 108 116 -
leaflet-map/trunk/README.md
r2006129 r2007357 1 1 # Leaflet Map WordPress Plugin 2 2 3 3  4 4  5 5 -
leaflet-map/trunk/class.leaflet-map.php
r2006129 r2007357 25 25 * @var string major minor patch version 26 26 */ 27 public static $leaflet_version = '1. 3.4';27 public static $leaflet_version = '1.4.0'; 28 28 29 29 /** -
leaflet-map/trunk/leaflet-map.php
r2006129 r2007357 9 9 * Text Domain: leaflet-map 10 10 * Domain Path: /languages/ 11 * Version: 2.1 2.011 * Version: 2.13.0 12 12 * License: GPL2 13 13 * Leaflet Map is free software: you can redistribute it and/or modify … … 30 30 } 31 31 32 define('LEAFLET_MAP__PLUGIN_VERSION', '2.1 2.0');32 define('LEAFLET_MAP__PLUGIN_VERSION', '2.13.0'); 33 33 define('LEAFLET_MAP__PLUGIN_FILE', __FILE__); 34 34 define('LEAFLET_MAP__PLUGIN_DIR', plugin_dir_path(__FILE__)); -
leaflet-map/trunk/readme.txt
r2006129 r2007357 8 8 Requires at least: 3.0.1 9 9 Tested up to: 5.0.2 10 Version: 2.1 2.011 Stable tag: 2.1 2.010 Version: 2.13.0 11 Stable tag: 2.13.0 12 12 License: GPLv2 13 13 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 156 156 == Changelog == 157 157 158 = 2.13.0 = 159 * Updated LeafletJS to 1.4.0 160 * Replaced `fit_markers` with `fitbounds`, which now fits all shapes in map view 161 158 162 = 2.12.0 = 159 163 * Re-added Google Geocoder (optional), since they forced billing accounts -
leaflet-map/trunk/scripts/construct-leaflet-map.js
r2006129 r2007357 26 26 27 27 /** 28 * Same as above, but what if someone wants to execute a function 29 * before other functions? 30 */ 31 this.unshift = function (fnc) { 32 if (ready) { 33 fnc(); 34 } else { 35 callbacks.unshift(fnc); 36 } 37 } 38 39 /** 28 40 * execute all callbacks once page/Leaflet is loaded 29 41 */ … … 42 54 }; 43 55 44 this.getCurrentMarkerGroup = function () { 56 /** 57 * Get/Create L.FeatureGroup for ALL shapes; used for `fitbounds` 58 * @since 2.13.0 59 */ 60 this.getCurrentGroup = function () { 45 61 // marker groups are mapid -> feature group 46 62 var mapid = this.maps.length; … … 51 67 }; 52 68 69 /** 70 * backwards-compatible getCurrentGroup 71 * @deprecated 2.13.0 72 */ 73 this.getCurrentMarkerGroup = this.getCurrentGroup; 74 75 /** 76 * get FeatureGroup and add to map 77 * 78 * ! This is extracted so that it can be overwritten by plugins 79 */ 53 80 this.getGroup = function (map) { 54 81 return new L.FeatureGroup().addTo(map); 55 82 }; 56 83 84 /** 85 * group is created and event is added 86 */ 57 87 this.newMarkerGroup = function (map) { 58 88 var mg = this.getGroup(map); … … 62 92 // custom attribute 63 93 if (map._shouldFitBounds) { 64 mg.on('layeradd', function ( d) {94 mg.on('layeradd', function (event) { 65 95 // needs a timeout so that it doesn't 66 96 // opt out of a bound change 97 if (event.layer instanceof L.FeatureGroup) { 98 // wait for featuregroup/ajax-geojson to be ready 99 event.layer.on('ready', function () { 100 map.fitBounds(mg.getBounds()); 101 }) 102 } 103 67 104 window.clearTimeout(this.timeout); 68 105 this.timeout = window.setTimeout(function() { 69 map.fitBounds(mg.getBounds()); 106 try { 107 map.fitBounds(mg.getBounds()); 108 } catch (e) { 109 // ajax-geojson might not have valid bounds yet 110 } 70 111 }, 100); 71 112 }, mg); … … 87 128 this.markers = []; 88 129 this.lines = []; 130 this.circles = []; 131 this.geojsons = []; 89 132 } 90 133 -
leaflet-map/trunk/scripts/construct-leaflet-map.min.js
r2006424 r2007357 1 !function(){var t=window.WPLeafletMapPlugin;if(window.WPLeafletMapPlugin=new function(){var t=!1,n=[];this.push=function(i){t?i():n.push(i)},this. init=function(){t=!0;for(var i=0,e=n.length;i<e;i++)n[i]()},this.getCurrentMap=function(){return this.maps[this.maps.length-1]},this.getCurrentMarkerGroup=function(){var t=this.maps.length;return this.markergroups[t]||(this.markergroups[t]=this.newMarkerGroup(this.maps[t-1])),this.markergroups[t]},this.getGroup=function(t){return(new L.FeatureGroup).addTo(t)},this.newMarkerGroup=function(t){var n=this.getGroup(t);return n.timeout=null,t._shouldFitBounds&&n.on("layeradd",function(i){window.clearTimeout(this.timeout),this.timeout=window.setTimeout(function(){t.fitBounds(n.getBounds())},100)},n),n},this.unescape=function(t){var n=document.createElement("div");return n.innerHTML=t,n.innerText},this.maps=[],this.images=[],this.markergroups={},this.markers=[],this.lines=[]},t){for(var n=0,i=t.length;n<i;n++)window.WPLeafletMapPlugin.push(t[n]);t.splice(0);for(var e in t)t.hasOwnProperty(e)&&(window.WPLeafletMapPlugin[e]=t[e])}window.addEventListener?window.addEventListener("load",window.WPLeafletMapPlugin.init,!1):window.attachEvent&&window.attachEvent("onload",window.WPLeafletMapPlugin.init)}();1 !function(){var t=window.WPLeafletMapPlugin;if(window.WPLeafletMapPlugin=new function(){var t=!1,n=[];this.push=function(i){t?i():n.push(i)},this.unshift=function(i){t?i():n.unshift(i)},this.init=function(){t=!0;for(var i=0,e=n.length;i<e;i++)n[i]()},this.getCurrentMap=function(){return this.maps[this.maps.length-1]},this.getCurrentGroup=function(){var t=this.maps.length;return this.markergroups[t]||(this.markergroups[t]=this.newMarkerGroup(this.maps[t-1])),this.markergroups[t]},this.getCurrentMarkerGroup=this.getCurrentGroup,this.getGroup=function(t){return(new L.FeatureGroup).addTo(t)},this.newMarkerGroup=function(t){var n=this.getGroup(t);return n.timeout=null,t._shouldFitBounds&&n.on("layeradd",function(i){i.layer instanceof L.FeatureGroup&&i.layer.on("ready",function(){t.fitBounds(n.getBounds())}),window.clearTimeout(this.timeout),this.timeout=window.setTimeout(function(){try{t.fitBounds(n.getBounds())}catch(t){}},100)},n),n},this.unescape=function(t){var n=document.createElement("div");return n.innerHTML=t,n.innerText},this.maps=[],this.images=[],this.markergroups={},this.markers=[],this.lines=[],this.circles=[],this.geojsons=[]},t){for(var n=0,i=t.length;n<i;n++)window.WPLeafletMapPlugin.push(t[n]);t.splice(0);for(var e in t)t.hasOwnProperty(e)&&(window.WPLeafletMapPlugin[e]=t[e])}window.addEventListener?window.addEventListener("load",window.WPLeafletMapPlugin.init,!1):window.attachEvent&&window.attachEvent("onload",window.WPLeafletMapPlugin.init)}(); -
leaflet-map/trunk/shortcodes/class.circle-shortcode.php
r1943982 r2007357 62 62 lat = <?php echo $lat; ?>, 63 63 lng = <?php echo $lng; ?>, 64 radius = <?php echo $radius; ?>; 64 radius = <?php echo $radius; ?>, 65 group = window.WPLeafletMapPlugin.getCurrentGroup(); 65 66 66 67 // update lat lng to previous map's center … … 72 73 var circle = L.circle([lat, lng], {radius: radius}); 73 74 circle.setStyle(<?php echo $style_json; ?>); 74 circle.addTo( previous_map ); 75 circle.addTo( group ); 76 77 window.WPLeafletMapPlugin.circles.push( circle ); 78 75 79 if (fitbounds) { 76 80 // zoom the map to the polyline -
leaflet-map/trunk/shortcodes/class.geojson-shortcode.php
r1943975 r2007357 87 87 window.WPLeafletMapPlugin = window.WPLeafletMapPlugin || []; 88 88 window.WPLeafletMapPlugin.push(function () { 89 var previous_map = window.WPLeafletMapPlugin.getCurrentMap(), 90 src = '<?php echo $src; ?>', 89 var src = '<?php echo $src; ?>', 91 90 default_style = <?php echo $style_json; ?>, 92 91 rewrite_keys = { … … 100 99 type: '<?php echo $class::$type; ?>', 101 100 style : layerStyle, 102 onEachFeature : onEachFeature 101 onEachFeature : onEachFeature, 103 102 }), 104 103 fitbounds = <?php echo $fitbounds; ?>, 105 104 popup_text = window.WPLeafletMapPlugin.unescape('<?php echo $popup_text; ?>'), 106 popup_property = '<?php echo $popup_property; ?>'; 105 popup_property = '<?php echo $popup_property; ?>', 106 group = window.WPLeafletMapPlugin.getCurrentGroup(); 107 layer.addTo( group ); 108 window.WPLeafletMapPlugin.geojsons.push( layer ); 107 109 if (fitbounds) { 108 110 layer.on('ready', function () { … … 110 112 }); 111 113 } 112 layer.addTo( previous_map );113 114 function layerStyle (feature) { 114 115 var props = feature.properties || {}; -
leaflet-map/trunk/shortcodes/class.gpx-shortcode.php
r1851128 r2007357 29 29 */ 30 30 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'; 31 38 } -
leaflet-map/trunk/shortcodes/class.line-shortcode.php
r1943975 r2007357 81 81 var previous_map = window.WPLeafletMapPlugin.getCurrentMap(), 82 82 line = L.polyline(<?php echo $location_json; ?>, <?php echo $style_json; ?>), 83 fitbounds = <?php echo $fitbounds; ?>; 84 line.addTo( previous_map ); 83 fitbounds = <?php echo $fitbounds; ?>, 84 group = window.WPLeafletMapPlugin.getCurrentGroup(); 85 line.addTo( group ); 85 86 if (fitbounds) { 86 87 // zoom the map to the polyline -
leaflet-map/trunk/shortcodes/class.map-shortcode.php
r2006129 r2007357 81 81 $doubleclickzoom : $settings->get('double_click_zoom'); 82 82 83 // backwards-compatible fit_markers83 // @deprecated backwards-compatible fit_markers 84 84 $atts['fit_markers'] = array_key_exists('fit_markers', $atts) ? 85 85 $fit_markers : $settings->get('fit_markers'); -
leaflet-map/trunk/shortcodes/class.marker-shortcode.php
r1943975 r2007357 171 171 map = window.WPLeafletMapPlugin.getCurrentMap(), 172 172 is_image = map.is_image_map, 173 markergroup = window.WPLeafletMapPlugin.getCurrentMarkerGroup();173 group = window.WPLeafletMapPlugin.getCurrentGroup(); 174 174 <?php 175 175 if (empty($lat) && empty($lng)) { … … 196 196 }); 197 197 } 198 199 marker.addTo( markergroup ); 198 marker.addTo( group ); 200 199 <?php 201 200 $this->LM->add_popup_to_shape($atts, $content, 'marker'); -
leaflet-map/trunk/templates/shortcode-helper.php
r2006129 r2007357 98 98 ), 99 99 __("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]' 102 110 ), 103 111 __("Image Map", 'leaflet-map') => array( 104 112 '[leaflet-image zoom=1 zoomcontrol scrollwheelzoom attribution=0]', 105 113 '[leaflet-marker]' 106 ) 114 ), 107 115 ); 108 116
Note: See TracChangeset
for help on using the changeset viewer.