usualy on FF.
didn’t find any check box there, so a checkbox in visible place on the layers list will be better.
usualy on FF.
didn’t find any check box there, so a checkbox in visible place on the layers list will be better.
Sometimes in Chrome console get the following error: “Execution of script ‘WME speeds’ is not defined unsafeWindow failed” and not run the script. Can you verify why is that? ![]()
New version
Better speeds in tab
Now script ignore speeds in dirt road - Maybe for some states I can enable, but set speed on this road in Europe is… bad ![]()
Is it possible to add a option to switch off the lines. Some times i need to see the satellite image. But nou 1 see still the speed lines.
You can turn off in layers list ![]()
I know that you haven’t any other work
…
What about (maybe thinner) line/color along the segment from both sides, as one of options ?
hey,
the script doesn’t works on chrome.
reinstall doesn’t help ![]()
There are some issues in the initialisation function. I’ve fixed these for you (unsafeWindow is not available in Google Chrome if you don’t use any GM_* functions and the order of your checks wasn’t correct). This worked in Firefox and Google Chrome for me.
[code]function initialiseSpeedsHighlights() {
if (wmeSpeedsInit) {
return;
}
// init shortcuts
if (typeof(Waze) === ‘undefined’) {
console.log(“WME Speeds: Waze : NOK”);
setTimeout(initialiseSpeedsHighlights, 500);
return;
}
if (!Waze.map) {
window.console.log(“WME Speeds: waiting for WME…”);
setTimeout(initialiseSpeedsHighlights, 555);
return;
}
if (typeof(OpenLayers) === ‘undefined’) {
console.log(“WME Speeds: OpenLayers : NOK”);
setTimeout(initialiseSpeedsHighlights, 500);
return;
}
if (wmeSpeedsAllowLanguage.indexOf(I18n.locale) != -1) {
wmeSpeedsLanguage = I18n.locale;
}
wmeSpeedsLayer = new OpenLayers.Layer.Vector(fe_t(‘layerName’), {
displayInLayerSwitcher: true,
uniqueName: “__DrawSegmentSpeeds”
});
I18n.translations.en.layers.name[“__DrawSegmentSpeeds”] = fe_t(‘scriptName’);
Waze.map.addLayer(wmeSpeedsLayer);
if (localStorage.DrawSegmentSpeeds) {
wmeSpeedsLayer.setVisibility(localStorage.DrawSegmentSpeeds == “true”);
} else {
wmeSpeedsLayer.setVisibility(true);
}
// begin periodic updates
window.setInterval(highlightSpeedsSegments,333);
// trigger code when page is fully loaded, to catch any missing bits
window.addEventListener(“load”, function(e) {
var mapProblems = getId(‘map-problems-explanation’)
if (mapProblems !== null) mapProblems.style.display = “none”;
});
if (Waze.model.isImperial) {
wmeSpeedsMiles = true;
}
// register some events…
Waze.map.events.register(“zoomend”, null, highlightSpeedsSegments);
Waze.map.events.register(“changelayer”, null, changeLayer);
wmeSpeedsInit = true;
makeSpeedsTab();
// restore saved settings
if (localStorage.WMESpeedsScript) {
console.log(“WME Speeds: Loading Options”);
options = JSON.parse(localStorage.WMESpeedsScript);
getId('_wmeSpeedsInvert').checked = options[1];
getId('_wmeSpeedsDrivable').checked = options[3];
getId('_wmeSpeedsTransparentColors').checked = options[4];
getId('_wmeSpeedsUnverifed').checked = options[4];
}
// overload the WME exit function
saveWmeSpeedsOptions = function() {
if (localStorage) {
console.log(“WME Speeds: Saving Options”);
var options = ;
// preserve previous options which may get lost after logout
if (localStorage.WMESpeedsScript) {
options = JSON.parse(localStorage.WMESpeedsScript);
}
options[1] = getId('_wmeSpeedsInvert').checked;
options[3] = getId('_wmeSpeedsDrivable').checked;
options[4] = getId('_wmeSpeedsTransparentColors').checked;
localStorage.WMESpeedsScript = JSON.stringify(options);
}
}
// save options
window.addEventListener(“beforeunload”, saveWmeSpeedsOptions, false);
getId(‘_wmeSpeedsInvert’).onclick = highlightSpeedsSegmentsReset;
getId(‘_wmeSpeedsDrivable’).onclick = highlightSpeedsSegmentsReset;
getId(‘_wmeSpeedsTransparentColors’).onclick = highlightSpeedsSegmentsReset;
getId(‘_wmeSpeedsUnverifed’).onclick = highlightSpeedsSegmentsReset;
for (i = 0; i < wmeSpeedsColors.length; i++) {
wmeSpeedsColorsTransparent[i] = ‘rgba(’ + hexToRgb(wmeSpeedsColors[i]).r + ', ’ + hexToRgb(wmeSpeedsColors[i]).g + ', ’ + hexToRgb(wmeSpeedsColors[i]).b + ‘, 0.4)’;
wmeSpeedsAvailableColor[wmeSpeedsAvailableColor.length] = wmeSpeedsColorsTransparent[i];
}
for (i = 0; i < wmeSpeedsColorsMph.length; i++) {
wmeSpeedsColorsMphTransparent[i] = ‘rgba(’ + hexToRgb(wmeSpeedsColorsMph[i]).r + ', ’ + hexToRgb(wmeSpeedsColorsMph[i]).g + ', ’ + hexToRgb(wmeSpeedsColorsMph[i]).b + ‘, 0.4)’;
wmeSpeedsAvailableColor[wmeSpeedsAvailableColor.length] = wmeSpeedsColorsMphTransparent[i];
}
}[/code]
It should probably not be ignored for USA.
I can manually update the file to change the colors, but it would be great to have a built-in customization. For the US, for example, we have many states with maps for state/us routes and freeways with the speed limits. Making the colors match the state DOT map would be cool and make comparisons a lot easier.
Until WME Speeds gets updated, try this script, which can do this.
Hi,
This addon is great but I have an issue.
When It’s installed and enabled under Tampermonkey, I have login issues in WME beta and the left pane is disappeared.
Hi,
sorry for my miss, but I’m on vacation. I hope that by the end of next week will be released updates.
New version.
Fix starting script (thanks Glodenox)
Script maybe crash login to new WME, so now it’s fixed.
Thanks for all the work you do.
martinkolar, could you please add option to higlight speeds also on dirt roads, private roads and parking lot roads?
Possibly moving these “Other - Drivable” segment types out from “Non-Drivable” category could be sufficient. I do not think that they need some special color handling. They are drivable and pretty frequently the real roads, mapped with them, have real Speed Limits.
Hi
A problem was reported to me, that these scripts also run when a user is on his/her userpages, what results in a flood of messages in the console log window.
Adding the following 2 lines at the top of the script resolves this problem
// @exclude https://www.waze.com/user/*editor/*
// @exclude https://www.waze.com/*/user/*editor/*
Kind regards
foxitrot make new version:
Split non-drivable segments to non-drivable and other-drivable segments.
And add some lines from gertbroos.
Thanks guys!
Great!