[Script] WME Advanced Closures

I continue to love this script. It’s at the top of my list.

But it crashes WME when applying a closure about 75% of the time. WME stays up, but the left sidebar disappears. I need to fully reload WME to get them back.

WME does that by itself once in a while, but the script is even worse.

Might be related to WME Ra Util.
“Deselect” show roundabout angles

I have never used or even downloaded that script so I doubt it. :smiley:

Hi,

and WME PIE desabled too ?

I believe that PIE has been updated

This happens with old or new PIE active and PIE inactive.

I have had the “nav drawer” and left sidebar go blank on me maybe once a day in the last couple weeks, but not when using AC. It usually happens to me just by selecting a segment, but happens rarely and I have not found a way to reproduce it.

Looks like Advanced Closures has been broken by the WME 2.177 update. Can’t create any closures using it, Console is showing a number of errors (copied below). In WME AC window, Preview area says “Repeat count is invalid” no matter what valid repeat options are chosen.

TimVM36:109 Advanced closures v2022.11.16.01 - Error while refreshing closure list: TypeError: Cannot read properties of undefined (reading 'attributes') at <anonymous>:1915:65 at Array.reduce (<anonymous>) at WMEAC_Injected.WMEAC.refreshClosureList (<anonymous>:1913:77) WMEAC_Injected.WMEAC.logError @ VM36:109 WMEAC_Injected.WMEAC.refreshClosureList @ VM36:1951 setTimeout (async) (anonymous) @ VM36:1369 dispatch @ third_party-83f2439a8e6dd624.js.gz:2 g.handle @ third_party-83f2439a8e6dd624.js.gz:2 VM36:109 Advanced closures v2022.11.16.01 - Error while refreshing closure list: TypeError: Cannot read properties of undefined (reading 'attributes') at <anonymous>:1915:65 at Array.reduce (<anonymous>) at WMEAC_Injected.WMEAC.refreshClosureList (<anonymous>:1913:77) WMEAC_Injected.WMEAC.logError @ VM36:109 WMEAC_Injected.WMEAC.refreshClosureList @ VM36:1951 setTimeout (async) (anonymous) @ VM36:1410 dispatch @ third_party-83f2439a8e6dd624.js.gz:2 g.handle @ third_party-83f2439a8e6dd624.js.gz:2

I can confirm that this issue is happening here too. Whatever one tries, the “Repeat count is invalid” appears.

Hi,

I create this page for generate csv
https://waze.tech-informatique.fr/TC/

It helps out a bit.

Hi, thx for this. Can you give us a bit more explanation pls? Does one need to create a csv with your tool and import it in Advanced Closures and it’ll be possible to submit this without errors?
To the author/adapter of the script: any idea on when a fix for the issue might be available?
Cheers,
Eddy

Advanced Closures has been updated to 2023.07.20.01 to work on the latest WME.

Dave

Sorry, I didn’t get a notification.

For operation, it’s the same as AC, you have to download the .csv file to import it then. (you can translate the page for more understanding).

“submit without error”? I don’t have error :-/

Thanks Daveacincy for the information :wink:

I have encounter a bug during CSV export. Not sure if it’s the right approach, but with this modification it’s working for me:

//var lonlat=W.map.getCenter().transform(W.map.getProjectionObject(), "EPSG:4326"); var mlonlat=W.map.getCenter(); let lonlat=new OpenLayers.LonLat(mlonlat.lon, mlonlat.lat).transform('EPSG:3857', 'EPSG:4326');

When trying to create closures in WMEAC I discovered that roadType 1 is not working on zoom level 14.
Waze API doesn’t support roadType 1 when bbox is too big?

Hello,

very interesting modification.

Streets (roadType 1) are not necessarily visible with too small zooms, I thought the script was like us:
Zoom 15: I can’t select them
Zoom 14: I can’t see them

But if you tell us that it’s OK for the street type (and other types of the same PLR level etc.?), that’s great :scream:

I have a request from Rally organizers to put closures for several rally stages.
Stages are quite long and mostly are gravel roads (in my country they are marked as Streets (type 1)). So in order to put a closure bbox covering all selected segments is equal to zoom level 14.
I couldn’t understand why WMEAC says that some segments are missing when I was importing CSV file. But while debugging it seems that
https://www.waze.com/row-Descartes-live/app/Features?roadTypes=1 for my bbox doesn’t return any segmentsheader,reason,start date (yyyy-mm-dd hh:mm),end date (yyyy-mm-dd hh:mm),direction (A to B|B to A|TWO WAY),ignore trafic (Yes|No),segment IDs (id1;id2;...),lon/lat (like in a permalink: lon=xxx&lat=yyy),zoom (2 to 10),MTE id (empty cell if not),comment (optional) add,"","2023-08-04 17:15","2023-08-04 22:30","TWO WAY",No,"323963340;323963339;323963304;176416359;176413988;376622372;376622371;407819537;376622410;396362252;396362253;396362226;381559307;381559308;381559334;381559335;381559363;381559362;144088175","lon=25.51022&lat=57.06006",14,,"Generated by WMEAC"

Hi,

oh, I understand.

it’s not WME AC that restricts you but WME.

The maximum zoom for the streets (and even class) is 16, otherwise they are invisible for the script and for the WME links…

Each section selected must be fully visible on the screen (+/- a few pixels on the edge of the screen)

The link of your selection with zoom 15 : https://www.waze.com/fr/editor?env=row&lat=57.04109&lon=25.47282&zoomLevel=15&segments=323963340,323963339,323963304,176416359,176413988,376622372,376622371,407819537,376622410,396362252,396362253,396362226,381559307,381559308,381559334,381559335,381559363,381559362,144088175

with zoom 16 : https://www.waze.com/fr/editor?env=row&lat=57.04109&lon=25.47282&zoomLevel=16&segments=323963340,323963339,323963304,176416359,176413988,376622372,376622371,407819537,376622410,396362252,396362253,396362226,381559307,381559308,381559334,381559335,381559363,381559362,144088175

We can see that the selection goes beyond the screen and that we cannot have all the segments.
AC “sees” the same thing as we on WME.

Here are the rules I give to publishers using WME AC in France for cycle races:

  • Each section selected must be fully visible on the screen (+/- a few pixels on the edge of the screen)
  • It is not necessary to see the two nodes of the segments at the ends on the screen, but you must see at least one of the nodes.
  • The maximum zoom for the streets (and even class) is 16, otherwise they are invisible for the script and for the WME links…
  • The maximum zoom for major roads is 17, otherwise they are invisible.
  • The maximum zoom for minor roads is 15, otherwise they are invisible.
  • The maximum zoom for major roads is 14…
  • Do not use zoom 13.
  • If we mix the types of roads, we must take the zoom of the most unfavorable type.

Good luck

Hi,
With the new WME update, there seems to be an issue with AC upon creating closures with events. The closure is created, but without an event linked to it.
Cheers,
Eddy

Advanced Closures 2023.08.22.01 is now available that fixes setting the MTE when creating a recurring closure.

There is a minor update to Advanced Closures (2023.09.17.01) that changes the date selector when setting a date range such that you only have to click the date – there is no “Apply” button to click. In addition, some changes were made to the script startup code to bring it up to date.