commit 5f314725eb9159348b1ccc5f361c4b4c6d5c23fd
parent 4ad719eee424c38523fb4569b78452f9ab470cdf
Author: Sergej Orlov <wladimirych@gmail.com>
Date: Wed, 8 May 2024 11:50:00 +0200
tracks: remove loading of tracks from gpslib.net
Related to #658
Diffstat:
7 files changed, 1 insertion(+), 87 deletions(-)
diff --git a/src/lib/leaflet.control.track-list/lib/services/gpslib.js b/src/lib/leaflet.control.track-list/lib/services/gpslib.js
@@ -1,28 +0,0 @@
-import urlViaCorsProxy from '~/lib/CORSProxy';
-import BaseService from './baseService';
-import parseGpx from '../parsers/gpx';
-
-class Gpslib extends BaseService {
- urlRe = /^https?:\/\/(?:.+\.)?gpslib\.[^.]+\/tracks\/info\/(\d+)/u;
-
- isOurUrl() {
- return this.urlRe.test(this.origUrl);
- }
-
- requestOptions() {
- const m = this.urlRe.exec(this.origUrl);
- const trackId = this.trackId = m[1];
- return [{
- url: urlViaCorsProxy(`https://www.gpslib.ru/tracks/download/${trackId}.gpx`),
- options: {responseType: 'binarystring'}
- }];
- }
-
- parseResponse(responses) {
- const response = responses[0];
- return parseGpx(response.responseBinaryText, `GPSLib ${this.trackId}`, true) ||
- [{name: name, error: 'UNSUPPORTED'}];
- }
-}
-
-export default Gpslib;
diff --git a/src/lib/leaflet.control.track-list/lib/services/index.js b/src/lib/leaflet.control.track-list/lib/services/index.js
@@ -1,6 +1,5 @@
import SimpleService from './simpleService';
import Etomesto from './etomesto';
-import Gpslib from './gpslib';
import Osm from './osm';
import Strava from './strava';
import Tracedetrail from './tracedetrail';
@@ -16,7 +15,6 @@ const services = [
NakarteTrack,
NakarteUrl,
Etomesto,
- Gpslib,
Osm,
Strava,
Tracedetrail,
diff --git a/src/lib/leaflet.control.track-list/track-list.js b/src/lib/leaflet.control.track-list/track-list.js
@@ -147,7 +147,7 @@ L.Control.TrackList = L.Control.extend({
<div class="leaflet-control-content">
<div class="header">
<div class="hint"
- title="gpx kml Ozi geojson zip YandexMaps Strava GPSLib Etomesto GarminConnect SportsTracker OSM Tracedetrail OpenStreetMap.ru Wikiloc">
+ title="gpx kml Ozi geojson zip YandexMaps Strava Etomesto GarminConnect SportsTracker OSM Tracedetrail OpenStreetMap.ru Wikiloc">
gpx kml Ozi geojson zip YandexMaps Strava
<span class="formats-hint-more">…</span>
</div>
diff --git a/test/test_track_load.js b/test/test_track_load.js
@@ -48,9 +48,6 @@ suite('Load tracks from services');
'garmin_connect_route_with_title',
'garmin_connect_route_private',
'garmin_connect_route_not_exists',
- 'gpslib_with_title',
- 'gpslib_without_title',
- 'gpslib_not_exists',
'osm_with_title',
'osm_without_title',
'osm_private',
diff --git a/test/track_load_data/testcases/gpslib_not_exists.json b/test/track_load_data/testcases/gpslib_not_exists.json
@@ -1,4 +0,0 @@
-{
- "query": ["https://www.gpslib.net/tracks/info/301991.html"],
- "geodata": [{"name": "https://www.gpslib.net/tracks/info/301991.html", "error": "NETWORK"}]
-}
diff --git a/test/track_load_data/testcases/gpslib_with_title.json b/test/track_load_data/testcases/gpslib_with_title.json
@@ -1,32 +0,0 @@
-{
- "query": [
- "https://www.gpslib.net/tracks/info/30199.html",
- "http://www.gpslib.net/tracks/info/30199.html",
- "https://gpslib.net/tracks/info/30199.html",
- "https://www.gpslib.net/tracks/info/30199.html?a=1",
-
- "https://www.gpslib.net/tracks/info/30199",
- "https://www.gpslib.ru/tracks/info/30199.html",
- "https://fi.gpslib.net/tracks/info/30199.html"
- ],
- "geodata": [
- {
- "name": "лагерь харабали",
- "tracks": [
- [
- {"lat": 47.367863, "lng": 47.212959},
- {"lat": 47.367859, "lng": 47.212955},
- {"lat": 47.367855, "lng": 47.212952},
- {"lat": 47.367855, "lng": 47.212948},
- {"lat": 47.367851, "lng": 47.212944},
- {"lat": 47.367847, "lng": 47.21294},
- {"lat": 47.367847, "lng": 47.212936},
- {"lat": 47.367847, "lng": 47.212933},
- {"lat": 47.367844, "lng": 47.212933},
- {"lat": 47.367844, "lng": 47.212929}
- ]
- ],
- "points": []
- }
- ]
-}
diff --git a/test/track_load_data/testcases/gpslib_without_title.json b/test/track_load_data/testcases/gpslib_without_title.json
@@ -1,17 +0,0 @@
-{
- "query": ["https://www.gpslib.net/tracks/info/66114.html"],
- "geodata": [
- {
- "name": "GPSLib 66114",
- "tracks": [
- [
- {"lat": 60.0200792, "lng": 30.2662249},
- {"lat": 60.0200857, "lng": 30.2662141},
- {"lat": 60.0200857, "lng": 30.2662141},
- {"lat": 60.0200737, "lng": 30.2662621}
- ]
- ],
- "points": []
- }
- ]
-}