[Script] WME MagicWand

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.

Moderators: Unholy, bextein, Glodenox, JustinS83

Forum rules
Discussion for the unofficial, community-developed addons, extensions and scripts built for the Waze Map Editor.

DO NOT START a new thread unless it is about a new idea. Keep discussion of existing tools within the main thread for that tool.

The official index of these tools is the Community Plugins, Extensions and Tools wiki page.

Re: [Script] WME MagicWand

Postby wasd42 » Mon Mar 20, 2017 3:51 pm

JustinS83 wrote:Could you update the namespace in the header to point to your greasyfork?


Unfortunately, updating namespace will break automatic upgrades for all those users who has Magic Wand installed, as far as I can see.

Iridium1 wrote:- The toggling of the button (red/green) is working now, unfortunatiely I still cannot pick any color (same message).
- Whe trying to use "Human Eye" for the algorithm and clicking on the map to pick a color the browser tab freezes.


Now that's strange... What options do you use, what layers do you have enabled and in which country are you trying to use the Magic Wand? Please, try these parameters:
* Color match algorithm: Color Distance
* Tolerance: 8
* Sampling mask size: 3

In regards of "Human Eye" algo, it is very complex and slow, maybe it would be better to remove it for the best in one of the future versions.
wasd42
Area Manager
Area Manager
 
Posts: 37
Joined: Sun Sep 09, 2012 6:19 pm
Location: Moscow, Russia
Has thanked: 13 times
Been thanked: 44 times

Re: [Script] WME MagicWand

Postby wasd42 » Mon Mar 20, 2017 3:56 pm

New version posted: 2.1
- NEW: Highly experimental support of Magic Wand on custom layers via Map Overlays browser extension (https://chrome.google.com/webstore/deta ... babdkfbbia). Please, do not use layers for editing the maps unless you comply with the terms of use specific to each layer provider.
wasd42
Area Manager
Area Manager
 
Posts: 37
Joined: Sun Sep 09, 2012 6:19 pm
Location: Moscow, Russia
Has thanked: 13 times
Been thanked: 44 times

Re: [Script] WME MagicWand

Postby Iridium1 » Mon Mar 20, 2017 4:25 pm

Some more Information:

- Parameters used as described.
- Editing in Germany
- Tried it with the Sat Image Layer only and even with Map Overlays, still no success.
[ img ]
[ img ]
AM - A, AIC, FDB, LL, KF, MN, OAL, WM
CM - Deutschland

Wiki Deutschland | Straßen und Orte benennen | Karte bearbeiten | Editorbedienung
Iridium1
Waze Global Champs
Waze Global Champs
 
Posts: 625
Joined: Fri Mar 27, 2015 8:04 pm
Location: BY, Germany
Has thanked: 421 times
Been thanked: 410 times

Re: [Script] WME MagicWand

Postby wasd42 » Mon Mar 20, 2017 6:41 pm

Iridium1 wrote:- Parameters used as described.
- Editing in Germany
- Tried it with the Sat Image Layer only and even with Map Overlays, still no success.

Cannot reproduce the case, everything works perfectly for me in Germany too.

I've updated the script to log some debug information to the console. Could you:
* update the script to 2.1.1,
* open the Developer Console,
* reload the Editor page,
* write "window.wme_magic_wand_debug = true",
* press Enter to set the variable,
* and try to use Magic Wand, please?

The script should log something like:
Code: Select all
WME MagicWand algorithm: LAB
WME MagicWand sensitivity: 6
WME MagicWand simplification: 3
WME MagicWand landmark type: PROFESSIONAL_AND_PUBLIC
WME MagicWand sampling mask size: 4
WME MagicWand concave hull detailing: 40
WME MagicWand: clicked pixel data [104, 101, 84, 255]
WME MagicWand: iterations done (should be way less than 1,000,000) 1167344
WME MagicWand: non-processed pixels left (should be 0) 0
WME MagicWand: pixels processed 171714
WME MagicWand: Found pixels (should be way more than 3) 5101


Can you post it here along with the link to the area you are trying to edit, please?
wasd42
Area Manager
Area Manager
 
Posts: 37
Joined: Sun Sep 09, 2012 6:19 pm
Location: Moscow, Russia
Has thanked: 13 times
Been thanked: 44 times

Re: [Script] WME MagicWand

Postby Iridium1 » Mon Mar 20, 2017 7:01 pm

I guess here comes the interesting Part for you:

WME MagicWand: clicked pixel data
Array[4]
0: undefined
1: undefined
2: undefined
3: undefined
length: 4
__proto__: Array[0]

Whatever I click, the pixed data shows undefined.

Here's the link to the area.

I tried the darker area to have a maximum contrast.
Iridium1
Waze Global Champs
Waze Global Champs
 
Posts: 625
Joined: Fri Mar 27, 2015 8:04 pm
Location: BY, Germany
Has thanked: 421 times
Been thanked: 410 times

Re: [Script] WME MagicWand

Postby SpeedDzel » Thu Mar 23, 2017 7:40 pm

Aaah... great to see the rotation tool is working again.
your work is very very very much appreciated.
bol'shoye spasibo!
:)
proud member of TEAM APAC (S.E.A.)!

