您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Generates Strava Global Heatmap TMS server link for OpenStreetMap JOSM editor
当前为
// ==UserScript== // @name Strava Global Heatmap TMS server link generator for JOSM // @namespace http://tampermonkey.net/ // @version 0.1 // @description Generates Strava Global Heatmap TMS server link for OpenStreetMap JOSM editor // @author UrSuS // @match https://www.strava.com/heatmap // @icon https://www.google.com/s2/favicons?domain=strava.com // @grant GM_cookie // ==/UserScript== (function() { 'use strict'; //close Info popup document.getElementsByClassName("btn close btn-icon btn-icon-only")[1].click(); //Go to Login menu if not Logged in already var logInButton = document.getElementsByClassName("btn btn-default btn-login")[0]; if (logInButton.parentElement.tagName === "DIV") { logInButton.click(); } else { const urlToFetch = 'https://www.strava.com/heatmap'; var cookieString = ""; GM_cookie.list({ url: urlToFetch }, function(cookies, error) { if (!error) console.log(cookies); for (var i = 0; i < cookies.length; i++) { if (cookies[i].name === "CloudFront-Policy" || cookies[i].name === "CloudFront-Key-Pair-Id" || cookies[i].name === "CloudFront-Signature") { cookieString = cookieString + cookies[i].name + "=" + cookies[i].value + ";"; } } }); window.addEventListener('load', () => { addButton(getTMSlink) }); function addButton(onclick, cssObj) { var button = document.createElement("Button"); button.setAttribute("type", "button"); let parentDiv = document.getElementsByClassName("mapboxgl-ctrl mapboxgl-ctrl-group"); parentDiv[0].appendChild(button); button.innerHTML = "<span style='background-image: url(https://josm.openstreetmap.de/logo.png); background-repeat: no-repeat; background-size: 29px 29px;' class='mapboxgl-ctrl-icon' aria-hidden='true'></span>"; button.onclick = onclick; return button; }; function getTMSlink() { //Valid values for heatmap color: hot, blue, purple, gray, bluered. //Valid values for type of data: all, ride, run, water, winter. //example url https://www.strava.com/heatmap#7.00/-120.90000/38.36000/purple/ride var currentUrl = window.location.href; var settings = currentUrl.split("/"); var urlText = "tms[3,15]:https://heatmap-external-c.strava.com/tiles-auth/" + settings[7] + "/" + settings[6] + "/{zoom}/{x}/{y}.png{header(cookie," + cookieString + ")}"; navigator.clipboard.writeText(urlText).then(function() { alert("TMS URL copied to clipboard!"); }, function(err) { console.error('Error ', err); }); }; } })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址