[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 bz2012 » Sun Feb 19, 2017 6:21 pm

When WME Magic Wand is enabled, I get the following error message when I start WME:

www.waze.com says:
Unable to find appropriate control element, script is broken


However, the java console shows no error messages from Magic Wand.
WMEWAL: Initialized
VM23966:69 WME MagicWand init
VM23966:154 WME MagicWand: loading options
VM23934:135 WME LMAO: No alerts in view
VM23893:174


Puzzling.
State Manager, Louisiana
bz2012
Map Raider
Map Raider
 
Posts: 1595
Joined: Wed Nov 23, 2011 4:32 pm
Location: Baton Rouge, La
Has thanked: 1909 times
Been thanked: 310 times

Re: [Script] WME MagicWand

Postby aureozb » Wed Feb 22, 2017 9:02 am

DauserShenkt wrote:
wasd42 wrote:Hello, everyone!

Waze.map.getControlsByClass(/.*geometryediting.*/i) to find a ModifyFeature control

Any ideas where to find it? :)


WMECH old code with same control type
Code: Select all
// add current city in to drop-down list
function initCityList() {
  var locationInfo = Waze.map.getControlsByClass('Waze.Control.LocationInfo')[0];
  if (locationInfo === null || locationInfo.location === null)
    return;

  var cityName = locationInfo.location.city;
  var thisCity = null;
  for (var city in Waze.model.cities.objects) {
    var cityObj = Waze.model.cities.get(city);
    if (cityObj.name == cityName) {
      thisCity = cityObj.id;
      break;
    }
  }
  if (thisCity === null)
    return;


Latest WMECH latest code for same function
Code: Select all
// add current city in to drop-down list
function initCityList() {
  var thisCity = Waze.model.segments.topCityID;
  if (thisCity === null) return;
  var thisName = Waze.model.cities.get(thisCity).attributes.name;

  var selectCity = getId('_selectCity');
  var cityOption = document.createElement('option');
  var cityText = document.createTextNode(thisName);
  cityOption.appendChild(cityText);
  cityOption.setAttribute('value',thisCity);
  selectCity.appendChild(cityOption);
  console.info("WME Highlights: Init City list: " + thisName);


Hope this helps.


i don't understand, can you please be more specific ?

Many thanks in advance
aureozb
Beta tester
Beta tester
 
Posts: 91
Joined: Sat Dec 19, 2015 11:34 am
Location: Luanda, Angola
Has thanked: 106 times
Been thanked: 26 times

Re: [Script] WME MagicWand

Postby paulned » Sun Feb 26, 2017 11:08 am

Iridium1 wrote:Thanks fo the Update!

I am having an issue: Whenever I try to create a landmark by clicking on the map I get an error:
Cannot create landmark, need at least 3 points to create polygon

What do I do wrong?
FYI: Chrome 51.0.2704.84 (latest) is used.

EDIT: This happens using the default "Color Distance" mode, using "Human-Eye", the browser windows gets unresponsive.

Appreciate your help.


Same problem here. Any info to solve this?

Thanks
paulned
 
Posts: 10
Joined: Sun Apr 10, 2016 2:11 pm
Has thanked: 14 times
Been thanked: 1 time

Re: [Script] WME MagicWand

Postby wasd42 » Sun Mar 19, 2017 2:12 pm

Hey, everyone!
Sorry for the long response! I've fixed the script (rotate, resize options) AND finally introduced a proper concave hull algorithm, which means that now landmarks of any complex layout can be created automatically! Thanks, Andrii Heonia (http://stackoverflow.com/users/2561331/andriiheonia) for help!

Error "Cannot create landmark, need at least 3 points to create polygon" means that the script was unable to find enough pixels of the similar colour where you clicked to build a concave hull. Please, try some other point nearby. Also, it happens that the server stops responding to tiles request for some reason, so try to refresh the page.
Last edited by wasd42 on Mon Mar 20, 2017 2:05 pm, edited 1 time in total.
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 1:18 pm

Thanks for having this useful script in the portfolio again.

Two issues I am currently struggling with:
- For me I always get the "Please, try again, no useful points found" status when trying to pick a color.
- I cannot "toggle" back to the green status when clicking on the (activated) red button - only a reload of the page helps.


Can you please confirm or give me a hint what I'm doing wrong (Chrome is used btw.)?
[ 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: 623
Joined: Fri Mar 27, 2015 8:04 pm
Location: BY, Germany
Has thanked: 420 times
Been thanked: 409 times

Re: [Script] WME MagicWand

Postby wasd42 » Mon Mar 20, 2017 2:03 pm

Iridium1 wrote:- For me I always get the "Please, try again, no useful points found" status when trying to pick a color.
- I cannot "toggle" back to the green status when clicking on the (activated) red button - only a reload of the page helps.?


You are most welcome! :)

Both issues seem to be connected. As you are using Chrome, would you open the Developer Console (Options -> More tools -> Developer Tools), reload the Editor page, try to use Magic Wand and take a look whether any errors will appear in the console, 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 2:26 pm

Thanks for your quick reply.

Here's my console log (no other scripts or extensions are active)

VM12121:55 WME MagicWand init
VM12121:140 WME MagicWand: loading options

After approx. 2 secounds I get:

util.js:211 Google Maps API warning: NoApiKeys https://developers.google.com/maps/docu ... o-api-keys

XA.j @ util.js:211
(anonymous) @ js:136
(anonymous) @ js:53
(anonymous) @ js:50
(anonymous) @ js:53
(anonymous) @ js:109
(anonymous) @ js:50
(anonymous) @ js:109
(anonymous) @ js:50
(anonymous) @ js:109
(anonymous) @ js:50
(anonymous) @ js:109
Tc @ js:52
Sc.cb @ js:109
(anonymous) @ common.js:1


Now clicking the Magic Wand Button (button turns red) and trying to pick a color:

VM12121:770 WME MagicWand algorithm: sensitivity
VM12121:771 WME MagicWand sensitivity: 8
VM12121:772 WME MagicWand simplification: 3
VM12121:773 WME MagicWand landmark type: FOREST_GROVE
VM12121:774 WME MagicWand sampling mask size: 3


Button stays red, nothing more to click, no more output in the console, ony status shows "Please, try again, no useful points found".

I hope this helps.
[ 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: 623
Joined: Fri Mar 27, 2015 8:04 pm
Location: BY, Germany
Has thanked: 420 times
Been thanked: 409 times

Re: [Script] WME MagicWand

Postby wasd42 » Mon Mar 20, 2017 2:37 pm

Thanks, Iridium1! The bug should be fixed now, please update to version 2.0.2.
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 JustinS83 » Mon Mar 20, 2017 2:42 pm

Could you update the namespace in the header to point to your greasyfork? Currently it references a bad URL so you cannot click on the link in tampermonkey to load the greasyfork page.
Script Writing Community Coordinator
[ img ][ img ][ img ][ img ][ img ]
JustinS83
Waze Global Champs
Waze Global Champs
 
Posts: 1328
Joined: Wed Dec 03, 2014 4:33 am
Location: Franklin, OH
Has thanked: 338 times
Been thanked: 2346 times

Re: [Script] WME MagicWand

Postby Iridium1 » Mon Mar 20, 2017 3:02 pm

That was fast ;)

I tried it with 2.0.2, here are my findings:
- 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.
[ 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: 623
Joined: Fri Mar 27, 2015 8:04 pm
Location: BY, Germany
Has thanked: 420 times
Been thanked: 409 times

PreviousNext

Return to Addons, Extensions, and Scripts

Who is online

Users browsing this forum: No registered users