Make your voice heard! Take the Annual Editors Community Survey now! Dismiss
The place to get information and ask questions about everything to do with properly and successfully editing the Waze Map.

Use this forum for all general editing questions, and the sub-forums for specific types of Waze Map Editor features.

Post Reply

Help with WME API to add roundabout helping

Post by Timbones
It could be an interesting feature (thank you for your PM), but unfortunately I don't know how add new lines to the editor. So far, I've only hacked the lines that already exist on the map.

Twister's scripts are able to add boxes on top of the map, but I think that he's using a separate canvas on top of WME.

If you want to do it properly, have a look at the OpenLayers API - this is what WME uses to draw the road data.
Timbones
Coordinators
Coordinators
Posts: 7167
Answers: 2
Answers: 2
Has thanked: 892 times
Been thanked: 2740 times
Timbones(6) • UK Coordinator • Forum Moderator • Closure Monitor
Scripts: WME Colour HighlightsWME Route TesterWME Geometries

Post by AlanOfTheBerg
beersh wrote:It dosen't work for me on Chrome with Tampermonkey.
I must work with Tampermonkey since all the script's ignore the fact that the Israel map editor URL is http://www.waze.co.il/editor
Didn't those script monkeys put in the Israeli map editor URL? Geez. :shock:

:P
AlanOfTheBerg
EmeritusChamps
EmeritusChamps
Posts: 23624
Has thanked: 562 times
Been thanked: 3455 times
Wiki Resources: Map Editing Manual | alanoftheberg@gmail.com
Oregon-based US Country Manager | iPhone6 - VZ

Post by beersh
It dosen't work for me on Chrome with Tampermonkey.
I must work with Tampermonkey since all the script's ignore the fact that the Israel map editor URL is http://www.waze.co.il/editor
beersh
Posts: 5994
Has thanked: 101 times
Been thanked: 131 times
LG Nexus 5 - Waze latest beta - Android 6.0.1
retired Israel CM, Localization and Android Client expert

Post by beersh
Forget it It's working fine.
The landmark layer was turn off :mrgreen:
beersh
Posts: 5994
Has thanked: 101 times
Been thanked: 131 times
LG Nexus 5 - Waze latest beta - Android 6.0.1
retired Israel CM, Localization and Android Client expert

Post by Dennis_Halmstad
Its a gr8 start.

It seams that it dont work if u use tampermonkey in chrome.
Its the way this script get acces to WME that causes problems. Other scripts with unsafeWindow works.
Dennis_Halmstad
Posts: 148
Been thanked: 2 times

Post by Dennis_Halmstad
davipt wrote:
Dennis_Halmstad wrote:Its a gr8 start.

It seams that it dont work if u use tampermonkey in chrome.
Its the way this script get acces to WME that causes problems. Other scripts with unsafeWindow works.
I've just copied verbatim what the other scripts were doing. I don't use chrome (I hate a browser that consumes 300MB every other week of my limited disk space) but I'll have a look at it when I can. I've tested it without any tampermonkey extension, and it was working out of the box.
It works gr8 when installed directly into chrome. But tampermonkey gives the same functionality as greasmonkey with updates and other functionality. With tampermonkey its a hole lot easier to install scripts from userscripts.org.


Skickat från min GT-I9300 via Tapatalk 2
Dennis_Halmstad
Posts: 148
Been thanked: 2 times

Post by Dennis_Halmstad
if u use the code described here it works in greasmonkey(firefox), chrome (native) and tampermonkey (chrome) http://www.waze.com/wiki/index.php/Comm ... _and_Tools

the difference is that u need to use unsafeWindow before the partsu need to access from WME.

eg if u want to use selectionManager u can reach it via

Code: Select all

unsafeWindow.selectionManager
or

Code: Select all

var selectionManager = unsafeWindow.selectionManager
and u dont need to change ur code other than the starting code. (exept adding other vars with parts u need from wme, Waze, OpenLayers eg)
Dennis_Halmstad
Posts: 148
Been thanked: 2 times

Post by Dennis_Halmstad
davipt wrote:
Ok I've updated the bootstrap but had time only to test it on Firefox and greasemonkey, can you check if it works with Chrome now?

http://userscripts.org/scripts/show/152981
dont work.

try uppdating ra_init() to

Code: Select all

function ra_init() {
    Waze = unsafeWindow.Waze;
    wazeModel = unsafeWindow.wazeModel;
    OpenLayers = unsafeWindow.OpenLayers;
    selectionManager = unsafeWindow.selectionManager;
    selectionManager.events.register("selectionchanged", null, raSelectionChanged);
}
giving the code access to Waze, wazeModel and OpenLayers

Then it works in both native and tampermonkey on chrome.
Dennis_Halmstad
Posts: 148
Been thanked: 2 times

Post by Dennis_Halmstad
davipt wrote:
Dennis_Halmstad wrote:
dont work.
Updated with your suggestion. Try now ;)
It works on Chrome (native install) and Tampermonkey.
Dennis_Halmstad
Posts: 148
Been thanked: 2 times

Post by Timbones
Good work!

via mobile
Timbones
Coordinators
Coordinators
Posts: 7167
Answers: 2
Has thanked: 892 times
Been thanked: 2740 times
Timbones(6) • UK Coordinator • Forum Moderator • Closure Monitor
Scripts: WME Colour HighlightsWME Route TesterWME Geometries