Skip to content

Commit

Permalink
prepare WPorg push
Browse files Browse the repository at this point in the history
  • Loading branch information
techtimo committed Nov 6, 2021
1 parent df13d14 commit e59a430
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 24 deletions.
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
[![WordPress Plugin: Version](https://img.shields.io/wordpress/plugin/v/spotmap?color=green&logo=wordpress) ![WordPress Plugin: Tested WP Version](https://img.shields.io/wordpress/plugin/tested/spotmap?color=green&logo=wordpress)](https://wordpress.org/plugins/spotmap/)

Spotmap is a Wordpress plugin that can show an embedded map with all the recent positions of a Spot beacon
([findmespot.com](http://findmespot.com)).
([findmespot.com](http://findmespot.com)). In addition it can display GPX tracks to show where you intend to go.

Currently the Plugin will show all positions since configuring the plugin. The following screenshot was taken after using the plugin for 3 months:


The following screenshot was taken after using the plugin for 3 months:

![screen1](https://user-images.githubusercontent.com/22075114/83943321-64eb6600-a7fb-11ea-94a6-a8a0a5823407.png)

Expand All @@ -27,13 +29,15 @@ After installing the plugin, head over to your Dashboard `Settings > Spotmap`.

Now you can enter your XML Feed Id here and give it a nice name. Soon Wordpress will download the points that are present in the XML Feed.

In the mean time we can create an empty map with the Shortcode: `[Spotmap]`
If you use Gutenberg type /spotmap to create a new Spotmap block.

If you prefer shortcodes tpye `[Spotmap]`

Congrats 🎉 You just created your own Spotmap.

There are some attributes we can parse with the Shortcode:

Note: `devices` must always match your feed name.
Note: `feeds` must always match your configured feed name.

This will show a bigger map and the points are all in yellow:
```
Expand Down
4 changes: 2 additions & 2 deletions admin/class-spotmap-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public function register_settings(){
'timezonedb'=> [
"label" => "timezonedb.com",
"type" => 'text',
"description" => __("Store and show the local time of a position. <a href=\"https://timezonedb.com/register\">Register for free</a>"),
"description" => __("Do you travel to other timezones? Store and show the local time of a position with a timezonedb API token. <a href=\"https://timezonedb.com/register\">Register for free</a>"),
],
'mapbox'=> [
"label" => "mapbox.com",
Expand Down Expand Up @@ -330,7 +330,7 @@ function settings_section_marker($args){
</p>';
}
function settings_section_thirdparty($args){
echo '<p id='.$args['id'].'>'.__("Here you have links to a veriaty of different services. Each one of them is free for personal use. Follow the stated link, create an account and copy the API Key in the corresponding field.").'<br>
echo '<p id='.$args['id'].'>'.__("Here you have links to a variety of different services. Each one of them is free for personal use. Follow the stated link, create an account and copy the API Key in the corresponding field.").'<br>
</p>';
}

Expand Down
2 changes: 1 addition & 1 deletion includes/class-spotmap-api-crawler.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function get_data( $feed_name, $id, $pwd = ""){
}

private function get_data_findmespot ($feed_name, $id, $pwd){
// error_log($feed_name. $id.$pwd);
// error_log($feed_name. $id . $pwd);
$i = 0;
while (true) {
$feed_url = 'https://api.findmespot.com/spot-main-web/consumer/rest-api/2.0/public/feed/'.$id.'/message.json?start='.$i;
Expand Down
5 changes: 3 additions & 2 deletions public/class-spotmap-public.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ public function enqueue_scripts(){
wp_enqueue_script('leaflet-fullscreen',plugin_dir_url( __FILE__ ) . 'leafletfullscreen/leaflet.fullscreen.js');
wp_enqueue_script('leaflet-gpx',plugin_dir_url( __FILE__ ) . 'leaflet-gpx/gpx.js');
wp_enqueue_script('leaflet-easybutton',plugin_dir_url( __FILE__ ) . 'leaflet-easy-button/easy-button.js');
wp_enqueue_script('leaflet-swisstopo', 'https://unpkg.com/leaflet-tilelayer-swiss@2.2.1/dist/Leaflet.TileLayer.Swiss.umd.js');
wp_enqueue_script('leaflet-swisstopo',plugin_dir_url( __FILE__ ) . 'leaflet-tilelayer-swisstopo/Leaflet.TileLayer.Swiss.umd.js');
wp_enqueue_script('leaflet-beautify-marker', plugin_dir_url( __FILE__ ) . 'leaflet-beautify-marker/leaflet-beautify-marker-icon.js');
wp_enqueue_script('leaflet-text-path', 'https://makinacorpus.github.io/Leaflet.TextPath/leaflet.textpath.js');
// wp_enqueue_script('leaflet-text-path', 'https://makinacorpus.github.io/Leaflet.TextPath/leaflet.textpath.js');
wp_enqueue_script('leaflet-text-path',plugin_dir_url( __FILE__ ) . 'leaflet-textpath/leaflet.textpath.js');

}

Expand Down
1 change: 1 addition & 0 deletions public/js/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@
value: props.attributes.mapcenter,
options: [
{ label: 'all points', value: 'all' },
{ label: 'last trip', value: 'last-trip' },
{ label: 'latest point', value: 'last' },
{ label: 'GPX tracks', value: 'gpx' }
],
Expand Down
8 changes: 4 additions & 4 deletions public/js/maphandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,6 @@ class Spotmap {
var self = this;
jQuery.post(spotmapjsobj.ajaxUrl, options.body, function (response) {
let feeds = true;
console.log(self.options.feeds);
if(self.options.feeds && self.options.feeds.length == 0){
feeds = false
}
Expand All @@ -279,10 +278,10 @@ class Spotmap {
response.message = response.message || "";
if (self.options.gpx.length == 0) {
var popup = L.popup()
.setLatLng([51.5, -0.09])
.setLatLng([51.5, 0])
.setContent("<b>" + response.title + "</b><br>" + response.message)
.openOn(self.map);
self.map.setView([51.505, -0.09], 13);
self.map.setView([51.5, 0], 13);
}
}
else if(feeds && options.filter && !response.empty){
Expand Down Expand Up @@ -568,7 +567,8 @@ class Spotmap {
iconOptions.iconSize= [8,8];
iconOptions.borderWith = 8;
}
if(point.type){
// Is the point.type configured?
if(spotmapjsobj.marker[point.type]){
iconOptions.iconShape = spotmapjsobj.marker[point.type].iconShape;
iconOptions.icon = spotmapjsobj.marker[point.type].icon;
if(iconOptions.iconShape == 'circle-dot'){
Expand Down
Binary file added public/leaflet-textpath/leaflet.textpath.js
Binary file not shown.
Binary file not shown.
3 changes: 1 addition & 2 deletions public/leaflet/leaflet.js

Large diffs are not rendered by default.

24 changes: 16 additions & 8 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,30 @@ Tags: findmespot, find me spot, saved by spot, spot gps, spot tracker, spotbeaco
License: GPL2
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Requires at least: 5.3
Tested up to: 5.7
Tested up to: 5.8

See your Spot device movements on an embedded map inside your Blog! 🗺 Add GPX tracks, routes and waypoints to see a planned route.

## Description

Spot does not offer the storage of pointsdfree of charge for long. That's where Spotmap comes into the game:
Spot does not offer the storage of points free of charge for long term. That's where Spotmap comes into the game:
Your Wordpress Site will store all positions ever sent. It checks for new positions every 2.5 minutes.
It supports different devices (They can even belong to different accounts).
It supports many more web

The map can fetch new points autmatically without relaoding the entire Post.



🆕 Support of Gutenberg block editor. Just type `/spotmap` and open the settings on the right.

Currently only the GPX colors cannot be cahnged individually inside the block settings.

With a shortcode you can add an embedded map to your post or page. By default it will show all positions ever sent.
If needed the map can show a subset of the data. i.e. the last weekend getaway.

Next planned features (Not necessarily in right order):

- grouping of points
- grouping of points (partially implemented)

- support of other tracking devices (Garmin InReach, ...)

Expand Down Expand Up @@ -149,6 +154,13 @@ Head over to the wordpress.org [support forum](https://wordpress.org/support/plu
2. You can click on every sent positions to get more information. Points sent from a 'normal' Tracking will appear as small dots.

## Changelog
= 0.11.2 =
- new marker styles and options how to configure them. Changeable icons
- maps with many points will load faster
- tested with WP 5.8
- Thirdparty API options page includes many comments to better understand what each service is for.
- new initial map state added: 'last-trip'. Zooms to the last line on the map (In the feed settings splitlines must be activated to work)

= 0.10.3 =
- added UK Ordnance Survey
- added US Geological Survey maps
Expand All @@ -164,10 +176,6 @@ Full Gutenberg Block support
added NZtopomap
added France IGN Topo map token

= 0.9.1 =
Fix Gutenberg editor issue
spotmessages supports auto update

= 0.9 =
- new shortcode to show table of messages
- add gpx overlays
Expand Down
2 changes: 1 addition & 1 deletion spotmap.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Spotmap
* Plugin URI: https://github.com/techtimo/spotmap
* Description: See Spot GPS tracker positions inside your blog. Show GPX track(s) to let viewers know where you intend to go.
* Version: 0.11.1
* Version: 0.11.2
* Author: Timo Giese
* Author URI: https://github.com/techtimo
* License: GPL2
Expand Down

0 comments on commit e59a430

Please sign in to comment.