[Script] FC Highlights

Uncaught ReferenceError: Waze is not defined

To fix this, find

And add before that

In the Color Highlighter, this is handled in a function, with a little care to make sure that Waze is a global.

And, yes

I don’t know why it works in one script and not in the other. Something else must be different between them, but I don’t know what it is.

Yes, I see where that was stripped out in v0.1. Thanks!

Actually, I thought about this and realized I was going about it all wrong.

I took another approach that made your script work perfectly.

  • I started with the bootstrap.user.js file that the original used, and modified it to call your FC Highlights file.
  • I also used the manifest.json file to specify the resources used (it won’t load them if they aren’t in the manifest). I removed any lines I could not understand from that file, including the key.

This seems to work perfectly. None of those silly errors with Waze or W not being defined.

I attached a zip of the directory
(unavailable attachment: MyExtension12345.zip)

Version 0.4.1 has been deployed for use with Tampermonkey and Greasemonkey here:
https://greasyfork.org/scripts/5010-wme-fc-color-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.

Awesome work on the script.

One thing I noticed is it doesn’t seem to remember when I have turned it off. Every time I open a new window or do a full refresh it reactivates the layer.

Is there any way to make it remember or not turn on until I want it too?

Not a huge deal, just a suggestion.

Thanks

Version 0.4.2 has been released to GreasyFork:
https://greasyfork.org/scripts/5010-wme-fc-color-highlights

It still defaults to enabled for first install, but it should remember your setting after that.

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-fc-color-highlights

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-fc-color-highlights



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.

The only ways to say it I can think of are probably too long for the box… like “Major Arterial (& US Hwy if not higher)” and “Minor Arterial (& State Hwy if not higher)”. Kind of a mess. But then maybe it’s too much to try to fit the gist of the rule into the box.

“Major Art (& US- if not higher)”
“Minor Art (& SR- if not higher)”

Though that doesn’t account for state-specific standards. Bah, I dunno.

It looks like the limit will be 25 characters.

Could be as simple as
Major Arterial (& US)
Minor Arterial (& SR)

And maybe we could put a small link to the Road types/USA page right above, when the script is active.

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-fc-color-highlights

Good work, davielde!

FWIW, at first glance this: “Minor Arterial (& SR-# minimum)” could read “minor arterial, but it must be at a state road at a minimum”

I know that’s not the intent, just wanted to share what it meant to me at first glance.

I tried so many ways to think of a way to condense the rule into 25 characters or less, but I don’t think it’s possible.

What about just “or” instead of “&” ?

(I think I’ve been reading too much code – “&” to me says both must be met… ) :slight_smile:

You mean “||”, right? A new version is up on GreasyFork with “or”.
https://greasyfork.org/scripts/5010-wme-fc-color-highlights

I am finding this quite useful. Thanks!

Would it be possible to include a checkbox or button to temporarily turn it off while investigating something else nearby? Sometimes FC hightlighter, Color Highlighter, and toolbox all want to highlight the same segment(s), and it is useful to see just one at a time, without refreshing the whole browser.

Thanks again for a useful extension.

There is a “Functional Classification” option in the layer switcher (no keyboard shortcut though). Will toggling that work for you?