Waze object references - WazeDev/WazeDev.github.io GitHub Wiki

The best method for exploring what is available to interact with WME is to open the console and explore the W object. What is expressed below will (likely) never be fully representative of what is available in the W object due to the complexity and the WME devs changing things as they need to for new feature development or bug fixes.

House Number Edit Mode Changed

W.editingMediator.on('change:editingHouseNumbers', callbackFunc)

In the callbackFunc you will need to detect if you are currently in HN edit mode, which you can do by checking this variable: W.editingMediator.attributes.editingHouseNumbers

Panned

W.map.events.register("moveend", null, callbackFunc)

This event will fire when the map has moved (whether via script or user interaction).

Road Types

Below is the list of the road types in Waze. These can be compared against by checking the roadType variable on the attributes object. Example: Assuming a segment is selected -

W.selectionManager.getSelectedFeatures()[0].model.attributes.roadType
1 street
2 primary street
3 freeway
4 ramp
5 walking trail
6 major hwy
7 minor hwy
8 offroad
9 walkway
10 ped boardwalk
11
12
13
14 ferry
15
16 stairway
17 private road
18 railroad
19 runway
20 parking lot road
21 service road
22 alley

Save Successful

W.model.actionManager.events.register("afterclearactions",null, callbackFunc)

When a save is successful the afterclearactions event will fire. There is no event fired when a save is unsuccessful.

Selection Changed

W.selectionManager.events.register('selectionchanged', this, callbackFunc);

In your callbackFunc you should check if you have any selected items before proceeding (assuming you are going to do something with a Place/Segment once it is selected) since this event fires when something is selected and when de-selected. You can check if you have anything selected with either W.selectionManager.hasSelectedFeatures() or W.selectionManager.getSelectedFeatures().length > 0.

Undo

W.model.actionManager.events.register("afterundoaction",null, callbackFunc) "afterundoaction" is triggered anytime the user uses the undo function either via the toolbar or the keyboard shortcut. At this time there is no way to detect when a redo is done.

Zoomed

W.map.events.register("zoomend", null, callbackFunc)

This event will fire when the map has zoomed in/out (whether via script or user interaction), which may need to be caught alongside detecting if they panned the map since it is possible to zoom without moving the map.