[Script] FC Highlights

With regards to the flashing: do you have WME Colors & Highlights or the Highlight Places script installed and enabled? At the moment, they collide and are likely to produce that symptom.

If you don’t, I’d love to do what I can… first off, I’d suggest trying WMECH (alone) to see if it does the same thing.

The bottom two lines here are commented out. If you uncomment them, the WME light blue highlight for the selected segment should appear:

// check that WME hasn't highlighted this segment var opacity = line.getAttribute("stroke-opacity"); var lineWidth = line.getAttribute("stroke-width"); //if (opacity == 1 || lineWidth == 9) // continue;

// check that WME hasn't highlighted this segment var opacity = line.getAttribute("stroke-opacity"); var lineWidth = line.getAttribute("stroke-width"); if (opacity == 1 || lineWidth == 9) continue;

I’m also noticing that it’s not saving to localStorage, at least on Chrome.

I have WME color highlights. Will test with with it disabled. Thanks again.
EDIT: That stops the blinking.

After getting the okay from doctorkb, I made a few bug fixes and other changes.
The script still uses WMECH as a foundation, so in order to use FC Highlights, you’ll need to disable WMECH. In v0.1, the flashing was caused by WMECH code changing the segment line color if it didn’t match what was expected, and the same code in FC Highlights fought back… In v0.2, I commented out that part of the code, conceding victory to WMECH. If you enable both scripts, you will only see the FC colors flash once when you check the “Highlight FC Road Types” box. I don’t really see a good way around that unless we eventually add FC to a new map layer as Timbones suggested or combine FC with WMECH.

Download v0.2

Version 0.2 Notes

  1. Corrected issue with ramp highlighting
  2. Corrected issue where selected segments would not display the standard WME light blue line
  3. Added textboxes for the different FC road types for user custom input
  4. Corrected issue with saving to localStorage and added FC road type textbox values (Chrome only)

While considering the change to add selections for each state, unless someone wants to hire a Waze intern to track down the colors for each state and keep them updated over time, it might be a better use of dev time to just let each user add their custom colors. We could eventually over time post the state colors here or in the wiki, but the user would control what colors display rather than the developers.

Colors don’t need to be the hex color values (i.e. #ffffff)–you could just type “White” or any other common color. Please provide some feedback on this change since it was not part of the requested direction to add the states as a dropdown selection.

FWIW, it would be trivial to have other road types highlighted along with these five types… not sure if that’s desirable or not.

You get a +1 for everything you said, but since you brought it up I did want to add that in area Canada is larger than the USA by 1.6%, but the USA has 620% of the roads in Canada. :mrgreen:
(Just keeping you honest my Canadian brother. :wink: )

Thanks, Kent. Yes, we have fewer roads… but with WME zoom levels what they are, it can still be just as intense to maintain them! :slight_smile:

Oh, and we’re up to two active GC’s now (since we’re working on full disclosure)! Thanks hmarian!! :slight_smile:

As for landmass – all you have to know is that we’re bigger, and we’re on top. :slight_smile:

In the words of the Arrogant Worms:
“we’re bigger than Malaysia, almost as big as Asia,
we’re bigger than Australia, and it’s a continent…”

Uh… no?

In light of the recent “external sources” issue and the consequent conversation in the Toolbox thread, this request is beyond asinine.

To be fair, that request was made well before the external source concerns came to the forefront in the Toolbox thread.

Apart from the recent turmoil surrounding the use of external sources in WME, I don’t think it would be reasonable or fair to do this for just one state. Once you start looking at individual states, however, it becomes a much larger effort due to lack of consistency in the technology used by each state. It looks like CalTrans serves up their road layer using a KML file in any case. AFAIK, that file needs to reside on the same web server as the host site, and it’s just a hunch, but I’m guessing that Waze wouldn’t host it… Michigan serves up FC as a single ARCGIS layer. Louisiana has each road type as a different ARCGIS layer. And so on for each state… Too specialized to do for “fun” even if it were condoned by Waze.

Yes, it’s true. I didn’t note the date – just that I had multiple notifications for this thread and I thought they’d come in at the same time.

Apologies, AdrenalinGuy, for being a little harsh.

And we could slip our northern border 50 miles while everyone is watching the hockey game and encompass 90% of the population :lol:

And as long as you took Quebec, many of us would thank you for it! :slight_smile:

:lol:

Bien sûr!

PA colours, ref https://www.waze.com/forum/viewtopic.php?t=96733&f=215#p822768:
interstate: #00ffff
other fw/exp: #af0000
other princ: #ff0000
minor art: #00ff00
urban/rural major: #b924ff
rural minor: #f5f500
local: #ff7d00

Thank you doctorkb.

I just installed this in Chrome, started a new Chrome window – and don’t see any sort of Highlights tab.
What have I done wrong?

I did try installing Timbones’ color highlighter. That seems to work just fine. Then I disabled it and re-enabled the FC highlighter – nothing.

It seems like a very good idea, and I’d like to help with the testing.

I cannot replicate even with the 64-bit version of Chrome or by enabling a number of scripts that all use that section. The script tabs eventually create a second and third row, and I always have “FC Highlight” visible. Any more info about your setup that could help track it down?

Source of problem:
Uncaught TypeError: Property ‘onclick’ of object #<HTMLParagraphElement> is not a function script.js:43

fix:
find

and replace with

Dell 32-bit
Windows 7 Home
Chrome Version 33.0.1750.146

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’); ?