Get a sneak peek at whats next for Permanent Hazards on our April 7th Office Hours!
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.
Post by berestovskyy
manoeuvre wrote:Unable to get my custom localization script to work.
Very good start! Few notes:

1. You have to put checks inside the country block, i.e.:

Code: Select all

window.WME_Validator_Canada = {
  // checks should be here
}
2. You don't need to add a template to checks #171 and #174, since they are designed to match street names. We use templates in custom checks only (#130-#139). Please refer this forum post for the check params (or in Validator click Settings (gear)->About->Available checks.)

3. To use a backslash inside a string you need to escape it, i.e. to match an alphanumeric character use "\\w" and to match a dot use "\\."

Here is your script with the above changes:

Code: Select all

// ==UserScript==
// @name                WME Validator Localization for Canada
// @version             1.1.1
// @description         This script localizes WME Validator for Canada. You also need main package (WME Validator) installed.
// @match               https://editor-beta.waze.com/*editor/*
// @match               https://www.waze.com/*editor/*
// @grant               none
// @run-at              document-start
// ==/UserScript==
//

window.WME_Validator_Canada = {
  ".country": "Canada",
  ".codeISO": "CA",
  ".author": "manoeuvre",
  ".updated": "2014-09-03",
      
  "171.enabled": true,
  "171.params": {
    "regexp": "/ (Aly|Avenue|Bnd|Boulevard|By-pass|Centre|Center|Circle|Cl|Court|Cr|Ct|Crescent|Cul-de-sac|Drive|Extension|Fld|Gardens|Gln|Grn|Grounds|Grv|Harbour|Harbr|Heights|Highway|Hl|Holw|Landing|Landng|Ln|Mnr|Mdw|Mountain|Orchard|Park|Parkway|Passage|Pass|Ptwy|Place|Pt|Prt|Pvt|Promenade|Rg|Rdge|Road|Square|Subdiv|Street|Terrace|Ter|Trl|Tr|Thick|Tline|Turnabt|Village|Villge|North|East|South|West)$/i",
  },

  "174.enabled": true,
  "174.params": {
    "titleEN": "St. not St",
    "problemEN": "St. not St",
    "solutionEN": "Use St. instead of St",
    "regexp": "/^St \\w\\w/",
  },
}
berestovskyy
Posts: 912
Has thanked: 321 times
Been thanked: 832 times
Send a message

Post by berestovskyy
sketch wrote:Why do you need two backslashes?
You don't if you put your regexp into an edit field, i.e. when you use Validator interface for the custom checks you should use just \w, \d and \.

But you do need to double each backslash when you put the regexp into a JavaScript string, i.e.

Code: Select all

"regexp": "/this is a JS string, so we use \\w and \\. here/",
In JS, Java, C, C++ and many other programming languages we use a backslash as an escape character. Have a look at the Using special characters in strings at MDN.
berestovskyy
Posts: 912
Has thanked: 321 times
Been thanked: 832 times
Send a message

Post by berestovskyy
Guys,
Everything about connections is not working since the last WME update. Some checks I had to disable manually, but some checks (like those unneeded node A/B) just silently lost some of their functionality.

I'm sorry about that, but I'm busy at the moment and simply have no time to fix and test it. I'll be busy till the end of October or so :(

I'm also looking into some options to fix this sooner...

PS. For the unneeded node A/B you can change something insignificant in the segment's properties as a workaround. Try to change lock or alt name for instance...
berestovskyy
Posts: 912
Has thanked: 321 times
Been thanked: 832 times
Send a message

Post by berestovskyy
01.10.2014 v1.1.2:
- Disabled for IL #28 'Street name on two-way Ramp'
- Updated Polish abbreviations
- Fixed custom checks #135-139
- Updated Spanish translations thanks to robindlc
- Enabled for NL #150-154 'Lock levels'
- Updated segment properties UI
berestovskyy
Posts: 912
Has thanked: 321 times
Been thanked: 832 times
Send a message

Post by berestovskyy
Nomenclator1677 wrote:But right now, validator is useless as the display is on the upper left corner of the window.
Sorry, I've tried World and NA servers, beta and prod WME, but I can't reproduce the issue.

