OpenSwitchMaps icon indicating copy to clipboard operation
OpenSwitchMaps copied to clipboard

Add support for https://gpx.studio/app

Open Nekzuris opened this issue 6 months ago • 1 comments

https://gpx.studio/app now has lat/lon in url

Nekzuris avatar Jun 03 '25 15:06 Nekzuris

I tried to add it:

{
			name: "gpx.studio",
			category: MAIN_CATEGORY,
			default_check: true,
			domain: "gpx.studio",
			is_gcj_in_china: true,
			getUrl(lat, lon, zoom, extra) {
				// https://learn.microsoft.com/en-us/bingmaps/articles/create-a-custom-map-url#collections-categories
				let pin = "";
				if (extra && extra.pin_lat) {
					pin = `&sp=point.${extra.pin_lat}_${extra.pin_lon}`; // + `${name}_${note}`;
				}
				const str = "https://gpx.studio/app#" + zoom + "/" + lat + "/" + lon;
				console.log(str)
				return str
			},
	
			getLatLonZoom(url) {
				// https://gpx.studio/app#11.86/55.87114/-4.29891
				const match = url.match(/gpx\.studio\/app#([-0-9.]*)\/([-0-9.]*)\/([-0-9.]*)/);

				if (match) {
					const [, zoom, lat, lon] = match;
					console.log("get")
					console.log(zoom)
					console.log(lat)
					console.log(lon)
					return [lat, lon, zoom];
				}
			},
		},

However gpx.studio doesn't seem to care about what the lat/lon/zoom is in the url, it will just default to where ever you were last looking

ghost avatar Jun 14 '25 14:06 ghost