Plugin Directory

Changeset 2007357 for leaflet-map


Ignore:
Timestamp:
01/07/2019 12:38:33 AM (7 years ago)
Author:
bozdoz
Message:

v2.13.0 - fitbounds on map; updated leaflet

Location:
leaflet-map
Files:
19 edited
13 copied

Legend:

Unmodified
Added
Removed
  • leaflet-map/tags/2.13.0/README.md

    r2006129 r2007357  
    11# Leaflet Map WordPress Plugin
    22
    3 ![Leaflet](https://img.shields.io/badge/leaflet-1.3.4-green.svg?style=flat)
     3![Leaflet](https://img.shields.io/badge/leaflet-1.4.0-green.svg?style=flat)
    44![WordPress](https://img.shields.io/badge/wordpress-5.0-green.svg?style=flat)
    55
  • leaflet-map/tags/2.13.0/class.leaflet-map.php

    r2006129 r2007357  
    2525     * @var string major minor patch version
    2626     */
    27     public static $leaflet_version = '1.3.4';
     27    public static $leaflet_version = '1.4.0';
    2828
    2929    /**
  • leaflet-map/tags/2.13.0/leaflet-map.php

    r2006129 r2007357  
    99 * Text Domain: leaflet-map
    1010 * Domain Path: /languages/
    11  * Version: 2.12.0
     11 * Version: 2.13.0
    1212 * License: GPL2
    1313 * Leaflet Map is free software: you can redistribute it and/or modify
     
    3030}
    3131
    32 define('LEAFLET_MAP__PLUGIN_VERSION', '2.12.0');
     32define('LEAFLET_MAP__PLUGIN_VERSION', '2.13.0');
    3333define('LEAFLET_MAP__PLUGIN_FILE', __FILE__);
    3434define('LEAFLET_MAP__PLUGIN_DIR', plugin_dir_path(__FILE__));
  • leaflet-map/tags/2.13.0/readme.txt

    r2006129 r2007357  
    88Requires at least: 3.0.1
    99Tested up to: 5.0.2
    10 Version: 2.12.0
    11 Stable tag: 2.12.0
     10Version: 2.13.0
     11Stable tag: 2.13.0
    1212License: GPLv2
    1313License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    156156== Changelog ==
    157157
     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
    158162= 2.12.0 =
    159163* Re-added Google Geocoder (optional), since they forced billing accounts
  • leaflet-map/tags/2.13.0/scripts/construct-leaflet-map.js

    r2006129 r2007357  
    2626
    2727        /**
     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        /**
    2840         * execute all callbacks once page/Leaflet is loaded
    2941         */
     
    4254        };
    4355
    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 () {
    4561            // marker groups are mapid -> feature group
    4662            var mapid = this.maps.length;
     
    5167        };
    5268
     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         */
    5380        this.getGroup = function (map) {
    5481            return new L.FeatureGroup().addTo(map);
    5582        };
    5683
     84        /**
     85         * group is created and event is added
     86         */
    5787        this.newMarkerGroup = function (map) {
    5888            var mg = this.getGroup(map);
     
    6292            // custom attribute
    6393            if (map._shouldFitBounds) {
    64                 mg.on('layeradd', function (d) {
     94                mg.on('layeradd', function (event) {
    6595                    // needs a timeout so that it doesn't
    6696                    // 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                   
    67104                    window.clearTimeout(this.timeout);
    68105                    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                        }
    70111                    }, 100);
    71112                }, mg);
     
    87128        this.markers = [];
    88129        this.lines = [];
     130        this.circles = [];
     131        this.geojsons = [];
    89132    }
    90133
  • 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  
    6262                lat = <?php echo $lat; ?>,
    6363                lng = <?php echo $lng; ?>,
    64                 radius = <?php echo $radius; ?>;
     64                radius = <?php echo $radius; ?>,
     65                group = window.WPLeafletMapPlugin.getCurrentGroup();
    6566
    6667            // update lat lng to previous map's center
     
    7273            var circle = L.circle([lat, lng], {radius: radius});
    7374            circle.setStyle(<?php echo $style_json; ?>);
    74             circle.addTo( previous_map );
     75            circle.addTo( group );
     76
     77            window.WPLeafletMapPlugin.circles.push( circle );
     78           
    7579            if (fitbounds) {
    7680                // zoom the map to the polyline
  • leaflet-map/tags/2.13.0/shortcodes/class.geojson-shortcode.php

    r1943975 r2007357  
    8787            window.WPLeafletMapPlugin = window.WPLeafletMapPlugin || [];
    8888            window.WPLeafletMapPlugin.push(function () {
    89                 var previous_map = window.WPLeafletMapPlugin.getCurrentMap(),
    90                     src = '<?php echo $src; ?>',
     89                var src = '<?php echo $src; ?>',
    9190                    default_style = <?php echo $style_json; ?>,
    9291                    rewrite_keys = {
     
    10099                        type: '<?php echo $class::$type; ?>',
    101100                        style : layerStyle,
    102                         onEachFeature : onEachFeature
     101                        onEachFeature : onEachFeature,
    103102                    }),
    104103                    fitbounds = <?php echo $fitbounds; ?>,
    105104                    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 );
    107109                if (fitbounds) {
    108110                    layer.on('ready', function () {
     
    110112                    });
    111113                }
    112                 layer.addTo( previous_map );
    113114                function layerStyle (feature) {
    114115                    var props = feature.properties || {};
  • leaflet-map/tags/2.13.0/shortcodes/class.gpx-shortcode.php

    r1851128 r2007357  
    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}
  • leaflet-map/tags/2.13.0/shortcodes/class.line-shortcode.php

    r1943975 r2007357  
    8181            var previous_map = window.WPLeafletMapPlugin.getCurrentMap(),
    8282                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 );
    8586            if (fitbounds) {
    8687                // zoom the map to the polyline
  • leaflet-map/tags/2.13.0/shortcodes/class.map-shortcode.php

    r2006129 r2007357  
    8181            $doubleclickzoom : $settings->get('double_click_zoom');
    8282       
    83         // backwards-compatible fit_markers
     83        // @deprecated backwards-compatible fit_markers
    8484        $atts['fit_markers'] = array_key_exists('fit_markers', $atts) ?
    8585            $fit_markers : $settings->get('fit_markers');
  • leaflet-map/tags/2.13.0/shortcodes/class.marker-shortcode.php

    r1943975 r2007357  
    171171                map = window.WPLeafletMapPlugin.getCurrentMap(),
    172172                is_image = map.is_image_map,
    173                 markergroup = window.WPLeafletMapPlugin.getCurrentMarkerGroup();
     173                group = window.WPLeafletMapPlugin.getCurrentGroup();
    174174            <?php
    175175            if (empty($lat) && empty($lng)) {
     
    196196                });
    197197            }
    198 
    199             marker.addTo( markergroup );
     198            marker.addTo( group );
    200199            <?php
    201200                $this->LM->add_popup_to_shape($atts, $content, 'marker');
  • leaflet-map/tags/2.13.0/templates/shortcode-helper.php

    r2006129 r2007357  
    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
  • leaflet-map/trunk/README.md

    r2006129 r2007357  
    11# Leaflet Map WordPress Plugin
    22
    3 ![Leaflet](https://img.shields.io/badge/leaflet-1.3.4-green.svg?style=flat)
     3![Leaflet](https://img.shields.io/badge/leaflet-1.4.0-green.svg?style=flat)
    44![WordPress](https://img.shields.io/badge/wordpress-5.0-green.svg?style=flat)
    55
  • leaflet-map/trunk/class.leaflet-map.php

    r2006129 r2007357  
    2525     * @var string major minor patch version
    2626     */
    27     public static $leaflet_version = '1.3.4';
     27    public static $leaflet_version = '1.4.0';
    2828
    2929    /**
  • leaflet-map/trunk/leaflet-map.php

    r2006129 r2007357  
    99 * Text Domain: leaflet-map
    1010 * Domain Path: /languages/
    11  * Version: 2.12.0
     11 * Version: 2.13.0
    1212 * License: GPL2
    1313 * Leaflet Map is free software: you can redistribute it and/or modify
     
    3030}
    3131
    32 define('LEAFLET_MAP__PLUGIN_VERSION', '2.12.0');
     32define('LEAFLET_MAP__PLUGIN_VERSION', '2.13.0');
    3333define('LEAFLET_MAP__PLUGIN_FILE', __FILE__);
    3434define('LEAFLET_MAP__PLUGIN_DIR', plugin_dir_path(__FILE__));
  • leaflet-map/trunk/readme.txt

    r2006129 r2007357  
    88Requires at least: 3.0.1
    99Tested up to: 5.0.2
    10 Version: 2.12.0
    11 Stable tag: 2.12.0
     10Version: 2.13.0
     11Stable tag: 2.13.0
    1212License: GPLv2
    1313License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    156156== Changelog ==
    157157
     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
    158162= 2.12.0 =
    159163* Re-added Google Geocoder (optional), since they forced billing accounts
  • leaflet-map/trunk/scripts/construct-leaflet-map.js

    r2006129 r2007357  
    2626
    2727        /**
     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        /**
    2840         * execute all callbacks once page/Leaflet is loaded
    2941         */
     
    4254        };
    4355
    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 () {
    4561            // marker groups are mapid -> feature group
    4662            var mapid = this.maps.length;
     
    5167        };
    5268
     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         */
    5380        this.getGroup = function (map) {
    5481            return new L.FeatureGroup().addTo(map);
    5582        };
    5683
     84        /**
     85         * group is created and event is added
     86         */
    5787        this.newMarkerGroup = function (map) {
    5888            var mg = this.getGroup(map);
     
    6292            // custom attribute
    6393            if (map._shouldFitBounds) {
    64                 mg.on('layeradd', function (d) {
     94                mg.on('layeradd', function (event) {
    6595                    // needs a timeout so that it doesn't
    6696                    // 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                   
    67104                    window.clearTimeout(this.timeout);
    68105                    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                        }
    70111                    }, 100);
    71112                }, mg);
     
    87128        this.markers = [];
    88129        this.lines = [];
     130        this.circles = [];
     131        this.geojsons = [];
    89132    }
    90133
  • 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  
    6262                lat = <?php echo $lat; ?>,
    6363                lng = <?php echo $lng; ?>,
    64                 radius = <?php echo $radius; ?>;
     64                radius = <?php echo $radius; ?>,
     65                group = window.WPLeafletMapPlugin.getCurrentGroup();
    6566
    6667            // update lat lng to previous map's center
     
    7273            var circle = L.circle([lat, lng], {radius: radius});
    7374            circle.setStyle(<?php echo $style_json; ?>);
    74             circle.addTo( previous_map );
     75            circle.addTo( group );
     76
     77            window.WPLeafletMapPlugin.circles.push( circle );
     78           
    7579            if (fitbounds) {
    7680                // zoom the map to the polyline
  • leaflet-map/trunk/shortcodes/class.geojson-shortcode.php

    r1943975 r2007357  
    8787            window.WPLeafletMapPlugin = window.WPLeafletMapPlugin || [];
    8888            window.WPLeafletMapPlugin.push(function () {
    89                 var previous_map = window.WPLeafletMapPlugin.getCurrentMap(),
    90                     src = '<?php echo $src; ?>',
     89                var src = '<?php echo $src; ?>',
    9190                    default_style = <?php echo $style_json; ?>,
    9291                    rewrite_keys = {
     
    10099                        type: '<?php echo $class::$type; ?>',
    101100                        style : layerStyle,
    102                         onEachFeature : onEachFeature
     101                        onEachFeature : onEachFeature,
    103102                    }),
    104103                    fitbounds = <?php echo $fitbounds; ?>,
    105104                    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 );
    107109                if (fitbounds) {
    108110                    layer.on('ready', function () {
     
    110112                    });
    111113                }
    112                 layer.addTo( previous_map );
    113114                function layerStyle (feature) {
    114115                    var props = feature.properties || {};
  • leaflet-map/trunk/shortcodes/class.gpx-shortcode.php

    r1851128 r2007357  
    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}
  • leaflet-map/trunk/shortcodes/class.line-shortcode.php

    r1943975 r2007357  
    8181            var previous_map = window.WPLeafletMapPlugin.getCurrentMap(),
    8282                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 );
    8586            if (fitbounds) {
    8687                // zoom the map to the polyline
  • leaflet-map/trunk/shortcodes/class.map-shortcode.php

    r2006129 r2007357  
    8181            $doubleclickzoom : $settings->get('double_click_zoom');
    8282       
    83         // backwards-compatible fit_markers
     83        // @deprecated backwards-compatible fit_markers
    8484        $atts['fit_markers'] = array_key_exists('fit_markers', $atts) ?
    8585            $fit_markers : $settings->get('fit_markers');
  • leaflet-map/trunk/shortcodes/class.marker-shortcode.php

    r1943975 r2007357  
    171171                map = window.WPLeafletMapPlugin.getCurrentMap(),
    172172                is_image = map.is_image_map,
    173                 markergroup = window.WPLeafletMapPlugin.getCurrentMarkerGroup();
     173                group = window.WPLeafletMapPlugin.getCurrentGroup();
    174174            <?php
    175175            if (empty($lat) && empty($lng)) {
     
    196196                });
    197197            }
    198 
    199             marker.addTo( markergroup );
     198            marker.addTo( group );
    200199            <?php
    201200                $this->LM->add_popup_to_shape($atts, $content, 'marker');
  • leaflet-map/trunk/templates/shortcode-helper.php

    r2006129 r2007357  
    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
Note: See TracChangeset for help on using the changeset viewer.