Changeset 2519924
- Timestamp:
- 04/22/2021 04:37:27 PM (5 years ago)
- Location:
- spotmap
- Files:
-
- 10 edited
- 1 copied
-
tags/0.10.2 (copied) (copied from spotmap/trunk)
-
tags/0.10.2/public/class-spotmap-public.php (modified) (4 diffs)
-
tags/0.10.2/public/js/block.js (modified) (5 diffs)
-
tags/0.10.2/public/js/maphandler.js (modified) (3 diffs)
-
tags/0.10.2/readme.txt (modified) (11 diffs)
-
tags/0.10.2/spotmap.php (modified) (1 diff)
-
trunk/public/class-spotmap-public.php (modified) (4 diffs)
-
trunk/public/js/block.js (modified) (5 diffs)
-
trunk/public/js/maphandler.js (modified) (3 diffs)
-
trunk/readme.txt (modified) (11 diffs)
-
trunk/spotmap.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
spotmap/tags/0.10.2/public/class-spotmap-public.php
r2479440 r2519924 173 173 } 174 174 public function show_spotmap($atts,$content = null){ 175 175 if(empty($atts)){ 176 $atts = []; 177 } 176 178 error_log("Shortcode init vals: ".wp_json_encode($atts)); 177 179 // $atts['feeds'] = $atts['devices']; … … 186 188 'tiny-types' => !empty(get_option('spotmap_default_values')['tiny-types']) ?get_option('spotmap_default_values')['tiny-types'] : NULL, 187 189 'auto-reload' => FALSE, 190 'last-point' => FALSE, 188 191 'date-range-from' => NULL, 189 192 'date' => NULL, … … 198 201 ], $atts ), 199 202 $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 } 206 221 } 207 222 … … 296 311 'mapOverlays' => $a['map-overlays'], 297 312 'autoReload' => $a['auto-reload'], 313 'lastPoint' => $a['last-point'], 298 314 'debug' => $a['debug'], 299 315 'mapId' => $map_id -
spotmap/tags/0.10.2/public/js/block.js
r2479440 r2519924 25 25 props.setAttributes({ autoReload: false }); 26 26 props.setAttributes({ debug: false }); 27 props.setAttributes({ lastPoint: false }); 27 28 props.setAttributes({ height: '500' }); 28 29 props.setAttributes({ dateRange: {to:'',from:'', }}); … … 65 66 el(ToggleControl, 66 67 { 67 label: ' Debug',68 label: 'Show Last Point', 68 69 onChange: (value) => { 69 props.setAttributes({ debug: value });70 props.setAttributes({ lastPoint: value }); 70 71 }, 71 checked: props.attributes.debug, 72 checked: props.attributes.lastPoint, 73 help: "Show the latest point as a big marker.", 72 74 } 73 75 ) 74 76 ), 75 /* Toggle Field */76 77 el(PanelRow, {}, 77 78 el(ToggleControl, … … 82 83 }, 83 84 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, 85 97 } 86 98 ) … … 373 385 let options = []; 374 386 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, {}, 376 415 el(ColorPalette , { 377 416 label: "Colors", 378 417 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 ], 388 425 onChange: (value) => { 389 426 let returnArray = []; … … 396 433 }, 397 434 value: props.attributes.gpx[0]? props.attributes.gpx[0].color : 'gold', 398 disableCustomColors: true, 435 disableCustomColors: false, 436 clearable: false, 399 437 }) 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 ); 425 440 426 441 -
spotmap/tags/0.10.2/public/js/maphandler.js
r2479440 r2519924 19 19 var self = this; 20 20 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); 22 23 var container = L.DomUtil.get(this.options.mapId); 23 24 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 } 36 32 this.debug("Lodash version: " + lodash.VERSION); 37 33 … … 197 193 else if (entry.type == "HELP-CANCEL") 198 194 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 } 199 205 200 206 message += 'Time: ' + entry.time + '</br>Date: ' + entry.date + '</br>'; … … 476 482 return 'gold'; 477 483 } 484 if (option == 'lastPoint') { 485 if (this.options.lastPoint) 486 return this.options.lastPoint; 487 return false; 488 } 489 478 490 if (option == 'splitLines' && config.feed) { 479 491 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 6 6 License URI: http://www.gnu.org/licenses/gpl-2.0.html 7 7 Requires at least: 5.3 8 Tested up to: 5. 68 Tested up to: 5.7 9 9 10 10 See your Spot device movements on an embedded map inside your Blog! 🗺 Add GPX tracks, routes and waypoints to see a planned route. … … 12 12 ## Description 13 13 14 Spot does not offer a history of sent positions for more than 7 days. That's where Spotmap comes into the game:14 Spot does not offer the storage of pointsdfree of charge for long. That's where Spotmap comes into the game: 15 15 Your Wordpress Site will store all positions ever sent. It checks for new positions every 2.5 minutes. 16 16 It supports different devices (They can even belong to different accounts). 17 It supports many more web 17 18 18 19 🆕 Support of Gutenberg block editor. Just type `/spotmap` and open the settings on the right. … … 44 45 Now 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. 45 46 46 In the mean time wecan create an empty map with the Shortcode:47 In the mean time you can create an empty map with the Shortcode: 47 48 `[spotmap]` 49 50 If you use the block editor Gutenberg, you can search for a block named 'Spotmap'. 48 51 49 52 🎉 Congrats! You just created your first Spotmap. 🎉 50 53 54 If 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 56 If you use the shortcode,check the Additional attributes section. 51 57 👉 If you need help to configure your map, post a question in the [support forum](https://wordpress.org/support/plugin/spotmap/). 👈 52 58 ### Additional attributes 59 60 If you add new maps, check the FAQ 53 61 54 62 To fine tune the map, there are some attributes we can pass with the shortcode: … … 78 86 - `date-range-to=2022-01-01 19:00` can be used to show all points until date and time X. 79 87 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` 81 91 82 92 - `tiny-types=UNLIMITED-TRACK,STOP` can be used to configure if a point is shown with a big marker on the map or not 83 93 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) 85 95 86 96 #### GPX … … 89 99 - `gpx-name="Track 1,Track 2"` give the tracks a nice name. (Spaces can be used) 90 100 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) 92 102 93 103 - `gpx-color="green,#347F33"` give your tracks some color. (It can be any color you can think of, or some hex values) … … 105 115 106 116 107 We can also show multiple feeds in different colors on a same day :117 We can also show multiple feeds in different colors on a same day (from 0:00:00 to 23:59:59): 108 118 109 119 `[spotmap mapcenter=last feeds="My first spot,My other Device" colors="gray,green" date="2020-06-01"]` … … 113 123 114 124 ### 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)125 You 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) 116 126 Unless you like to group devices under one name, it's good to create one feed per device, so you can manage the devices independently. 117 127 Your XML Feed id should look similar to this: `0Wl3diTJcqqvncI6NNsoqJV5ygrFtQfBB` … … 122 132 2. (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. 123 133 3. (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. 134 4. (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. 135 5. (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. 136 6. (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. 125 137 126 138 127 139 ### 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. 140 Have 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 129 141 If 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). 130 142 If you have found a map, create a new post in the [support forum](https://wordpress.org/support/plugin/spotmap/). … … 140 152 141 153 ## 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 142 160 = 0.10.1 = 143 161 Full Gutenberg Block support … … 161 179 162 180 163 = 0.3 =164 - First working draft165 166 181 ## Upgrade Notice 167 182 … … 175 190 = 0.7 = 176 191 redoing the whole frontend part. Now it looks much better! 177 -
spotmap/tags/0.10.2/spotmap.php
r2479440 r2519924 4 4 * Plugin URI: https://github.com/techtimo/spotmap 5 5 * Description: Add an embedded map that shows the movement of a Spot device 6 * Version: 0.10. 16 * Version: 0.10.2 7 7 * Author: Timo Giese 8 8 * Author URI: https://github.com/techtimo -
spotmap/trunk/public/class-spotmap-public.php
r2479440 r2519924 173 173 } 174 174 public function show_spotmap($atts,$content = null){ 175 175 if(empty($atts)){ 176 $atts = []; 177 } 176 178 error_log("Shortcode init vals: ".wp_json_encode($atts)); 177 179 // $atts['feeds'] = $atts['devices']; … … 186 188 'tiny-types' => !empty(get_option('spotmap_default_values')['tiny-types']) ?get_option('spotmap_default_values')['tiny-types'] : NULL, 187 189 'auto-reload' => FALSE, 190 'last-point' => FALSE, 188 191 'date-range-from' => NULL, 189 192 'date' => NULL, … … 198 201 ], $atts ), 199 202 $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 } 206 221 } 207 222 … … 296 311 'mapOverlays' => $a['map-overlays'], 297 312 'autoReload' => $a['auto-reload'], 313 'lastPoint' => $a['last-point'], 298 314 'debug' => $a['debug'], 299 315 'mapId' => $map_id -
spotmap/trunk/public/js/block.js
r2479440 r2519924 25 25 props.setAttributes({ autoReload: false }); 26 26 props.setAttributes({ debug: false }); 27 props.setAttributes({ lastPoint: false }); 27 28 props.setAttributes({ height: '500' }); 28 29 props.setAttributes({ dateRange: {to:'',from:'', }}); … … 65 66 el(ToggleControl, 66 67 { 67 label: ' Debug',68 label: 'Show Last Point', 68 69 onChange: (value) => { 69 props.setAttributes({ debug: value });70 props.setAttributes({ lastPoint: value }); 70 71 }, 71 checked: props.attributes.debug, 72 checked: props.attributes.lastPoint, 73 help: "Show the latest point as a big marker.", 72 74 } 73 75 ) 74 76 ), 75 /* Toggle Field */76 77 el(PanelRow, {}, 77 78 el(ToggleControl, … … 82 83 }, 83 84 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, 85 97 } 86 98 ) … … 373 385 let options = []; 374 386 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, {}, 376 415 el(ColorPalette , { 377 416 label: "Colors", 378 417 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 ], 388 425 onChange: (value) => { 389 426 let returnArray = []; … … 396 433 }, 397 434 value: props.attributes.gpx[0]? props.attributes.gpx[0].color : 'gold', 398 disableCustomColors: true, 435 disableCustomColors: false, 436 clearable: false, 399 437 }) 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 ); 425 440 426 441 -
spotmap/trunk/public/js/maphandler.js
r2479440 r2519924 19 19 var self = this; 20 20 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); 22 23 var container = L.DomUtil.get(this.options.mapId); 23 24 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 } 36 32 this.debug("Lodash version: " + lodash.VERSION); 37 33 … … 197 193 else if (entry.type == "HELP-CANCEL") 198 194 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 } 199 205 200 206 message += 'Time: ' + entry.time + '</br>Date: ' + entry.date + '</br>'; … … 476 482 return 'gold'; 477 483 } 484 if (option == 'lastPoint') { 485 if (this.options.lastPoint) 486 return this.options.lastPoint; 487 return false; 488 } 489 478 490 if (option == 'splitLines' && config.feed) { 479 491 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 6 6 License URI: http://www.gnu.org/licenses/gpl-2.0.html 7 7 Requires at least: 5.3 8 Tested up to: 5. 68 Tested up to: 5.7 9 9 10 10 See your Spot device movements on an embedded map inside your Blog! 🗺 Add GPX tracks, routes and waypoints to see a planned route. … … 12 12 ## Description 13 13 14 Spot does not offer a history of sent positions for more than 7 days. That's where Spotmap comes into the game:14 Spot does not offer the storage of pointsdfree of charge for long. That's where Spotmap comes into the game: 15 15 Your Wordpress Site will store all positions ever sent. It checks for new positions every 2.5 minutes. 16 16 It supports different devices (They can even belong to different accounts). 17 It supports many more web 17 18 18 19 🆕 Support of Gutenberg block editor. Just type `/spotmap` and open the settings on the right. … … 44 45 Now 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. 45 46 46 In the mean time wecan create an empty map with the Shortcode:47 In the mean time you can create an empty map with the Shortcode: 47 48 `[spotmap]` 49 50 If you use the block editor Gutenberg, you can search for a block named 'Spotmap'. 48 51 49 52 🎉 Congrats! You just created your first Spotmap. 🎉 50 53 54 If 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 56 If you use the shortcode,check the Additional attributes section. 51 57 👉 If you need help to configure your map, post a question in the [support forum](https://wordpress.org/support/plugin/spotmap/). 👈 52 58 ### Additional attributes 59 60 If you add new maps, check the FAQ 53 61 54 62 To fine tune the map, there are some attributes we can pass with the shortcode: … … 78 86 - `date-range-to=2022-01-01 19:00` can be used to show all points until date and time X. 79 87 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` 81 91 82 92 - `tiny-types=UNLIMITED-TRACK,STOP` can be used to configure if a point is shown with a big marker on the map or not 83 93 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) 85 95 86 96 #### GPX … … 89 99 - `gpx-name="Track 1,Track 2"` give the tracks a nice name. (Spaces can be used) 90 100 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) 92 102 93 103 - `gpx-color="green,#347F33"` give your tracks some color. (It can be any color you can think of, or some hex values) … … 105 115 106 116 107 We can also show multiple feeds in different colors on a same day :117 We can also show multiple feeds in different colors on a same day (from 0:00:00 to 23:59:59): 108 118 109 119 `[spotmap mapcenter=last feeds="My first spot,My other Device" colors="gray,green" date="2020-06-01"]` … … 113 123 114 124 ### 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)125 You 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) 116 126 Unless you like to group devices under one name, it's good to create one feed per device, so you can manage the devices independently. 117 127 Your XML Feed id should look similar to this: `0Wl3diTJcqqvncI6NNsoqJV5ygrFtQfBB` … … 122 132 2. (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. 123 133 3. (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. 134 4. (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. 135 5. (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. 136 6. (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. 125 137 126 138 127 139 ### 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. 140 Have 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 129 141 If 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). 130 142 If you have found a map, create a new post in the [support forum](https://wordpress.org/support/plugin/spotmap/). … … 140 152 141 153 ## 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 142 160 = 0.10.1 = 143 161 Full Gutenberg Block support … … 161 179 162 180 163 = 0.3 =164 - First working draft165 166 181 ## Upgrade Notice 167 182 … … 175 190 = 0.7 = 176 191 redoing the whole frontend part. Now it looks much better! 177 -
spotmap/trunk/spotmap.php
r2479440 r2519924 4 4 * Plugin URI: https://github.com/techtimo/spotmap 5 5 * Description: Add an embedded map that shows the movement of a Spot device 6 * Version: 0.10. 16 * Version: 0.10.2 7 7 * Author: Timo Giese 8 8 * Author URI: https://github.com/techtimo
Note: See TracChangeset
for help on using the changeset viewer.