Could you please include a screenshot?
berestovskyy
Posts: 912
Has thanked: 321 times
Been thanked: 832 times
Send a message

Post by berestovskyy
Sorry, I'm not sure if it is a screenshot of Validator :?
berestovskyy
Posts: 912
Has thanked: 321 times
Been thanked: 832 times
Send a message

Post by berestovskyy
07.10.2014 v1.1.3:
- Updated Polish translations thanks to Zniwek
- Enabled for ES #130-133 'Custom lock levels'
- Updated #114 and #115 'Non-drivable connected to drivable': excluded Railroads
berestovskyy
Posts: 912
Has thanked: 321 times
Been thanked: 832 times
Send a message

Post by berestovskyy
Gerrit1965 wrote:Update & additional information: I am using Firefox Version 32.0.3 and I restarted the browser, but the problem persists:
Please report WME Validator CODE BLUE: -30472
Code blue is the integrity check.

If you copy-paste the Validator, try to save it to a file and then load or drag and drop into the Tampermonkey. And vice versa.
berestovskyy
Posts: 912
Has thanked: 321 times
Been thanked: 832 times
Send a message

Post by berestovskyy
voludu2 wrote:I am seeing inconsistencies with custom template/regexp highlighting, This makes it somewhat less useful than it could be for identifying "state smudging"
Unfortunately, WME was not created with Validator in mind, so there are few limitations. If you combine them together it will look like a bug sometimes, but from your description it it sound like a strange but normal behaviour:

1. WME does not load all of the geometry at zoom levels 0-3. So you see the image of the streets, but there are no geometry, so those streets are not selectable and Validator can't check/highlight them.

2. Sometimes there are exceptions to the rule #1. For instance, if you zoom in to lvl 4 and then zoom out to lvl 3, the geometry may be still there, so Validator highlight some of the streets, but not the others.

3. Out of screen segments are not loaded, but sometimes they are still there when we pan around. Some Validator checks need all of the segments to be loaded.


Plus there are few Validator limitations:
1. Checks marked with "slow" does not run on zoom level 0-3.

2. There is a limit of reported segments per check (300). The 'Clear' button becomes red and there is a message in the segment's properties for that. So you can't report/highlight more that 300 blue custom check segments, you need to click the 'Clear' button time to time :(

3. There is a total number of segments limit (20K). Same, you'll see the red 'Clear' button and the message.

4. The therm "editable segment" in Validator has a bit stricter meaning: the segment properties should be editable and both of the nodes.

I hope that answers your questions.

EDIT: There is also few "bypasses" in Validator I forgot to mention:
1. Validator skips all checks for non-editable segments, which were updated after the 2014-05-01. There is a message in the segment's properties for that. We mark "exceptions" this way.

2. Validator skips all checks (but overlapping segments) for unconfirmed roads.

3. Validator skips all checks (but overlapping segments) for construction zones.
berestovskyy
Posts: 912
Has thanked: 321 times
Been thanked: 832 times
Send a message

Post by berestovskyy
Hi,
voludu2 wrote:is a custom check like ${state} !/Pennsylvania/ a slow search?
No, custom checks are not marked as slow, so they run whenever all other conditions are met.
voludu2 wrote:should a segment which is locked above my level and which matches the custom check be highlighted?
There is also few "bypasses" in Validator I forgot to mention:
1. Validator skips all checks for non-editable segments, which were updated after the 2014-05-01. There is a message in the segment's properties for that. We mark "exceptions" this way.

2. Validator skips all checks (but overlapping segments) for unconfirmed roads.

3. Validator skips all checks (but overlapping segments) for construction zones.

bart99gt wrote:Is there any way Validator could check for a segment that is in the opposite direction of the ones surrounding it, perhaps limited to minor highways and above?
If I understand that correctly, two one-way segments connected at a node and running in opposite directions should trigger "no inward/outward connectivity". Unfortunately, those checks are not working at the moment :(
berestovskyy
Posts: 912
Has thanked: 321 times
Been thanked: 832 times
Send a message