WME Disable Closed Updates

Disable the Closed Updates Layer when loading WME

  1. // ==UserScript==
  2. // @name WME Disable Closed Updates
  3. // @namespace https://greasyfork.org/en/users/668704-phuz
  4. // @require https://greasyfork.org/scripts/24851-wazewrap/code/WazeWrap.js
  5. // @version 1.00
  6. // @description Disable the Closed Updates Layer when loading WME
  7. // @author phuz
  8. // @include /^https:\/\/(www|beta)\.waze\.com\/(?!user\/)(.{2,6}\/)?editor\/?.*$/
  9. /* global OpenLayers */
  10. /* global W */
  11. /* global WazeWrap */
  12. /* global $ */
  13. /* global I18n */
  14. /* global _ */
  15. // ==/UserScript==
  16.  
  17. //Begin script function
  18. (function () {
  19. //Bootstrap
  20. function bootstrap(tries = 1) {
  21. if (W && W.loginManager && W.map && W.loginManager.user && W.model
  22. && W.model.states && W.model.states.getObjectArray().length && WazeWrap && WazeWrap.Ready) {
  23. init();
  24. } else if (tries < 1000) {
  25. setTimeout(function () { bootstrap(++tries); }, 200);
  26. }
  27. }
  28. //Initializations...
  29. function init() {
  30. setTimeout(function() {
  31. W.layerSwitcherController.checkboxState.set("ITEM_CLOSED_UPDATE_REQUESTS",false)
  32. },500);
  33. }
  34. bootstrap();
  35. })();