Help with WME API to add roundabout helping

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.

Moderators: Unholy, bextein

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

Postby Dennis_Halmstad » Sun Jan 06, 2013 7:14 pm

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
Joined: Fri Feb 18, 2011 7:10 am
Location: Sweden
Has thanked: 0 time
Been thanked: 2 times

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

Postby davipt » Sun Jan 06, 2013 7:22 pm

Dennis_Halmstad wrote: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.


No idea what is wrong, I have no idea about the inners of greasemonkey or that tamper monkey, just copied the top lines from other scripts and it worked.

Please give me a WME script that works with your Chrome/tampermonkey configuration so I can copy from it. I've noticed the latest color highlights does something different, but I can't see any difference from all the other ones, the street to river, extended tools, junction node fixed, select roundabout segments and livemap nav.
davipt
Waze Global Champs
Waze Global Champs
 
Posts: 2790
Joined: Tue Nov 02, 2010 8:51 am
Location: Oeiras, Portugal
Has thanked: 287 times
Been thanked: 604 times

Re: Help with WME API to add roundabout helping

Postby beersh » Wed Jul 31, 2013 7:41 pm

Forget it It's working fine.
The landmark layer was turn off :mrgreen:
beersh
 
Posts: 5987
Joined: Thu Mar 13, 2008 2:39 pm
Location: Israel
Has thanked: 224 times
Been thanked: 175 times

Re: Help with WME API to add roundabout helping

Postby AlanOfTheBerg » Wed Jul 31, 2013 7:23 pm

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
Waze Global Champs
Waze Global Champs
 
Posts: 23614
Joined: Sat Aug 28, 2010 8:48 pm
Location: US Country Manager - Oregon, USA
Has thanked: 1128 times
Been thanked: 4822 times

Re: Help with WME API to add roundabout helping

Postby beersh » Wed Jul 31, 2013 7:02 pm

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: 5987
Joined: Thu Mar 13, 2008 2:39 pm
Location: Israel
Has thanked: 224 times
Been thanked: 175 times

Re: Help with WME API to add roundabout helping

Postby Dennis_Halmstad » Mon Jan 07, 2013 12:04 pm

davipt wrote:
Dennis_Halmstad wrote:
davipt wrote:http://userscripts.org/scripts/show/152981


dont work.



Updated with your suggestion. Try now ;)

It works on Chrome (native install) and Tampermonkey.
Dennis_Halmstad
 
Posts: 148
Joined: Fri Feb 18, 2011 7:10 am
Location: Sweden
Has thanked: 0 time
Been thanked: 2 times

Re: Help with WME API to add roundabout helping

Postby davipt » Mon Jan 07, 2013 11:58 am

Dennis_Halmstad wrote:
davipt wrote:http://userscripts.org/scripts/show/152981


dont work.



Updated with your suggestion. Try now ;)
davipt
Waze Global Champs
Waze Global Champs
 
Posts: 2790
Joined: Tue Nov 02, 2010 8:51 am
Location: Oeiras, Portugal
Has thanked: 287 times
Been thanked: 604 times

Re: Help with WME API to add roundabout helping

Postby Dennis_Halmstad » Mon Jan 07, 2013 11:54 am

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
Joined: Fri Feb 18, 2011 7:10 am
Location: Sweden
Has thanked: 0 time
Been thanked: 2 times

Re: Help with WME API to add roundabout helping

Postby davipt » Mon Jan 07, 2013 11:19 am

Dennis_Halmstad wrote: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)


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
davipt
Waze Global Champs
Waze Global Champs
 
Posts: 2790
Joined: Tue Nov 02, 2010 8:51 am
Location: Oeiras, Portugal
Has thanked: 287 times
Been thanked: 604 times

Re: Help with WME API to add roundabout helping

Postby davipt » Mon Jan 07, 2013 12:13 am

Dennis_Halmstad wrote: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


Yeah that's the code I just saw on the Color Highlights script (but only on that one). Weird thing that all other scripts are using the old bootstrap code and nobody complained afaik. I'll update my script this week as soon as possible.
davipt
Waze Global Champs
Waze Global Champs
 
Posts: 2790
Joined: Tue Nov 02, 2010 8:51 am
Location: Oeiras, Portugal
Has thanked: 287 times
Been thanked: 604 times

Next

Return to Waze Map Editor

Who is online

Users browsing this forum: ArcherIXI, Yahoo [Bot]