[Script] Street Vector Layer

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.

Moderators: Unholy, bextein, Glodenox, JustinS83

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

DO NOT START a new thread unless it is about a new idea. Keep discussion of existing tools within the main thread for that tool.

The official index of these tools is the Community Plugins, Extensions and Tools wiki page.

Re: [Script][Beta] Street Vector Layer

Postby Gluek » Mon Jul 13, 2015 1:18 pm

Wow, very nice script, thanks from Russian editors community :)
Группа Waze Russia в Slack | Группа @WazeRussia в Telegram и канал новостей @WazeNews

INTL server updates Telegram bot: @WazeUpdatesBot
Gluek
 
Posts: 486
Joined: Sat Jan 09, 2010 12:40 pm
Location: Moscow, Russia
Has thanked: 128 times
Been thanked: 117 times

Re: [Script][Beta] Street Vector Layer

Postby herrchin » Fri Dec 11, 2015 3:27 am

bedo2991, thank you so much, Vector is awesome!

I have two bugfixes, and I also made some customizations that USA editors may like, as it is geared towards common USA speeds, and also tweaks the label visibility a bit.

Line 254, I replace the getColorSpeed() function with one that uses a tweaked color scale so roads that speed up / slow down only 10 mph have more visual distinction between the colors used:
Code: Select all
function getColorSpeed(speed)
{
    if(W.prefs.attributes.isImperial) // adjust scale for Imperial
    {       
        // speeds 15 to 75 mph (7 increments) are tuned to HSL 95 to 395 (35) for easy visual speed differentiation at common speeds
        return ((speed / 1.609344 * 5) + 20) %360
    }
    else
    {
        return (speed * 3) %360; // :150 * 450
    }
}


Lines 377-379 (now lines 385-387 if you replaced the above function; I will put future line # changes in () as well, for those adopting all changes), there's a typo in "isImperial". The calls to getColorSpeed() for mph also won't have the right colors returned (in both the original and updated function), as it expects to be passed kph. Replace lines 377-379 (385-387) with these 5 to pass kph values in all cases, and to adjust the scale when using mph:
Code: Select all
    for(var k=W.prefs.attributes.isImperial?9:15; k>1; k--){
        if (W.prefs.attributes.isImperial)
        { $speedLimits.append($('<span style="color:hsl('+getColorSpeed((k*10-5)*1.609344)+',100%,50%)">'+(k*10-5)+' </span>')); }
        else { $speedLimits.append($('<span style="color:hsl('+getColorSpeed(k*10)+',100%,50%)">'+k*10+' </span>')); }
    }


Line 666 (676): I make the fonts bigger for my old man eyes :)
Code: Select all
labelFontSize = farZoom?"14px":"16px";


