WME CheckThoseStreets

Ferramenta auxiliar para o Waze Map Editor (WME) que destaca os segmentos com um ou mais anos desde a última atualização.

  1. // ==UserScript==
  2. // @name WME CheckThoseStreets
  3. // @name:en WME CheckThoseStreets
  4. // @description Ferramenta auxiliar para o Waze Map Editor (WME) que destaca os segmentos com um ou mais anos desde a última atualização.
  5. // @description:en It is an auxiliary tool for Waze Map Editor (WME) that highlights segments with one or more years since their last update.
  6. // @include https://www.waze.com/editor/*
  7. // @include https://www.waze.com/*/editor/*
  8. // @author RomuloBarrosPI (romuloobarros at g mail dot com)
  9. // @version 1.1
  10. // @grant none
  11. // @namespace
  12. // ==/UserScript==
  13.  
  14. (function ()
  15. {
  16. var hoje = new Date();
  17. function iniciar() {
  18. if (window.Waze.model.segments.objects.length <=0)
  19. {
  20. console.log('WME-CTS aguardando API...');
  21. window.setTimeout(iniciar, 500);
  22. return;
  23. }
  24. else
  25. {
  26. for (var objeto in Waze.model.segments.objects)
  27. {
  28. var segmento = Waze.model.segments.get(objeto);
  29. var atributos = segmento.attributes;
  30. var dias = (hoje.getTime() - atributos.updatedOn) / 86400000;
  31. var noh = segmento.geometry.id;
  32. var linha = capturar(noh);
  33. if (linha !== null && dias >= 365 && linha.getAttribute("stroke") != '#00ece3')
  34. {
  35. linha.setAttribute('stroke', 'lime');
  36. linha.setAttribute('stroke-width', '5');
  37. linha.setAttribute('stroke-opacity', '0.5');
  38. }
  39. }
  40. }
  41. }
  42. function capturar(noh) {
  43. return document.getElementById(noh);
  44. }
  45. window.setInterval(iniciar, 333);
  46. iniciar();
  47. }) ();