This script is designed to automate and simplify the process of drawing features in the Waze Map Editor (WME):
Why was it created and what does it simplify?
In the Waze Map Editor, drawing long roads, winding paths, or large polygons (like forests, lakes, and residential areas) requires hundreds of repeated manual clicks to add geometry nodes.
* **Problem:** These repeated clicks are not only very time-consuming and tedious, but in the long run, they also cause fatigue and wrist pain for the editor.
* **Solution:** This script converts the process of “tedious clicking” into a “smooth and fluid mouse movement.” You only make the first drawing click and then move your mouse along the desired path; the script draws the road or polygon for you point by point!
How does it work?
The script accomplishes this by combining several smart mechanisms:
* **Simulation of standard map clicks:** After being turned on (via a shortcut or sidebar button), the script sends standard map engine (OpenLayers) click events precisely to the current coordinates of the mouse cursor on the map canvas at regular intervals (e.g., every 300ms, which is customizable by you).
* **Anti-Stacking:** The script checks the mouse position; if your mouse remains stationary (having moved less than 5 pixels), it will not click to prevent dozens of unnecessary points from stacking in one area.
* **Pause while panning:** If you drag/pan the map with the mouse to see the rest of the path, the script temporarily pauses clicking to prevent drawing an incorrect line.
* **Smart Auto-Off:** As soon as you finish drawing your road or polygon and double-click (changing the map selection), the script intelligently detects that the task is finished and automatically disables itself so it does not make extra clicks on the map.
This script was written with Gemini AI.