Plugin Directory

Changeset 1562359 for leaflet-map


Ignore:
Timestamp:
12/27/2016 03:37:05 AM (9 years ago)
Author:
bozdoz
Message:

tagging 2.3.0

Location:
leaflet-map
Files:
2 edited
3 copied

Legend:

Unmodified
Added
Removed
  • leaflet-map/tags/2.3.0/leaflet-map.php

    r1562348 r1562359  
    66    Plugin Name: Leaflet Map
    77    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.0
     8    Version: 2.3.0
    99    License: GPL2
    1010    */
     
    119119            add_shortcode('leaflet-image', array(&$this, 'image_shortcode'));
    120120            add_shortcode('leaflet-geojson', array(&$this, 'geojson_shortcode'));
     121            add_shortcode('leaflet-kml', array(&$this, 'kml_shortcode'));
    121122
    122123            /* allow maps on excerpts */
     
    178179            // optional ajax geojson plugin
    179180            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);
    180185           
    181186            /* run an init function because other wordpress plugins don't play well with their window.onload functions */
     
    494499        }
    495500
    496         public function geojson_shortcode ( $atts ) {
    497            
     501        public function general_shape_shortcode ( $atts, $wp_script, $L_method, $default = '' ) {
    498502            $leaflet_map_count = self::$leaflet_map_count;
    499503
    500             wp_enqueue_script('leaflet_ajax_geojson_js');
     504            wp_enqueue_script( $wp_script );
    501505
    502506            if ($atts) {
     
    505509
    506510            /* 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;
    508512
    509513            $style = array(
     
    536540                            'stroke-width' : 'width',
    537541                        },
    538                         layer = L.ajaxGeoJson(src, {
     542                        layer = L.{$L_method}(src, {
    539543                            style : layerStyle,
    540544                            onEachFeature : onEachFeature
     
    587591
    588592            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           
    589605        }
    590606
  • leaflet-map/tags/2.3.0/readme.txt

    r1562348 r1562359  
    88Requires at least: 3.0.1
    99Tested up to: 4.7
    10 Version: 2.2.0
    11 Stable tag: 2.2.0
     10Version: 2.3.0
     11Stable tag: 2.3.0
    1212License: GPLv2
    1313License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    6363
    6464Yes, 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
     68Sure!? Use the same attributes as leaflet-geojson (above), but use the `[leaflet-kml]` shortcode.
    6569
    6670* Can I add a message to a marker?
     
    103107== Changelog ==
    104108
     109= 2.3.0 =
     110* Added KML support `[leaflet-kml]`;
     111
    105112= 2.2.0 =
    106113* Added popup_text and popup_property to leaflet-geojson to bind popups via a shortcode property or geojson properties
     
    171178== Upgrade Notice ==
    172179
     180= 2.3.0 =
     181Added KML support `[leaflet-kml]`;
     182
    173183= 2.2.0 =
    174184Added 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  
    66    Plugin Name: Leaflet Map
    77    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.0
     8    Version: 2.3.0
    99    License: GPL2
    1010    */
     
    119119            add_shortcode('leaflet-image', array(&$this, 'image_shortcode'));
    120120            add_shortcode('leaflet-geojson', array(&$this, 'geojson_shortcode'));
     121            add_shortcode('leaflet-kml', array(&$this, 'kml_shortcode'));
    121122
    122123            /* allow maps on excerpts */
     
    178179            // optional ajax geojson plugin
    179180            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);
    180185           
    181186            /* run an init function because other wordpress plugins don't play well with their window.onload functions */
     
    494499        }
    495500
    496         public function geojson_shortcode ( $atts ) {
    497            
     501        public function general_shape_shortcode ( $atts, $wp_script, $L_method, $default = '' ) {
    498502            $leaflet_map_count = self::$leaflet_map_count;
    499503
    500             wp_enqueue_script('leaflet_ajax_geojson_js');
     504            wp_enqueue_script( $wp_script );
    501505
    502506            if ($atts) {
     
    505509
    506510            /* 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;
    508512
    509513            $style = array(
     
    536540                            'stroke-width' : 'width',
    537541                        },
    538                         layer = L.ajaxGeoJson(src, {
     542                        layer = L.{$L_method}(src, {
    539543                            style : layerStyle,
    540544                            onEachFeature : onEachFeature
     
    587591
    588592            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           
    589605        }
    590606
  • leaflet-map/trunk/readme.txt

    r1562348 r1562359  
    88Requires at least: 3.0.1
    99Tested up to: 4.7
    10 Version: 2.2.0
    11 Stable tag: 2.2.0
     10Version: 2.3.0
     11Stable tag: 2.3.0
    1212License: GPLv2
    1313License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    6363
    6464Yes, 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
     68Sure!? Use the same attributes as leaflet-geojson (above), but use the `[leaflet-kml]` shortcode.
    6569
    6670* Can I add a message to a marker?
     
    103107== Changelog ==
    104108
     109= 2.3.0 =
     110* Added KML support `[leaflet-kml]`;
     111
    105112= 2.2.0 =
    106113* Added popup_text and popup_property to leaflet-geojson to bind popups via a shortcode property or geojson properties
     
    171178== Upgrade Notice ==
    172179
     180= 2.3.0 =
     181Added KML support `[leaflet-kml]`;
     182
    173183= 2.2.0 =
    174184Added 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.