Plugin Directory

Changeset 2519924


Ignore:
Timestamp:
04/22/2021 04:37:27 PM (5 years ago)
Author:
techtimo
Message:

Update to version 0.10.2 from GitHub

Location:
spotmap
Files:
10 edited
1 copied

Legend:

Unmodified
Added
Removed
  • spotmap/tags/0.10.2/public/class-spotmap-public.php

    r2479440 r2519924  
    173173    }
    174174    public function show_spotmap($atts,$content = null){
    175 
     175        if(empty($atts)){
     176            $atts = [];
     177        }
    176178        error_log("Shortcode init vals: ".wp_json_encode($atts));
    177179        // $atts['feeds'] = $atts['devices'];
     
    186188                'tiny-types' => !empty(get_option('spotmap_default_values')['tiny-types']) ?get_option('spotmap_default_values')['tiny-types'] : NULL,
    187189                'auto-reload' => FALSE,
     190                'last-point' => FALSE,
    188191                'date-range-from' => NULL,
    189192                'date' => NULL,
     
    198201            ], $atts ),
    199202            $atts);
    200         // get the keys that don't require a value
    201         if(array_key_exists('auto-reload',$atts)){
    202             $a['auto-reload']=TRUE;
    203         }
    204         if(array_key_exists('debug',$atts)){
    205             $a['debug']=TRUE;
     203        // get the keys that don't require a value and can only bet true or false
     204        foreach (['auto-reload','debug',] as $value) {
     205            if(in_array($value,$atts)){
     206                error_log($value . 'exists');
     207                if (array_key_exists($value,$atts) && !empty($atts[$value])){
     208                    // if a real value was provided in the shortcode
     209                    $a[$value] = $atts[$value];
     210                } else {
     211                    $a[$value]=TRUE;
     212                }
     213            }
     214        }
     215        // get the values that could be boolean or have another value
     216        foreach (['last-point',] as $value) {
     217            if(in_array($value,$atts)){
     218                error_log($value . 'exists');
     219                $a[$value]=TRUE;
     220            }
    206221        }
    207222
     
    296311            'mapOverlays' => $a['map-overlays'],
    297312            'autoReload' => $a['auto-reload'],
     313            'lastPoint' => $a['last-point'],
    298314            'debug' => $a['debug'],
    299315            'mapId' => $map_id
  • spotmap/tags/0.10.2/public/js/block.js

    r2479440 r2519924  
    2525                props.setAttributes({ autoReload: false });
    2626                props.setAttributes({ debug: false });
     27                props.setAttributes({ lastPoint: false });
    2728                props.setAttributes({ height: '500' });
    2829                props.setAttributes({ dateRange: {to:'',from:'', }});
     
    6566                        el(ToggleControl,
    6667                            {
    67                                 label: 'Debug',
     68                                label: 'Show Last Point',
    6869                                onChange: (value) => {
    69                                     props.setAttributes({ debug: value });
     70                                    props.setAttributes({ lastPoint: value });
    7071                                },
    71                                 checked: props.attributes.debug,
     72                                checked: props.attributes.lastPoint,
     73                                help: "Show the latest point as a big marker.",
    7274                            }
    7375                        )
    7476                    ),
    75                     /* Toggle Field */
    7677                    el(PanelRow, {},
    7778                        el(ToggleControl,
     
    8283                                },
    8384                                checked: props.attributes["autoReload"],
    84                                 help: "If enabled this will create"
     85                                help: "If enabled this will update the map without reloading the whole webpage. Not tested very much. Will have unexpected results with 'Last Point'"
     86                            }
     87                        )
     88                    ),
     89                    el(PanelRow, {},
     90                        el(ToggleControl,
     91                            {
     92                                label: 'Debug',
     93                                onChange: (value) => {
     94                                    props.setAttributes({ debug: value });
     95                                },
     96                                checked: props.attributes.debug,
    8597                            }
    8698                        )
     
    373385        let options = [];
    374386
    375         options.push(el(PanelRow, {},
     387        options.push(
     388            el(PanelRow, {},
     389                el(MediaUpload,{
     390                    allowedTypes: ['text/xml'],
     391                    multiple: true,
     392                    value: props.attributes.gpx.map(entry => entry.id),
     393                    title: "Choose gpx tracks (Hint: press ctrl to select multiple)",
     394                    onSelect: function (gpx){
     395                        let returnArray = [];
     396                        lodash.forEach(gpx,(track)=>{
     397                            track = lodash.pick(track,['id','url','title']);
     398                            returnArray.push(track);
     399                        })
     400                        props.setAttributes({ gpx: returnArray});
     401                    },
     402                    render:  function (callback){
     403                        return el(Button,
     404                            {
     405                                onClick: callback.open,
     406                                isPrimary: true,
     407                            },
     408                            "Select from Media Library"
     409                        )}
     410                    })
     411            ),
     412            el(PanelRow, {},
     413                el("em",{},"Select a color:"),
     414            el(PanelRow, {},
    376415            el(ColorPalette , {
    377416                label: "Colors",
    378417                colors: [
    379                 {name: "black", color: "black"},
    380                 {name: "blue", color: "blue"},
    381                 {name: "gold", color: "gold"},
    382                 {name: "green", color: "green"},
    383                 {name: "grey", color: "grey"},
    384                 {name: "red", color: "red"},
    385                 {name: "violet", color: "violet"},
    386                 {name: "yellow", color: "yellow"},
    387             ],
     418                    {name: "blue", color: "blue"},
     419                    {name: "gold", color: "gold"},
     420                    {name: "green", color: "green"},
     421                    {name: "red", color: "red"},
     422                    {name: "black", color: "black"},
     423                    {name: "violet", color: "violet"},
     424                ],
    388425                onChange: (value) => {
    389426                    let returnArray = [];
     
    396433                },
    397434                value: props.attributes.gpx[0]?  props.attributes.gpx[0].color : 'gold',
    398                 disableCustomColors: true,
     435                disableCustomColors: false,
     436                clearable: false,
    399437            })
    400         ),
    401 
    402         el(PanelRow, {},
    403             el(MediaUpload,{
    404                 allowedTypes: ['text/xml'],
    405                 multiple: true,
    406                 value: props.attributes.gpx.map(entry => entry.id),
    407                 title: "Choose gpx tracks (Hint: press ctrl to select multiple)",
    408                 onSelect: function (gpx){
    409                     let returnArray = [];
    410                     lodash.forEach(gpx,(track)=>{
    411                         track = lodash.pick(track,['id','url','title']);
    412                         returnArray.push(track);
    413                     })
    414                     props.setAttributes({ gpx: returnArray});
    415                 },
    416                 render:  function (callback){
    417                     return el(Button,
    418                         {className: "test",
    419                         onClick: callback.open
    420                     },"Open Media Library"
    421                
    422                     )}
    423                 })
    424         ));
     438        ),  )   
     439        );
    425440
    426441
  • spotmap/tags/0.10.2/public/js/maphandler.js

    r2479440 r2519924  
    1919        var self = this;
    2020       
    21         // https://github.com/Leaflet/Leaflet/issues/3962
     21        let oldOptions = jQuery('#'+ this.options.mapId).data('options');
     22        jQuery('#'+ this.options.mapId).data('options',this.options);
    2223        var container = L.DomUtil.get(this.options.mapId);
    2324        if(container != null){
    24             if(lodash.isEqual(this.options,this.oldOptions)){
    25                 console.log("SAME!!")
    26             } else {
    27                 console.log("NOT SAME!!")
    28                 console.log(this.oldOptions)
    29 
    30             }
    31             container._leaflet_id = null;
    32             jQuery('#'+ this.options.mapId + " > .leaflet-control-container" ).empty();
    33             jQuery('#'+ this.options.mapId + " > .leaflet-pane" ).empty();
    34         }
    35         this.oldOptions = this.options;
     25            if(!lodash.isEqual(this.options,oldOptions)){
     26                // https://github.com/Leaflet/Leaflet/issues/3962
     27                container._leaflet_id = null;
     28                jQuery('#'+ this.options.mapId + " > .leaflet-control-container" ).empty();
     29                jQuery('#'+ this.options.mapId + " > .leaflet-pane" ).empty();
     30            }
     31        }
    3632        this.debug("Lodash version: " + lodash.VERSION);
    3733   
     
    197193                    else if (entry.type == "HELP-CANCEL")
    198194                        markerOptions = { icon: markers['green'] };
     195                    // last iteration or feed changed?
     196                    if(response.length == index + 1 || response[index+1].feed_name != entry.feed_name) {
     197                        console.log("test")
     198                        if(this.getOption('lastPoint') == true){
     199                            markerOptions = { icon: markers[color] };
     200                        } else if(this.getOption('lastPoint')){
     201                            markerOptions = { icon: markers[this.getOption('lastPoint')] };
     202
     203                        }
     204                    }
    199205   
    200206                    message += 'Time: ' + entry.time + '</br>Date: ' + entry.date + '</br>';
     
    476482            return 'gold';
    477483        }
     484        if (option == 'lastPoint') {
     485            if (this.options.lastPoint)
     486                return this.options.lastPoint;
     487            return false;
     488        }
     489
    478490        if (option == 'splitLines' && config.feed) {
    479491            if (this.options.styles[config.feed] && this.options.styles[config.feed].splitLinesEnabled && this.options.styles[config.feed].splitLinesEnabled === false)
  • spotmap/tags/0.10.2/readme.txt

    r2479440 r2519924  
    66License URI: http://www.gnu.org/licenses/gpl-2.0.html
    77Requires at least: 5.3
    8 Tested up to: 5.6
     8Tested up to: 5.7
    99
    1010See your Spot device movements on an embedded map inside your Blog! 🗺 Add GPX tracks, routes and waypoints to see a planned route.
     
    1212## Description
    1313
    14 Spot does not offer a history of sent positions for more than 7 days. That's where Spotmap comes into the game:
     14Spot does not offer the storage of pointsdfree of charge for long. That's where Spotmap comes into the game:
    1515Your Wordpress Site will store all positions ever sent. It checks for new positions every 2.5 minutes.
    1616It supports different devices (They can even belong to different accounts).
     17It supports many more web
    1718
    1819🆕 Support of Gutenberg block editor. Just type `/spotmap` and open the settings on the right.
     
    4445Now you can enter your XML Feed Id, a name for the feed and a password if you have one.  Press "Save". A few minutes later Wordpress will download the points that are present in the XML Feed.
    4546
    46 In the mean time we can create an empty map with the Shortcode:
     47In the mean time you can create an empty map with the Shortcode:
    4748`[spotmap]`
     49
     50If you use the block editor Gutenberg, you can search for a block named 'Spotmap'.
    4851
    4952🎉 Congrats! You just created your first Spotmap. 🎉
    5053
     54If you use the Block editor make sure to select the map and click on the settings icon in the top right corner, in order to see all settings related to the map.
     55
     56If you use the shortcode,check the Additional attributes section.
    5157👉 If you need help to configure your map, post a question in the [support forum](https://wordpress.org/support/plugin/spotmap/). 👈
    5258### Additional attributes
     59
     60If you add new maps, check the FAQ
    5361
    5462To fine tune the map, there are some attributes we can pass with the shortcode:
     
    7886- `date-range-to=2022-01-01 19:00` can be used to show all points until date and time X.
    7987
    80 - `auto-reload=1` will auto update the map without the need to reload the page.
     88- `auto-reload` will auto update the map without the need to reload the page. (This hasn't been tested much...)
     89
     90- `last-point` will show the last sent point as big marker, to be easily found. Can also be used with a limited range of colors (yellow,red,green,black,gray,blue) like `last-point=red`
    8191
    8292- `tiny-types=UNLIMITED-TRACK,STOP` can be used to configure if a point is shown with a big marker on the map or not
    8393
    84 - `feeds` can be set, if multiple feeds get used. (See example below)
     94- `feeds` can be set, if multiple feeds get used. (See example below, if you have only one spot this is not needed)
    8595
    8696#### GPX
     
    8999- `gpx-name="Track 1,Track 2"` give the tracks a nice name. (Spaces can be used)
    90100
    91 - `gpx-url="yourwordpress.com/wp-content/track1.gpx,yourwordpress.com/wp-content/track2.gpx"` specify the URL of the GPX files. (You can upload GPX files to your blog like an image)
     101- `gpx-url="yourwordpress.com/wp-content/track1.gpx,yourwordpress.com/wp-content/track2.gpx"` specify the URL of the GPX files. (You can upload GPX files to your media library)
    92102
    93103- `gpx-color="green,#347F33"` give your tracks some color. (It can be any color you can think of, or some hex values)
     
    105115
    106116
    107 We can also show multiple feeds in different colors on a same day:
     117We can also show multiple feeds in different colors on a same day (from 0:00:00 to 23:59:59):
    108118
    109119`[spotmap mapcenter=last feeds="My first spot,My other Device" colors="gray,green" date="2020-06-01"]`
     
    113123
    114124### How do I get my Feed ID?
    115 You need to create an XML Feed in your spot account. ([See here](https://github.com/techtimo/spotmap/issues/4#issuecomment-638001718) for more details)
     125You need to create an XML Feed in your spot account. ([See here](https://www.findmespot.com/en-us/support/spot-x/get-help/general/spot-api-support) for more details)
    116126Unless you like to group devices under one name, it's good to create one feed per device, so you can manage the devices independently.
    117127Your XML Feed id should look similar to this: `0Wl3diTJcqqvncI6NNsoqJV5ygrFtQfBB`
     
    1221322. (optionally) [Mapbox, Inc.](mapbox.com) To get satelite images and nice looking maps, you can sign up for a [Mapbox API Token](https://account.mapbox.com/access-tokens/). I recommend to restrict the token usage to your domain only.
    1231333. (optionally) [Thunderforest](thunderforest.com) To get another set of maps. Create an account [here](https://manage.thunderforest.com/users/sign_up?plan_id=5). Paste the key in the settings page.
    124 4. (optionally) [TimeZoneDB.com](TimeZoneDB.com)  To calculate the localtime of sent positions. Create an account [here](https://timezonedb.com/register). Paste the key in the settings page.
     1344. (optionally) [Land Information New Zealand (LINZ)](https://www.linz.govt.nz) To get the official Topo Maps of NZ create an account [here](https://www.linz.govt.nz/data/linz-data-service/guides-and-documentation/creating-an-api-key). Paste the key in the settings page.
     1355. (optionally) [Géoportail France](https://geoservices.ign.fr/documentation/diffusion/formulaire-de-commande-geoservices.html) To get the official Topo Maps of IGN France. Create an account [here](https://www.sphinxonline.com/surveyserver/s/etudesmk/Geoservices_2021/questionnaire.htm) (french only). Paste the key in the settings page.
     1366. (optionally) [TimeZoneDB.com](TimeZoneDB.com)  To calculate the localtime of sent positions. Create an account [here](https://timezonedb.com/register). Paste the key in the settings page.
    125137
    126138
    127139### Can I use/add other maps?
    128 Have you created your mapbox/thunderforest API key yet? If not this is a good way to start and get other map styles.
     140Have you created your mapbox/thunderforest API key yet? If not this is a good way to start and get other map styles. See the question 'Which 3rd Party Services are getting used?' for details
    129141If you still search for another map search [here](https://leaflet-extras.github.io/leaflet-providers/preview/) and also [here](https://wiki.openstreetmap.org/wiki/Tiles).
    130142If you have found a map, create a new post in the [support forum](https://wordpress.org/support/plugin/spotmap/).
     
    140152
    141153## Changelog
     154
     155= 0.10.2 =
     156- tested Wordpress 5.7
     157- add last-point option to show the latest position as a big marker. (Requested by Elia)
     158- fix reload issue of the map inside Gutenberg if no changes were made
     159
    142160= 0.10.1 =
    143161Full Gutenberg Block support
     
    161179
    162180
    163 = 0.3 =
    164 - First working draft
    165 
    166181## Upgrade Notice
    167182 
     
    175190= 0.7 =
    176191redoing the whole frontend part. Now it looks much better!
    177  
  • spotmap/tags/0.10.2/spotmap.php

    r2479440 r2519924  
    44 * Plugin URI:        https://github.com/techtimo/spotmap
    55 * Description:       Add an embedded map that shows the movement of a Spot device
    6  * Version:           0.10.1
     6 * Version:           0.10.2
    77 * Author:            Timo Giese
    88 * Author URI:        https://github.com/techtimo
  • spotmap/trunk/public/class-spotmap-public.php

    r2479440 r2519924  
    173173    }
    174174    public function show_spotmap($atts,$content = null){
    175 
     175        if(empty($atts)){
     176            $atts = [];
     177        }
    176178        error_log("Shortcode init vals: ".wp_json_encode($atts));
    177179        // $atts['feeds'] = $atts['devices'];
     
    186188                'tiny-types' => !empty(get_option('spotmap_default_values')['tiny-types']) ?get_option('spotmap_default_values')['tiny-types'] : NULL,
    187189                'auto-reload' => FALSE,
     190                'last-point' => FALSE,
    188191                'date-range-from' => NULL,
    189192                'date' => NULL,
     
    198201            ], $atts ),
    199202            $atts);
    200         // get the keys that don't require a value
    201         if(array_key_exists('auto-reload',$atts)){
    202             $a['auto-reload']=TRUE;
    203         }
    204         if(array_key_exists('debug',$atts)){
    205             $a['debug']=TRUE;
     203        // get the keys that don't require a value and can only bet true or false
     204        foreach (['auto-reload','debug',] as $value) {
     205            if(in_array($value,$atts)){
     206                error_log($value . 'exists');
     207                if (array_key_exists($value,$atts) && !empty($atts[$value])){
     208                    // if a real value was provided in the shortcode
     209                    $a[$value] = $atts[$value];
     210                } else {
     211                    $a[$value]=TRUE;
     212                }
     213            }
     214        }
     215        // get the values that could be boolean or have another value
     216        foreach (['last-point',] as $value) {
     217            if(in_array($value,$atts)){
     218                error_log($value . 'exists');
     219                $a[$value]=TRUE;
     220            }
    206221        }
    207222
     
    296311            'mapOverlays' => $a['map-overlays'],
    297312            'autoReload' => $a['auto-reload'],
     313            'lastPoint' => $a['last-point'],
    298314            'debug' => $a['debug'],
    299315            'mapId' => $map_id
  • spotmap/trunk/public/js/block.js

    r2479440 r2519924  
    2525                props.setAttributes({ autoReload: false });
    2626                props.setAttributes({ debug: false });
     27                props.setAttributes({ lastPoint: false });
    2728                props.setAttributes({ height: '500' });
    2829                props.setAttributes({ dateRange: {to:'',from:'', }});
     
    6566                        el(ToggleControl,
    6667                            {
    67                                 label: 'Debug',
     68                                label: 'Show Last Point',
    6869                                onChange: (value) => {
    69                                     props.setAttributes({ debug: value });
     70                                    props.setAttributes({ lastPoint: value });
    7071                                },
    71                                 checked: props.attributes.debug,
     72                                checked: props.attributes.lastPoint,
     73                                help: "Show the latest point as a big marker.",
    7274                            }
    7375                        )
    7476                    ),
    75                     /* Toggle Field */
    7677                    el(PanelRow, {},
    7778                        el(ToggleControl,
     
    8283                                },
    8384                                checked: props.attributes["autoReload"],
    84                                 help: "If enabled this will create"
     85                                help: "If enabled this will update the map without reloading the whole webpage. Not tested very much. Will have unexpected results with 'Last Point'"
     86                            }
     87                        )
     88                    ),
     89                    el(PanelRow, {},
     90                        el(ToggleControl,
     91                            {
     92                                label: 'Debug',
     93                                onChange: (value) => {
     94                                    props.setAttributes({ debug: value });
     95                                },
     96                                checked: props.attributes.debug,
    8597                            }
    8698                        )
     
    373385        let options = [];
    374386
    375         options.push(el(PanelRow, {},
     387        options.push(
     388            el(PanelRow, {},
     389                el(MediaUpload,{
     390                    allowedTypes: ['text/xml'],
     391                    multiple: true,
     392                    value: props.attributes.gpx.map(entry => entry.id),
     393                    title: "Choose gpx tracks (Hint: press ctrl to select multiple)",
     394                    onSelect: function (gpx){
     395                        let returnArray = [];
     396                        lodash.forEach(gpx,(track)=>{
     397                            track = lodash.pick(track,['id','url','title']);
     398                            returnArray.push(track);
     399                        })
     400                        props.setAttributes({ gpx: returnArray});
     401                    },
     402                    render:  function (callback){
     403                        return el(Button,
     404                            {
     405                                onClick: callback.open,
     406                                isPrimary: true,
     407                            },
     408                            "Select from Media Library"
     409                        )}
     410                    })
     411            ),
     412            el(PanelRow, {},
     413                el("em",{},"Select a color:"),
     414            el(PanelRow, {},
    376415            el(ColorPalette , {
    377416                label: "Colors",
    378417                colors: [
    379                 {name: "black", color: "black"},
    380                 {name: "blue", color: "blue"},
    381                 {name: "gold", color: "gold"},
    382                 {name: "green", color: "green"},
    383                 {name: "grey", color: "grey"},
    384                 {name: "red", color: "red"},
    385                 {name: "violet", color: "violet"},
    386                 {name: "yellow", color: "yellow"},
    387             ],
     418                    {name: "blue", color: "blue"},
     419                    {name: "gold", color: "gold"},
     420                    {name: "green", color: "green"},
     421                    {name: "red", color: "red"},
     422                    {name: "black", color: "black"},
     423                    {name: "violet", color: "violet"},
     424                ],
    388425                onChange: (value) => {
    389426                    let returnArray = [];
     
    396433                },
    397434                value: props.attributes.gpx[0]?  props.attributes.gpx[0].color : 'gold',
    398                 disableCustomColors: true,
     435                disableCustomColors: false,
     436                clearable: false,
    399437            })
    400         ),
    401 
    402         el(PanelRow, {},
    403             el(MediaUpload,{
    404                 allowedTypes: ['text/xml'],
    405                 multiple: true,
    406                 value: props.attributes.gpx.map(entry => entry.id),
    407                 title: "Choose gpx tracks (Hint: press ctrl to select multiple)",
    408                 onSelect: function (gpx){
    409                     let returnArray = [];
    410                     lodash.forEach(gpx,(track)=>{
    411                         track = lodash.pick(track,['id','url','title']);
    412                         returnArray.push(track);
    413                     })
    414                     props.setAttributes({ gpx: returnArray});
    415                 },
    416                 render:  function (callback){
    417                     return el(Button,
    418                         {className: "test",
    419                         onClick: callback.open
    420                     },"Open Media Library"
    421                
    422                     )}
    423                 })
    424         ));
     438        ),  )   
     439        );
    425440
    426441
  • spotmap/trunk/public/js/maphandler.js

    r2479440 r2519924  
    1919        var self = this;
    2020       
    21         // https://github.com/Leaflet/Leaflet/issues/3962
     21        let oldOptions = jQuery('#'+ this.options.mapId).data('options');
     22        jQuery('#'+ this.options.mapId).data('options',this.options);
    2223        var container = L.DomUtil.get(this.options.mapId);
    2324        if(container != null){
    24             if(lodash.isEqual(this.options,this.oldOptions)){
    25                 console.log("SAME!!")
    26             } else {
    27                 console.log("NOT SAME!!")
    28                 console.log(this.oldOptions)
    29 
    30             }
    31             container._leaflet_id = null;
    32             jQuery('#'+ this.options.mapId + " > .leaflet-control-container" ).empty();
    33             jQuery('#'+ this.options.mapId + " > .leaflet-pane" ).empty();
    34         }
    35         this.oldOptions = this.options;
     25            if(!lodash.isEqual(this.options,oldOptions)){
     26                // https://github.com/Leaflet/Leaflet/issues/3962
     27                container._leaflet_id = null;
     28                jQuery('#'+ this.options.mapId + " > .leaflet-control-container" ).empty();
     29                jQuery('#'+ this.options.mapId + " > .leaflet-pane" ).empty();
     30            }
     31        }
    3632        this.debug("Lodash version: " + lodash.VERSION);
    3733   
     
    197193                    else if (entry.type == "HELP-CANCEL")
    198194                        markerOptions = { icon: markers['green'] };
     195                    // last iteration or feed changed?
     196                    if(response.length == index + 1 || response[index+1].feed_name != entry.feed_name) {
     197                        console.log("test")
     198                        if(this.getOption('lastPoint') == true){
     199                            markerOptions = { icon: markers[color] };
     200                        } else if(this.getOption('lastPoint')){
     201                            markerOptions = { icon: markers[this.getOption('lastPoint')] };
     202
     203                        }
     204                    }
    199205   
    200206                    message += 'Time: ' + entry.time + '</br>Date: ' + entry.date + '</br>';
     
    476482            return 'gold';
    477483        }
     484        if (option == 'lastPoint') {
     485            if (this.options.lastPoint)
     486                return this.options.lastPoint;
     487            return false;
     488        }
     489
    478490        if (option == 'splitLines' && config.feed) {
    479491            if (this.options.styles[config.feed] && this.options.styles[config.feed].splitLinesEnabled && this.options.styles[config.feed].splitLinesEnabled === false)
  • spotmap/trunk/readme.txt

    r2479440 r2519924  
    66License URI: http://www.gnu.org/licenses/gpl-2.0.html
    77Requires at least: 5.3
    8 Tested up to: 5.6
     8Tested up to: 5.7
    99
    1010See your Spot device movements on an embedded map inside your Blog! 🗺 Add GPX tracks, routes and waypoints to see a planned route.
     
    1212## Description
    1313
    14 Spot does not offer a history of sent positions for more than 7 days. That's where Spotmap comes into the game:
     14Spot does not offer the storage of pointsdfree of charge for long. That's where Spotmap comes into the game:
    1515Your Wordpress Site will store all positions ever sent. It checks for new positions every 2.5 minutes.
    1616It supports different devices (They can even belong to different accounts).
     17It supports many more web
    1718
    1819🆕 Support of Gutenberg block editor. Just type `/spotmap` and open the settings on the right.
     
    4445Now you can enter your XML Feed Id, a name for the feed and a password if you have one.  Press "Save". A few minutes later Wordpress will download the points that are present in the XML Feed.
    4546
    46 In the mean time we can create an empty map with the Shortcode:
     47In the mean time you can create an empty map with the Shortcode:
    4748`[spotmap]`
     49
     50If you use the block editor Gutenberg, you can search for a block named 'Spotmap'.
    4851
    4952🎉 Congrats! You just created your first Spotmap. 🎉
    5053
     54If you use the Block editor make sure to select the map and click on the settings icon in the top right corner, in order to see all settings related to the map.
     55
     56If you use the shortcode,check the Additional attributes section.
    5157👉 If you need help to configure your map, post a question in the [support forum](https://wordpress.org/support/plugin/spotmap/). 👈
    5258### Additional attributes
     59
     60If you add new maps, check the FAQ
    5361
    5462To fine tune the map, there are some attributes we can pass with the shortcode:
     
    7886- `date-range-to=2022-01-01 19:00` can be used to show all points until date and time X.
    7987
    80 - `auto-reload=1` will auto update the map without the need to reload the page.
     88- `auto-reload` will auto update the map without the need to reload the page. (This hasn't been tested much...)
     89
     90- `last-point` will show the last sent point as big marker, to be easily found. Can also be used with a limited range of colors (yellow,red,green,black,gray,blue) like `last-point=red`
    8191
    8292- `tiny-types=UNLIMITED-TRACK,STOP` can be used to configure if a point is shown with a big marker on the map or not
    8393
    84 - `feeds` can be set, if multiple feeds get used. (See example below)
     94- `feeds` can be set, if multiple feeds get used. (See example below, if you have only one spot this is not needed)
    8595
    8696#### GPX
     
    8999- `gpx-name="Track 1,Track 2"` give the tracks a nice name. (Spaces can be used)
    90100
    91 - `gpx-url="yourwordpress.com/wp-content/track1.gpx,yourwordpress.com/wp-content/track2.gpx"` specify the URL of the GPX files. (You can upload GPX files to your blog like an image)
     101- `gpx-url="yourwordpress.com/wp-content/track1.gpx,yourwordpress.com/wp-content/track2.gpx"` specify the URL of the GPX files. (You can upload GPX files to your media library)
    92102
    93103- `gpx-color="green,#347F33"` give your tracks some color. (It can be any color you can think of, or some hex values)
     
    105115
    106116
    107 We can also show multiple feeds in different colors on a same day:
     117We can also show multiple feeds in different colors on a same day (from 0:00:00 to 23:59:59):
    108118
    109119`[spotmap mapcenter=last feeds="My first spot,My other Device" colors="gray,green" date="2020-06-01"]`
     
    113123
    114124### How do I get my Feed ID?
    115 You need to create an XML Feed in your spot account. ([See here](https://github.com/techtimo/spotmap/issues/4#issuecomment-638001718) for more details)
     125You need to create an XML Feed in your spot account. ([See here](https://www.findmespot.com/en-us/support/spot-x/get-help/general/spot-api-support) for more details)
    116126Unless you like to group devices under one name, it's good to create one feed per device, so you can manage the devices independently.
    117127Your XML Feed id should look similar to this: `0Wl3diTJcqqvncI6NNsoqJV5ygrFtQfBB`
     
    1221322. (optionally) [Mapbox, Inc.](mapbox.com) To get satelite images and nice looking maps, you can sign up for a [Mapbox API Token](https://account.mapbox.com/access-tokens/). I recommend to restrict the token usage to your domain only.
    1231333. (optionally) [Thunderforest](thunderforest.com) To get another set of maps. Create an account [here](https://manage.thunderforest.com/users/sign_up?plan_id=5). Paste the key in the settings page.
    124 4. (optionally) [TimeZoneDB.com](TimeZoneDB.com)  To calculate the localtime of sent positions. Create an account [here](https://timezonedb.com/register). Paste the key in the settings page.
     1344. (optionally) [Land Information New Zealand (LINZ)](https://www.linz.govt.nz) To get the official Topo Maps of NZ create an account [here](https://www.linz.govt.nz/data/linz-data-service/guides-and-documentation/creating-an-api-key). Paste the key in the settings page.
     1355. (optionally) [Géoportail France](https://geoservices.ign.fr/documentation/diffusion/formulaire-de-commande-geoservices.html) To get the official Topo Maps of IGN France. Create an account [here](https://www.sphinxonline.com/surveyserver/s/etudesmk/Geoservices_2021/questionnaire.htm) (french only). Paste the key in the settings page.
     1366. (optionally) [TimeZoneDB.com](TimeZoneDB.com)  To calculate the localtime of sent positions. Create an account [here](https://timezonedb.com/register). Paste the key in the settings page.
    125137
    126138
    127139### Can I use/add other maps?
    128 Have you created your mapbox/thunderforest API key yet? If not this is a good way to start and get other map styles.
     140Have you created your mapbox/thunderforest API key yet? If not this is a good way to start and get other map styles. See the question 'Which 3rd Party Services are getting used?' for details
    129141If you still search for another map search [here](https://leaflet-extras.github.io/leaflet-providers/preview/) and also [here](https://wiki.openstreetmap.org/wiki/Tiles).
    130142If you have found a map, create a new post in the [support forum](https://wordpress.org/support/plugin/spotmap/).
     
    140152
    141153## Changelog
     154
     155= 0.10.2 =
     156- tested Wordpress 5.7
     157- add last-point option to show the latest position as a big marker. (Requested by Elia)
     158- fix reload issue of the map inside Gutenberg if no changes were made
     159
    142160= 0.10.1 =
    143161Full Gutenberg Block support
     
    161179
    162180
    163 = 0.3 =
    164 - First working draft
    165 
    166181## Upgrade Notice
    167182 
     
    175190= 0.7 =
    176191redoing the whole frontend part. Now it looks much better!
    177  
  • spotmap/trunk/spotmap.php

    r2479440 r2519924  
    44 * Plugin URI:        https://github.com/techtimo/spotmap
    55 * Description:       Add an embedded map that shows the movement of a Spot device
    6  * Version:           0.10.1
     6 * Version:           0.10.2
    77 * Author:            Timo Giese
    88 * Author URI:        https://github.com/techtimo
Note: See TracChangeset for help on using the changeset viewer.