Line 1232 (1242): Insert a new line after "if(speed)" to add in a visual separator between the street name and the speed limits (as you'll see with the remaining changes, I make the speed limits larger in size)
Code: Select all
speedPart += ": ";


Lines 1234, 1239, and 1247 (now 1245, 1250, and 1258):
Change all "=" to be "+="

Starting at Line 1308 (1319).
Comment out all "number.replace" lines by placing // at the front of each line. Be sure to leave the "number.toString" line alone

Results showing 25 through 65mph colors:
[ img ]
USA Country Manager / UT SM
[ img ][ img ][ img ][ img ]
herrchin
Country Manager
Country Manager
 
Posts: 333
Joined: Mon Jun 22, 2015 6:05 pm
Location: Lincoln, NE, USA
Has thanked: 303 times
Been thanked: 220 times

Re: [Script][Beta] Street Vector Layer

Postby herrchin » Sun Dec 13, 2015 5:37 am

Timbones wrote:Will this work for us in the UK as well?
We use imperial units too, and would benefit from a larger separation of colours for limits that are only 10 mph different. However, common speed limits here are all multiples of 10, i.e. 20, 30, 40, 50, etc.

Yes, my modifications should work without any further changes. If you'd like to adjust the reference scale to be on the "10s" instead of the "5s", in this section:

Code: Select all
    for(var k=W.prefs.attributes.isImperial?9:15; k>1; k--){
        if (W.prefs.attributes.isImperial)
        { $speedLimits.append($('<span style="color:hsl('+getColorSpeed((k*10-5)*1.609344)+',100%,50%)">'+(k*10-5)+' </span>')); }
        else { $speedLimits.append($('<span style="color:hsl('+getColorSpeed(k*10)+',100%,50%)">'+k*10+' </span>')); }
    }

change the longest line to be instead the following (drop both "minus 5" bits):
Code: Select all
        { $speedLimits.append($('<span style="color:hsl('+getColorSpeed((k*10)*1.609344)+',100%,50%)">'+(k*10)+' </span>')); }
USA Country Manager / UT SM
[ img ][ img ][ img ][ img ]
herrchin
Country Manager
Country Manager
 
Posts: 333
Joined: Mon Jun 22, 2015 6:05 pm
Location: Lincoln, NE, USA
Has thanked: 303 times
Been thanked: 220 times

Re: [Script][Beta] Street Vector Layer

Postby herrchin » Thu Dec 17, 2015 8:16 pm

bedo2991 wrote:Quickly created one here: https://github.com/bedo2991/svl

Awesome! I've merged in my color changes for imperial units since that's just a universal fix. I'll see about re-implementing some of the other changes I proposed as user options, since they're a significant deviation from your existing representation of speed limit text (unless you'd rather they be the new default format...)
USA Country Manager / UT SM
[ img ][ img ][ img ][ img ]
herrchin
Country Manager
Country Manager
 
Posts: 333
Joined: Mon Jun 22, 2015 6:05 pm
Location: Lincoln, NE, USA
Has thanked: 303 times
Been thanked: 220 times

Re: [Script][Beta] Street Vector Layer

Postby herrchin » Thu Jan 07, 2016 7:12 pm

bedo2991 wrote:I've got a new PC and now the shortcut is not working for me :(.
I didn't have that keyboardShortcuts key in the list before installing toolbox. Afterwards I've noticed that it is correctly set as shown by someone previously in this topic. It is the only one with that value.
I'm currently using chrome and Windows 10.
Any hint to make it work again?

Mine hasn't worked for a long time. I wonder if this provides any hints as to the fix? It says in the hotkey list "Toggle [missing "en.layers.name.vectorStreet" translation]". I also can't change what hotkey is assigned there; it's stuck on ALT+L (which doesn't work. I've also verified that toggleStreet(Vector) is set to 4,76
USA Country Manager / UT SM
[ img ][ img ][ img ][ img ]
herrchin
Country Manager
Country Manager
 
Posts: 333
Joined: Mon Jun 22, 2015 6:05 pm
Location: Lincoln, NE, USA
Has thanked: 303 times
Been thanked: 220 times

Re: [Script][Beta] Street Vector Layer

Postby herrchin » Tue Feb 09, 2016 3:29 pm

registerShortcuts became _registerShortcuts (note underscore). There may be more...
USA Country Manager / UT SM
[ img ][ img ][ img ][ img ]
herrchin
Country Manager
Country Manager
 
Posts: 333
Joined: Mon Jun 22, 2015 6:05 pm
Location: Lincoln, NE, USA
Has thanked: 303 times
Been thanked: 220 times

Re: [Script] Street Vector Layer

Postby Horizon911 » Mon Nov 23, 2020 5:23 pm

Just received the newest version (5.0.8) and it's a major progress, thanks for it!
Observations/thoughts:
1. Road themes: Predefined, but user can customize them as wanted. (Expected? I think so.)
2. [Reset] button does not reset theme customizations. (Is that expected?)
3. It would be nice to have an option to "Use XX% real-life Width" (for me 50%, or better 30% :) )
4. Street names density: I do not fully understand the behavior of this setting/control, however it would be nice to be able to see the street name at least once between geometry nodes. (if it fits)

5. Any plans for replacing WME's functionality for manipulation w/ selected segments? (e.g. by having custom line thickness, custom node size and more then anything: Not being as flawed as the native WME functionality (Which -at least for me- gets often stuck on the different zoom leave, than the rest of screen. :D )
Horizon911
 
Posts: 461
Joined: Mon Jun 12, 2017 7:04 pm
Has thanked: 239 times
Been thanked: 20 times

Re: [Script] Street Vector Layer

Postby Horizon911 » Tue Nov 24, 2020 5:38 pm

bedo2991 wrote:
Horizon911 wrote:
Horizon911 wrote:5. Any plans for replacing WME's functionality for manipulation w/ selected segments? (e.g. by having custom line thickness, custom node size and more then anything: Not being as flawed as the native WME functionality (Which -at least for me- gets often stuck on the different zoom leave, than the rest of screen. :D )

Explain this one better, please.
I'm trying to keep the road layer as a road layer, and not as an interface enhancer. For that, other scripts (e.g. Fix UI) would probably be more suitable.


Sure, understood. The aim is to:
1. Get some improvements. (e.g. Get A. Color B. Node size C. NodeFill color+opacity C. Line+NodeOutline thickness configurable; ideally in-line w/ SVL configurations.)
2. Avoid native's tooling defective behavior... Example can be seen on this picture. Everything is at zoom level 8, while the selection lines are at a different zoom level. (6, perhaps?) Pretty frequent issue.

One more thing: In SVL settings, there is "Render Map as Level"... It took me very long time to understand to realize what is it about... i.e. "Editor level" and not to "Zoom level". :)
Last edited by Horizon911 on Wed Nov 25, 2020 2:40 am, edited 1 time in total.
Horizon911
 
