[Script] WME Route Speeds (Traffic)

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] WME Route Speeds (Traffic)

Postby FZ69617 » Fri Jan 02, 2015 9:42 am

anthndp wrote:Hi, I just wanted to report that avoid tolls and avoid freeways no longer work in 1.2.8

Thank you for the report - this was my mistake. Sorry for that.
Just FYI, also dirt roads option was affected by this bug in 1.2.8.

New fixed version 1.2.8.1 has been published - please update.
FZ69617
Waze Local Champs
Waze Local Champs
 
Posts: 933
Joined: Fri Jul 25, 2014 9:29 am
Location: Zielona Góra, Poland
Has thanked: 36 times
Been thanked: 237 times

Re: [Script] WME Route Speeds (Traffic)

Postby FZ69617 » Wed Jan 14, 2015 5:36 pm

WME Route Speeds version 1.2.9 has been released.

New features:
  • Centering the map on the A/B markers. Clickable labels of the A/B coordinates entry.
  • Routing options reset to the Livemap Route equivalents.
  • Added experimental "Fastest (no history)" route type option. A routing type found in old client sources, which seems to work still. I presume this requests the routes calculated without taking of the historical data into account - the routes likely similar to the ones calculated by a network disconnected client.
As always, any feedback is welcome. :)
FZ69617
Waze Local Champs
Waze Local Champs
 
Posts: 933
Joined: Fri Jul 25, 2014 9:29 am
Location: Zielona Góra, Poland
Has thanked: 36 times
Been thanked: 237 times

Re: [Script] WME Route Speeds (Traffic)

Postby Glodenox » Sun Nov 29, 2015 10:06 am

Ah, cross-origin request issues. Those can be solved by replacing XMLHttpRequest with GM_xmlhttpRequest which doesn't have this restriction for userscripts (GreaseMonkey or TamperMonkey required, can't be done any more directly in Chrome), but from first hand experience I can say that it impacts your script quite a bit.

For example: you'll need to start using unsafeWindow to access the objects on the web page and can't pass it any objects you created in your script unless you use the cloneInto function. Debugging it all also becomes a bit more painful as the different environment of the script puts the logging elsewhere. All in all, I doubt it's worth the hassle for this script. Still it's good to know that at least there's an option to fix it.
Belgium & Luxembourg Coordinator • Script Writing Community Coordinator
[ img ][ img ]
Glodenox
Waze Global Champs
Waze Global Champs
 
Posts: 1203
Joined: Tue Aug 11, 2015 9:04 pm
Location: Belgium
Has thanked: 680 times
Been thanked: 1344 times

Re: [Script] WME Route Speeds (Traffic)

Postby Glodenox » Mon Nov 30, 2015 7:59 am

To respond to point 2: it fails in Firefox as you're copying an object from one environment to another. If you want to copy objects over you'll need to use cloneInto for objects and exportFunction for functions.

I've personally learnt a lot from the "Interacting with page scripts" article at MDN. So luckily we don't have to inject our code (which is quite an unsafe practice).

As an example, I have a script in the pipeline that adds certain layers to the editor and adds a tab to manipulate those layers. I only had to change my code slightly.
As I need the Waze objects I obtain them whenever they are available:
Code: Select all
 // @grant GM_xmlhttpRequest (or any other sandbox-inducing method)
function init() {
  if (!unsafeWindow.Waze) {
    setTimeout(init, 400);
    return;
  }
  var Waze = unsafeWindow.Waze;
  // you can now call any function or read any attribute of the Waze object, but will need to clone them into the context of unsafeWindow in case the Waze object will be using them - simple types are excluded from this
}
init();


I'll try to edit in an example of the cloneInto calls I had to do for that script later on (as I don't have it available here).
Belgium & Luxembourg Coordinator • Script Writing Community Coordinator
[ img ][ img ]
Glodenox
Waze Global Champs
Waze Global Champs
 
Posts: 1203
Joined: Tue Aug 11, 2015 9:04 pm
Location: Belgium
Has thanked: 680 times
Been thanked: 1344 times

Re: [Script] WME Route Speeds (Traffic)

Postby Harriv2 » Fri Dec 13, 2019 4:02 pm

I can confirm this. Javascript console has some error messages, which may be relevant:

Code: Select all
TypeError: this.map.viewPortDiv is undefined WazeWrapLib.js:1015:21
    dragstart https://cdn.staticaly.com/gh/WazeDev/WazeWrap/master/WazeWrapLib.js?env=dev&_=1576252900512:1015
    mousedown https://cdn.staticaly.com/gh/WazeDev/WazeWrap/master/WazeWrapLib.js?env=dev&_=1576252900512:1079
    i https://editor-assets.waze.com/production/js/vendor-f02a0cf9e412c43083a4.js:1
    dispatch https://editor-assets.waze.com/production/js/vendor-f02a0cf9e412c43083a4.js:1
    handle https://editor-assets.waze.com/production/js/vendor-f02a0cf9e412c43083a4.js:1
