Page 8 of 34

Re: [Script] WME Route Speeds (Traffic)

Posted: Thu Jan 01, 2015 5:58 pm
by FZ69617
New Year's gift to all editors! ;)

WME Route Speeds version 1.2.8 has been released today.

Change log:
  • New: Added "Route type" routing option. Finally. :)
  • New: Added "Try more" alternative routes option. With this experimental option enabled more route alternatives than specified by user will be requested from routing server.
  • Change: Controls' styling.
  • Improvement: Route list sorting.
  • Improvement: Route list selection can now be toggled.
  • Improvement: Better handling of route request errors.
  • Other: Minor code changes.
Hope you will enjoy this new version. :)

Happy New Year to all Wazers! :)

Re: [Script] WME Route Speeds (Traffic)

Posted: Fri Jan 02, 2015 9:42 am
by FZ69617
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.

Re: [Script] WME Route Speeds (Traffic)

Posted: Wed Jan 14, 2015 5:36 pm
by FZ69617
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. :)

Re: [Script] WME Route Speeds (Traffic)

Posted: Wed Dec 08, 2021 2:24 pm
by G_W1Z
tonestertm wrote: Thu Oct 21, 2021 10:40 pm While I'm waiting on approval to release through the official WazeDev release, here's a temporary fork, so it's not delayed any further.

IMPORTANT NOTES:
There are a couple of things still not back up to par:
- Sorting of routes currently defaults to "Use Routing Order": sort by fastest is not currently working, so the checkbox is removed for the moment.  I'll keep working on it as time permits, in case anyone still actually sorts by fastest.
- Centering on the A and B markers with a click is currently non-functional (not sure how long that's been broken, honestly. I have only rarely used it.) This, too, will be pursued as time permits.

and, some updates:

- Coordinates in the A and B location boxes are now LAT,LON, instead of LON,LAT. This should make copy/pasting coordinates less of a chore. 
- The "Try more" option has been removed, because the livemap routing server hasn't actually supported it for a couple of years. 
- Some other small fixes and updates

This is a private GreasyFork link, so you won't be able to search for it in GF. This is only intended to be a temporary fork, and will be removed once the official fork is updated.

Don't forget you will need to disable the official fork in your script handler for this to run properly. (note that it has not yet been tested in Firefox)

Temporary Repair Fork of WME Route Speeds (MapOMatic fork)
 

 
When using this I can see the A and B points but it doesn't show the routes.
 

Re: [Script] WME Route Speeds (Traffic)

Posted: Fri Mar 17, 2023 1:33 pm
by G_W1Z
Webs101 wrote: Thu Mar 16, 2023 6:48 pm The MapOMatic fork is not loading for me in the latest production update.
He is aware. It has to do with the recent WazeWrap changes. An update should be released soon.

Re: [Script] WME Route Speeds (Traffic)

Posted: Sun Oct 15, 2023 4:08 pm
by G_W1Z
Olestas wrote: Sun Oct 15, 2023 5:57 am Script is not working for me.. it appears in settings, but does not do anything.. no errors in console.
It's working for me:
Screenshot 2023-10-15 120754.gif
(1.39 MiB) Downloaded 109 times

Re: [Script] WME Route Speeds (Traffic)

Posted: Wed Oct 18, 2023 5:25 pm
by G_W1Z
Olestas wrote: Wed Oct 18, 2023 10:08 am Well.. at the end it was Disable script tick.. somehow it was on. So yeah.

Thanks for layers script though :}

For what it's worth a new version of the fork was released: viewtopic.php?f=819&t=105839&start=170#p1560939

Re: [Script] WME Route Speeds (Traffic)

Posted: Mon Feb 26, 2024 11:18 am
by G_W1Z
With only this script running I get this error:
Screenshot 2024-02-26 061724.jpg
(583.94 KiB) Downloaded 90 times
The list of routes does not load either.

Re: [Script] WME Route Speeds (Traffic)

Posted: Sun Nov 29, 2015 10:06 am
by Glodenox
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.

Re: [Script] WME Route Speeds (Traffic)

Posted: Mon Nov 30, 2015 7:59 am
by Glodenox
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).