Posts: 461
Joined: Mon Jun 12, 2017 7:04 pm
Has thanked: 239 times
Been thanked: 20 times

Re: [Script] Street Vector Layer

Postby Horizon911 » Wed Nov 25, 2020 2:39 am

Mapman44 wrote:
bedo2991 wrote:
Mapman44 wrote:I have problems though with roads going a little crazy if I zoom in while I have a road selected. Usually I have to zoom back out, de-select, zoom back in and re-select. Am I doing some wrong or is that bug?

I can't reproduce that, probably it's another script conflicting.
Does it happen all the time or only with certain segments?



I haven't been able to determine any particular pattern. I will do some trouble-shooting with other scripts disabled after MapRaid.


This is EXACTLY the defective I am referring to. It happens randomly, it's very difficult to reproduce and it's very annoying.

So for the refernce, I use following scripts:
* SVL
* WME - Magic
* WME Bookmarks
* WME Clear Feed
* WME ClickSaver
* WME Fix UI
* WME Open Other Maps
* WME Place Interface Enhancer.
* WME Reload Map Position Fix.
* WME Road selector
* WME Street to River PLUS
* WME StreetvVew availability
Horizon911
 
Posts: 461
Joined: Mon Jun 12, 2017 7:04 pm
Has thanked: 239 times
Been thanked: 20 times

Re: [Script] Street Vector Layer

Postby Horizon911 » Sat Nov 28, 2020 4:28 pm

Sooo, I disabled WME ClickSaver, and WME Streetview Availability. I was not editing too much but now I ended up with this. What you can see in the picture:
  • SVL, map and comments displayed shown on the expected zoom-level.
  • WME-roads displayed on the wrong zoom-level. (Level 1)

In this situation: You can zoom in and out, but WME's-roads zoom-level does not change. (Only when you reach the zoom-level, where it got frozen, it can get fixed.

It seems, that it's exactly the same issue, which affects zooming of road "highlights". (Therefore, it would be nice to have that mechanism replaced by "highlighting" working consistently with SVL. :) )
Horizon911
 
Posts: 461
Joined: Mon Jun 12, 2017 7:04 pm
Has thanked: 239 times
Been thanked: 20 times

PreviousNext

Return to Addons, Extensions, and Scripts

Who is online

Users browsing this forum: BenEnmen, fumitol, n4dog

cron