Discussion for the unofficial, community-developed addons, extensions and scripts built for the Waze Map Editor.

The official index of these tools is the Community Plugins, Extensions and Tools wiki page.
Post by davielde
voludu2 wrote:Source of problem:
Uncaught TypeError: Property 'onclick' of object #<HTMLParagraphElement> is not a function script.js:43

fix:
find
dummyElem.setAttribute('onclick', 'return window');
and replace with
dummyElem.onclick= function(){return window;};
Thanks! I'll incorporate that into the next version later. That bootstrap is the same as the current one for WMECH, but Colour Highlights is working for you with dummyElem.setAttribute('onclick', 'return window'); ?
davielde
Posts: 1219
Has thanked: 454 times
Been thanked: 735 times
Send a message
https://www.waze.com/wiki/images/6/69/W ... 00k_5c.png
CM: USA
SM: Michigan, Vermont
AM: Ann Arbor, MI & Thunder Bay, ON
WME Michigan

Post by davielde
voludu2 wrote:In the Color Highlighter, this is handled in a function, with a little care to make sure that Waze is a global.
Yes, I see where that was stripped out in v0.1. Thanks!
davielde
Posts: 1219
Has thanked: 454 times
Been thanked: 735 times
Send a message
https://www.waze.com/wiki/images/6/69/W ... 00k_5c.png
CM: USA
SM: Michigan, Vermont
AM: Ann Arbor, MI & Thunder Bay, ON
WME Michigan

Post by davielde
Version 0.4.1 has been deployed for use with Tampermonkey and Greasemonkey here:
https://greasyfork.org/scripts/5010-wme ... highlights

The conflict with WMECH has been resolved. FC Highlights now uses a new layer that you'll see in the WME Layer menu called "Functional Classification". It does not have its own street name labels at this time though, so it is necessary to leave the existing WME Roads layer on to view those. The storage issue with Firefox should be resolved now as well, so any changes to the different road type colors should save and reload.

I'm also toying with different event listeners without trying to resort to redrawing the segments automatically every X seconds. Probably the most noticeable area this will be seen is if you search and change map locations. If the highlights don't appear, just drag the map a bit or zoom in. This should change in a future version. Highlights should appear at the 500m zoom down to 2m as long as the layer is enabled.
davielde
Posts: 1219
Has thanked: 454 times
Been thanked: 735 times
Send a message
https://www.waze.com/wiki/images/6/69/W ... 00k_5c.png
CM: USA
SM: Michigan, Vermont
AM: Ann Arbor, MI & Thunder Bay, ON
WME Michigan

Post by davielde
SkiDooGuy wrote:Is there any way to make it remember or not turn on until I want it too?
Version 0.4.2 has been released to GreasyFork:
https://greasyfork.org/scripts/5010-wme ... highlights

It still defaults to enabled for first install, but it should remember your setting after that.
davielde
Posts: 1219
Has thanked: 454 times
Been thanked: 735 times
Send a message
https://www.waze.com/wiki/images/6/69/W ... 00k_5c.png
CM: USA
SM: Michigan, Vermont
AM: Ann Arbor, MI & Thunder Bay, ON
WME Michigan

Post by davielde
Version 0.4.4 corrects a minor issue where the Functional Classification layer overrode the default "Shift+F" ability to toggle full screen mode.

https://greasyfork.org/scripts/5010-wme ... highlights
davielde
Posts: 1219
Has thanked: 454 times
Been thanked: 735 times
Send a message
https://www.waze.com/wiki/images/6/69/W ... 00k_5c.png
CM: USA
SM: Michigan, Vermont
AM: Ann Arbor, MI & Thunder Bay, ON
WME Michigan

Post by davielde
Version 0.5 adds a checkbox that enables you to toggle between FC road type labels and the default Waze labels. Primary Street will display as "Collector", mH as "Minor Arterial", and MH as "Principal Arterial".

Tampermonkey and Greasemonkey:
https://greasyfork.org/scripts/5010-wme ... highlights





davielde
Posts: 1219
Has thanked: 454 times
Been thanked: 735 times
Send a message
https://www.waze.com/wiki/images/6/69/W ... 00k_5c.png
CM: USA
SM: Michigan, Vermont
AM: Ann Arbor, MI & Thunder Bay, ON
WME Michigan

Post by davielde
sketch wrote:Should maybe add State Hwy, US Hwy to mH and MH? It seems people often miss those parts of the rules.
Maybe "Minor Arterial (State Hwy min.)" and "Principal Arterial (US Hwy min.)", or what would you prefer? I could maybe try to populate the dropdown with two separate entries for the same road type ID, but then I'm not sure what kind of hell could break loose. It would be kind of cool though to have multiple custom road type labels that tie back to the same ID.

EDIT: scratch that, because if someone has a "State Hwy" dropdown, I wouldn't be able to differentiate whether it should actually be mH, MH, or freeway, etc. So, one label per road type. Just let me know the preferred labels.
davielde
Posts: 1219
Has thanked: 454 times
Been thanked: 735 times
Send a message
https://www.waze.com/wiki/images/6/69/W ... 00k_5c.png
CM: USA
SM: Michigan, Vermont
AM: Ann Arbor, MI & Thunder Bay, ON
WME Michigan

Post by davielde
It looks like the limit will be 25 characters.
davielde
Posts: 1219
Has thanked: 454 times
Been thanked: 735 times
Send a message
https://www.waze.com/wiki/images/6/69/W ... 00k_5c.png
CM: USA
SM: Michigan, Vermont
AM: Ann Arbor, MI & Thunder Bay, ON
WME Michigan

Post by davielde
The new WME version gives us more room for the road type labels, so I expanded the MH- and mH-equivalent labels. I've also added a wiki link to the Road Types USA quick reference chart.



Version 0.6 now available for Tampermonkey or Greasemonkey:
https://greasyfork.org/scripts/5010-wme ... highlights
davielde
Posts: 1219
Has thanked: 454 times
Been thanked: 735 times
Send a message
https://www.waze.com/wiki/images/6/69/W ... 00k_5c.png
CM: USA
SM: Michigan, Vermont
AM: Ann Arbor, MI & Thunder Bay, ON
WME Michigan

Post by davielde
doctorkb wrote:What about just "or" instead of "&" ?

(I think I've been reading too much code -- "&" to me says both must be met... ) :)
You mean "||", right? A new version is up on GreasyFork with "or".
https://greasyfork.org/scripts/5010-wme ... highlights

davielde
Posts: 1219
Has thanked: 454 times
Been thanked: 735 times
Send a message
https://www.waze.com/wiki/images/6/69/W ... 00k_5c.png
CM: USA
SM: Michigan, Vermont
AM: Ann Arbor, MI & Thunder Bay, ON
WME Michigan