That has been what I was looking for! Where do I find that?
R5 | RI SM | CA, MA & NY AM | Mentor
Thanks to Pz's help, I have now successfully added a shortcut for Streets Vector Layer.
If you already have the Developer Tools extension installed for your browser, you just need to open it up while in WME and select the tab to view "Resources" > "Local Storage" > http://www.waze.com. There should be a stored variable, keyboardShortcuts, within that list.
The easiest way to get the correct keyCode for your shortcut is to open up the WME shortcuts pane and temporarily assign the desired keys to another event (i.e., use "Keyboard Shortcuts" link in the bottom left of WME or press "?" hotkey). So, if I have no shortcut assigned for the Vector layer and I want to use alt+l, I might temporarily assign those keys to "Toggle Junctions." After the shortcut has been set, I'll go looking for the corresponding key codes for toggleJunctions saved within the long keyboardShortcuts array, copy the two numbers into clipboard, and then remove the shortcut for "Toggle Junctions" by making the values "0,-1"
(i.e., find "toggleJunctions":"4,76", copy "4,76", then edit to "toggleJunctions":"0,-1"). Finally, I paste the copied key codes over to the entry for toggleStreet...: "toggleStreet(Vector)":"4,76",... and reload WME. The keys can be verified by taking a look in the Keyboard Shortcuts pane again. If it looks good there, the new shortcut should now work.
Alternatively, you could also manually find the values for your shortcut with the help of this website: http://www.cambiaresearch.com/articles/ ... -key-codes. The first number must be 0-7 and represents the modifier key(s) and the second number is the associated key press (a letter, number, or a function key).
The key codes for modifier key(s) are:
0 - no modifier key(s)
1 - ctrl
2 - shift
3 - ctrl+shift
4 - alt
5 - ctrl+alt
6 - alt+shift
7 - ctrl+alt+shift
Thus, if you want ctrl+alt+shift+s as the shortcut, you would use ""7,83". 83 is the key code for 's'.
If you already have the Developer Tools extension installed for your browser, you just need to open it up while in WME and select the tab to view "Resources" > "Local Storage" > http://www.waze.com. There should be a stored variable, keyboardShortcuts, within that list.
The easiest way to get the correct keyCode for your shortcut is to open up the WME shortcuts pane and temporarily assign the desired keys to another event (i.e., use "Keyboard Shortcuts" link in the bottom left of WME or press "?" hotkey). So, if I have no shortcut assigned for the Vector layer and I want to use alt+l, I might temporarily assign those keys to "Toggle Junctions." After the shortcut has been set, I'll go looking for the corresponding key codes for toggleJunctions saved within the long keyboardShortcuts array, copy the two numbers into clipboard, and then remove the shortcut for "Toggle Junctions" by making the values "0,-1"
(i.e., find "toggleJunctions":"4,76", copy "4,76", then edit to "toggleJunctions":"0,-1"). Finally, I paste the copied key codes over to the entry for toggleStreet...: "toggleStreet(Vector)":"4,76",... and reload WME. The keys can be verified by taking a look in the Keyboard Shortcuts pane again. If it looks good there, the new shortcut should now work.
Alternatively, you could also manually find the values for your shortcut with the help of this website: http://www.cambiaresearch.com/articles/ ... -key-codes. The first number must be 0-7 and represents the modifier key(s) and the second number is the associated key press (a letter, number, or a function key).
The key codes for modifier key(s) are:
0 - no modifier key(s)
1 - ctrl
2 - shift
3 - ctrl+shift
4 - alt
5 - ctrl+alt
6 - alt+shift
7 - ctrl+alt+shift
Thus, if you want ctrl+alt+shift+s as the shortcut, you would use ""7,83". 83 is the key code for 's'.
Last edited by TheLastTaterTot on Fri Oct 30, 2015 9:33 am, edited 3 times in total.
R5 | RI SM | CA, MA & NY AM | Mentor
@andy: Yup, that's it. toggleStreet(Vector) is currently assigned "4,76" (alt+l) for you.
R5 | RI SM | CA, MA & NY AM | Mentor
@andy: no, modify keyboardShortcuts directly.
From something like this:
{..."toggleEditableAreas":"2,69","toggleRoadClosures":"3,67","toggleStreet(Vector)":"0,-1",...}
To this:
{..."toggleEditableAreas":"2,69","toggleRoadClosures":"3,67","toggleStreet(Vector)":"3,83",...}
"..." represents parts of the code that was omitted from the post for brevity sake.
From something like this:
{..."toggleEditableAreas":"2,69","toggleRoadClosures":"3,67","toggleStreet(Vector)":"0,-1",...}
To this:
{..."toggleEditableAreas":"2,69","toggleRoadClosures":"3,67","toggleStreet(Vector)":"3,83",...}
"..." represents parts of the code that was omitted from the post for brevity sake.
R5 | RI SM | CA, MA & NY AM | Mentor
What a big tease, bedo!!
Is this "Waze soon" or soon soon??
Thanks so much for figuring out how to fix the labels!
Is this "Waze soon" or soon soon??
Thanks so much for figuring out how to fix the labels!
R5 | RI SM | CA, MA & NY AM | Mentor
This is one of those times I wish there was an option to favorite a post so I can come back to it later when I need it. I suppose a bookmark should suffice.
Glodenox wrote:And at the same time it would probably be best to wrap the whole script inside a function to prevent a collision of function names or variables with other scripts (which seems very likely due to the very generic function names). It's not that hard to do as it won't impact your script:
For the console issue, I personally use a different function for that:Code: Select all
(function() { // All function and variable declarations go in here as they are now })();
Also, there is a global variable svlAttempts that could be put as a var at the top of the script as it is not useful anywhere else (inside the function declaration I showed in this post). The risk of a collision with other scripts is very minimal though.Code: Select all
function log(obj) { if (localStorage.svlDebug) { // just a suggestion, feel free to do something else console.log(obj); } }
Just trying to make your script even better
R5 | RI SM | CA, MA & NY AM | Mentor
I installed this for the first time, got this: (otherwise seemed to work okay)
- Attachments
Timbones(6) • UK Coordinator • Forum Moderator • Closure Monitor
Scripts: WME Colour Highlights • WME Route Tester • WME Geometries
Scripts: WME Colour Highlights • WME Route Tester • WME Geometries
It *would* be possible to hide dirt roads, Parking Lots, etc at zooms where streets aren't included in the vector data. Then it would at least be consistent.
Sent from my Nexus 4 using Tapatalk
Sent from my Nexus 4 using Tapatalk
Timbones(6) • UK Coordinator • Forum Moderator • Closure Monitor
Scripts: WME Colour Highlights • WME Route Tester • WME Geometries
Scripts: WME Colour Highlights • WME Route Tester • WME Geometries
Please! I want this too. Maybe it could be an optional setting?KuniaKid wrote:Is it possible to have Private and Parking lot Roads not show up until zoom level 4?
I really don't mind if they are invisible yet selectable.
Timbones(6) • UK Coordinator • Forum Moderator • Closure Monitor
Scripts: WME Colour Highlights • WME Route Tester • WME Geometries
Scripts: WME Colour Highlights • WME Route Tester • WME Geometries
Doesn't run at all on /en-GB/editor I suspect it'll break other languages with dashes.
Why not stick with something simple: https://*.waze.com/*editor/*
Belt and braces: check that Waze object exists, and quit your bootstrap if it doesn't:
Why not stick with something simple: https://*.waze.com/*editor/*
Belt and braces: check that Waze object exists, and quit your bootstrap if it doesn't:
Code: Select all
if (typeof Waze == 'undefined') {
return; // not WME
}
Timbones(6) • UK Coordinator • Forum Moderator • Closure Monitor
Scripts: WME Colour Highlights • WME Route Tester • WME Geometries
Scripts: WME Colour Highlights • WME Route Tester • WME Geometries
Re: [Script][Beta] Street Vector Layer