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: 7357
Answers: 2
Answers: 2
Has thanked: 953 times
Been thanked: 2916 times

POSTER_ID:1445148

1

Send a message
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: 23627
Has thanked: 568 times
Been thanked: 3479 times
Send a message
Wiki Resources: Map Editing Manual | alanoftheberg@gmail.com
Oregon-based US Ex-Global Champ Editor | iPhone13Pro - 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: 5998
Has thanked: 101 times
Been thanked: 132 times
Send a message
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: 5998
Has thanked: 101 times
Been thanked: 132 times
Send a message
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
Send a message

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
Send a message

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
Send a message

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
Send a message

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
Send a message