Page 1 of 2

Re: Help with WME API to add roundabout helping

Posted: Fri Nov 23, 2012 1:12 pm
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.

Re: Help with WME API to add roundabout helping

Posted: Wed Jul 31, 2013 7:23 pm
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

Re: Help with WME API to add roundabout helping

Posted: Wed Jul 31, 2013 7:02 pm
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

Re: Help with WME API to add roundabout helping

Posted: Wed Jul 31, 2013 7:41 pm
by beersh
Forget it It's working fine.
The landmark layer was turn off :mrgreen:

Re: Help with WME API to add roundabout helping

Posted: Sun Jan 06, 2013 5:40 pm
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.

Sv: Re: Help with WME API to add roundabout helping

Posted: Sun Jan 06, 2013 7:14 pm
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

Re: Help with WME API to add roundabout helping

Posted: Sun Jan 06, 2013 7:35 pm
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)

Re: Help with WME API to add roundabout helping

Posted: Mon Jan 07, 2013 11:54 am
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.

Re: Help with WME API to add roundabout helping

Posted: Mon Jan 07, 2013 12:04 pm
by Dennis_Halmstad
davipt wrote:
Dennis_Halmstad wrote:
dont work.
Updated with your suggestion. Try now ;)
It works on Chrome (native install) and Tampermonkey.

Re: Help with WME API to add roundabout helping

Posted: Fri Jun 03, 2022 1:12 pm
by DevlinDelFuego
update link?