Pinoy wazers... join the Pinoy waze community on [url=https:///NyNm6W]FB[/url] > Malaysia [url=https:///kYk4ys]FB[/url] > Indonesia [url=https:///ZEO0om]FB[/url] > Singapore [url=https:///viLwUz]FB[/url] > Thailand [url=https:///N3WSn1]FB[/url]
SpeedDzel
Coordinators
Coordinators
 
Posts: 1022
Joined: Sun Dec 18, 2011 11:33 am
Location: PH: Philippines (Q.C., Metro Manila)
Has thanked: 599 times
Been thanked: 362 times

Re: [Script] WME MagicWand

Postby bz2012 » Tue May 09, 2017 5:08 pm

Just spent close to an hour doing a 'binary search' to figure out which extension was killing ctrl-c, keeping me from using it to copy text from various windows in WME.

I see that is is a known characteristic of magic-wand. Documented in
https://www.waze.com/forum/search.php?k ... sf=msgonly

Might I suggest that it may be a good idea to change that default takeover of shortcut keys so that the common windows 'copy' shortcut is no longer preempted by Magic-Wand when it is installed?
Perhaps alt-c or ctrl-shift-c would be less 'intrusive' !

I strongly suggest that all script writers avoid preempting the most commonly used editing keystroke shortcuts (ctrl-c,ctrl-v, ctrl-x and ctrl-s .... and perhaps some others that slip my mind at this moment.)

I see that the 'code'
Code: Select all
   // Hotkeys
        registerKeyShortcut("WMEMagicWand_CloneLandmark", "Clone Landmark", cloneLandmark, {"C+c": "WMEMagicWand_CloneLandmark"});
        registerKeyShortcut("WMEMagicWand_OrthogonalizeLandmark", "Orthogonalize Landmark", Orthogonalize, {"C+x": "WMEMagicWand_OrthogonalizeLandmark"});
        registerKeyShortcut("WMEMagicWand_SimplifyLandmark", "Simplify Landmark", simplifySelectedLandmark, {"C+j": "WMEMagicWand_SimplifyLandmark"});
        registerKeyShortcut("WMEMagicWand_HighlightLandmark", "Highlight Landmarks", highlightLandmarks, {"C+k": "WMEMagicWand_HighlightLandmark"});

in the script seems to preempt ctrl-c and ctrl-x.

I do appreciate all the work that went into writing the script. I haven't had a chance to play with it, just installed it a few days ago with the intention of testing it, when time and opportunity presented itself and part of 'time' has been spent fighting and cursing the broken ctrl-c :)


Additional hint to anyone else having the problem: I just modified those lines by adding "//" at the beginning of them (effectively commenting out the registration of those shortcuts) and that 'fixed' the problem I have been fighting for days. :)
I can also now state that it takes close to an hour to do a binary search to narrow down the culprit when you have over 80 scripts installed. :)

PS: tried MagicWand a couple of times, After several times of being unable to find anything, something locks up WME and I have to kill the tab and restart. Maybe I broke something by adding the "//" to comment out those line. I'll give it another try when I have some spare time. For now, it is disabled in Tampermonkey.
Last edited by bz2012 on Tue May 09, 2017 7:14 pm, edited 3 times in total.
State Manager, Louisiana
bz2012
Map Raider
Map Raider
 
