WME Change Segment Display

Change display of edited segments

  1. /* global W */
  2. // ==UserScript==
  3. // @name WME Change Segment Display
  4. // @namespace https://gf.qytechs.cn/en/users/19426-bmtg
  5. // @version 0.21
  6. // @description Change display of edited segments
  7. // @author bmtg
  8. // @match http://*/*
  9. // @include https://editor-beta.waze.com/*editor/*
  10. // @include https://www.waze.com/*editor/*
  11. // @exclude https://www.waze.com/*user/editor/*
  12. // @grant none
  13. // ==/UserScript==
  14. /* jshint -W097 */
  15.  
  16. (function () {
  17. 'use strict';
  18. function CSD_bootstrap() {
  19. if ( "undefined" !== typeof W.loginManager && "undefined" !== typeof W.map) {
  20. setTimeout(monitorSegments,500); // Run the code to check for data return from the Sheets
  21. } else {
  22. console.log("Waiting for WME map and login...");
  23. setTimeout(function () { CSD_bootstrap(); }, 300);
  24. }
  25. }
  26. function monitorSegments() {
  27. for (var segObj in W.model.segments.objects) {
  28. var segment = W.model.segments.get(segObj);
  29. var line = document.getElementById(segment.geometry.id);
  30.  
  31. if (line === null) {
  32. continue;
  33. }
  34.  
  35. if ( line.getAttribute('stroke') === '#ff8383' ) {
  36. line.setAttribute('stroke','#ffFFFF');
  37. line.setAttribute('stroke-linecap','0');
  38. line.setAttribute('stroke-width','15');
  39. line.setAttribute('stroke-dasharray','9 2');
  40. } else if ( line.getAttribute('stroke') === '#eb7171') {
  41. line.setAttribute('stroke','#FFFFFF');
  42. //line.setAttribute('stroke-linecap','0');
  43. line.setAttribute('stroke-width','14');
  44. //line.setAttribute('stroke-dasharray','9 4');
  45. }
  46. }
  47. //console.log("CSD refreshing");
  48. setTimeout(monitorSegments,700);
  49. }
  50. CSD_bootstrap();
  51. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址