Harriv2
 
Posts: 57
Joined: Wed Nov 12, 2014 12:09 am
Has thanked: 6 times
Been thanked: 17 times

Re: [Script] WME Route Speeds (Traffic)

Postby hebermc » Sat Aug 23, 2014 5:42 am

I cant see the RouteSpeeds tab, is this script incompatible with any other?

Clicking two segments does show "Show routes between these two segments".
[ img ][ img ][ img ]
AM Recife - SM Pernambuco - CM Brasil - Links importantes
"He who hesitates is not only lost, but several miles from the next freeway exit"
hebermc
Global Champs Localizers
Global Champs Localizers
 
Posts: 1610
Joined: Fri Apr 06, 2012 2:17 am
Location: Recife, PE, Brasil
Has thanked: 1167 times
Been thanked: 1090 times

Re: [Script] WME Route Speeds (Traffic)

Postby hebermc » Sat Aug 23, 2014 5:08 pm

wlodek76 wrote:
hebermc wrote:I cant see the RouteSpeeds tab, is this script incompatible with any other?
Clicking two segments does show "Show routes between these two segments".


Browser requirements:
https://wiki.waze.com/wiki/Community_Pl ... quirements

What operating system (OS) and browser ?


Chrome Canary + Tampermonkey
Windows 7 x64
Developer mode: on

Its working fine in normal Chrome, not sure if its the script or tampermonkey. Trying to find out.

EDIT: reloaded a bunch of stuff and now it works, no clue what the issue was
[ img ][ img ][ img ]
AM Recife - SM Pernambuco - CM Brasil - Links importantes
"He who hesitates is not only lost, but several miles from the next freeway exit"
hebermc
Global Champs Localizers
Global Champs Localizers
 
Posts: 1610
Joined: Fri Apr 06, 2012 2:17 am
Location: Recife, PE, Brasil
Has thanked: 1167 times
Been thanked: 1090 times

Re: [Script] WME Route Speeds (Traffic)

Postby herrchin » Mon Apr 10, 2017 5:55 pm

RichardPyne wrote:
JustinS83 wrote:Anyone else having this issue?

I have seen it when I've been trying several times. After a few changes, it stops updating.

I can readily replicate this by changing the times quickly and many times. It feels like a throttle, possibly by the route server. Nudging the A or B endpoint un-throttles me.
USA Country Manager / UT SM
[ img ][ img ][ img ][ img ]
herrchin
Country Manager
Country Manager
 
Posts: 332
Joined: Mon Jun 22, 2015 6:05 pm
Location: Lincoln, NE, USA
Has thanked: 302 times
Been thanked: 219 times

Re: [Script] WME Route Speeds (Traffic)

Postby hmarian » Sun Jan 17, 2016 7:39 pm

Now that Taxi is enabled for some, it is going to add value if you could choose the vehicle type.

Device: Samsung Galaxy S20+
Waze Version: 4.67.0.4
Country Manager: Canada
Area Manager: Greater Toronto Area, Buffalo (NY), Binyamina (Israel)
Android/WME Beta Tester
-----------------------------------------------------------------------------------------
Editing Manual | Editing Best Practice | @Waze_Canada
hmarian
Waze Global Champs
Waze Global Champs
 
Posts: 4253
Joined: Tue Sep 24, 2013 9:08 pm
Location: Toronto, Ontario, Canada
Has thanked: 302 times
Been thanked: 1808 times

Re: [Script] WME Route Speeds (Traffic)

Postby hmarian » Fri May 27, 2016 5:37 pm

For quite some time I can only see one route option, even when I select more than 1 "Alternative routes" in the script menu.
Is this an issue just for myself?

Device: Samsung Galaxy S20+
Waze Version: 4.67.0.4
Country Manager: Canada
Area Manager: Greater Toronto Area, Buffalo (NY), Binyamina (Israel)
Android/WME Beta Tester
-----------------------------------------------------------------------------------------
Editing Manual | Editing Best Practice | @Waze_Canada
hmarian
Waze Global Champs
Waze Global Champs
 
Posts: 4253
Joined: Tue Sep 24, 2013 9:08 pm
Location: Toronto, Ontario, Canada
Has thanked: 302 times
Been thanked: 1808 times

PreviousNext

Return to Addons, Extensions, and Scripts

Who is online

Users browsing this forum: jm6087, mudge42, Superb2018