Posts: 1595
Joined: Wed Nov 23, 2011 4:32 pm
Location: Baton Rouge, La
Has thanked: 1912 times
Been thanked: 310 times

Re: [Script] WME MagicWand

Postby JustinS83 » Tue May 09, 2017 5:10 pm

bz2012 wrote:Just spent close to an hour doing a 'binary search' to figure out which extension was killing ctrl-c, keeping me from using it to copy text from various windows in WME.

I see that is is a known characteristic of magic-wand. Documented in
https://www.waze.com/forum/search.php?k ... sf=msgonly

Might I suggest that it may be a good idea to change that default takeover of shortcut keys so that the common windows 'copy' shortcut is no longer preempted by Magic-Wand when it is installed?
Perhaps alt-c or ctrl-shift-c would be less 'intrusive' !

I strongly suggest that all script writers avoid preempting the most commonly used editing keystroke shortcuts (ctrl-c,ctrl-v, ctrl-x and ctrl-s .... and perhaps some others that slip my mind at this moment.)

I see that the 'code'
Code: Select all
   // Hotkeys
        registerKeyShortcut("WMEMagicWand_CloneLandmark", "Clone Landmark", cloneLandmark, {"C+c": "WMEMagicWand_CloneLandmark"});
        registerKeyShortcut("WMEMagicWand_OrthogonalizeLandmark", "Orthogonalize Landmark", Orthogonalize, {"C+x": "WMEMagicWand_OrthogonalizeLandmark"});
        registerKeyShortcut("WMEMagicWand_SimplifyLandmark", "Simplify Landmark", simplifySelectedLandmark, {"C+j": "WMEMagicWand_SimplifyLandmark"});
        registerKeyShortcut("WMEMagicWand_HighlightLandmark", "Highlight Landmarks", highlightLandmarks, {"C+k": "WMEMagicWand_HighlightLandmark"});

in the script seems to preempt ctrl-c and ctrl-x.

I do appreciate all the work that went into writing the script. I haven't had a chance to play with it, just installed it a few days ago with the intention of testing it, when time and opportunity presented itself and part of 'time' has been spent fighting and cursing the broken ctrl-c :)


You should have said something in chat, I already went through the pain to find the script that does this and kill the keybinding.

Agreed - no script should bind to ctrl-c/x/z/y
Script Writing Community Coordinator
[ img ][ img ][ img ][ img ][ img ]
JustinS83
Waze Global Champs
Waze Global Champs
 
Posts: 1329
Joined: Wed Dec 03, 2014 4:33 am
Location: Franklin, OH
Has thanked: 339 times
Been thanked: 2350 times

Re: [Script] WME MagicWand

Postby JustinS83 » Mon Nov 13, 2017 3:49 pm

I made a few tweaks to this script. Hopefully the author will come back and consider implementing them :)

https://pastebin.com/EA7PsA3n

Fixes the label names when a Place is selected
Changing the checkbox options in the sidebar with a select Place now immediately updates the Place geometry rather than necessitating deselecting and reselecting the Place.
Script Writing Community Coordinator
[ img ][ img ][ img ][ img ][ img ]
JustinS83
Waze Global Champs
Waze Global Champs
 
Posts: 1329
Joined: Wed Dec 03, 2014 4:33 am
Location: Franklin, OH
Has thanked: 339 times
Been thanked: 2350 times

[Script] WME MagicWand

Postby WazingArch » Thu Dec 07, 2017 8:51 am

Hello, I am using this script mainly to geometrically edit places - simplify, ortogonize and rotate places.

It seems that the rotation tool doesn't work any more. Also I noticed that when the script is enabled it disables Toolbox feature "Select in area place or map comment".
Last edited by WazingArch on Thu Dec 07, 2017 2:30 pm, edited 1 time in total.
Coordinator: BG • Global Champ • Translator
[ img ]
Уики България | Best map editing practice
WazingArch
Coordinators
Coordinators
 
Posts: 475
Joined: Thu May 24, 2012 6:02 am
Location: Bulgaria
Has thanked: 231 times
Been thanked: 107 times

PreviousNext

Return to Addons, Extensions, and Scripts

Who is online

Users browsing this forum: No registered users