[New Page] Bookmarklets

Moderator: Unholy

Re: [New Page] Bookmarklets

Postby MGODLEW » Tue Oct 07, 2014 9:49 pm

I've tested and confirmed the script is working and have modified it to match the US standards in the Wiki. Wiki page updated.
[ img ]
Rank 6 US Champ, Beta Tester & iOS Beta Leader | Waze Wishlist | Improper Edits | iPhone 6: JB iOS 9.0.2 |
Area Managing: State of Pennsylvania
MGODLEW
EmeritusChamps
EmeritusChamps
 
Posts: 2006
Joined: Tue Dec 20, 2011 6:39 pm
Location: Pennsylvania
Has thanked: 779 times
Been thanked: 704 times

Re: [New Page] Bookmarklets

Postby brandonrossl » Thu Oct 23, 2014 6:25 pm

Is there a level-3-friendly version of the auto-lock? I can't seem to get it to work and it may be due to the fact that I'm only a level 3.

Thanks!
brandonrossl
 
Posts: 180
Joined: Thu Apr 10, 2014 11:39 pm
Location: VA, USA
Has thanked: 64 times
Been thanked: 11 times

Re: [New Page] Bookmarklets

Postby crazycaveman » Thu Oct 23, 2014 6:31 pm

brandonrossl wrote:Is there a level-3-friendly version of the auto-lock? I can't seem to get it to work and it may be due to the fact that I'm only a level 3.

Thanks!

Just make sure everything is 2 or lower and it should work for you. Just so you know, the version on the wiki is different from the one posted here and should work with any setup; the one posted here will work if you have toolbox installed (I'll update it in a bit)
[ img ][ img ] [ img ][ img ][ img ]
ARC: South Atlantic Region
crazycaveman
US Waze Champs
US Waze Champs
 
Posts: 830
Joined: Fri Sep 03, 2010 1:48 am
Location: Rock Hill, SC, USA
Has thanked: 352 times
Been thanked: 519 times

Re: [New Page] Bookmarklets

Postby brandonrossl » Thu Oct 23, 2014 6:40 pm

That's weird, I tried both.

I do have 64-bit Chrome installed, don't know if that makes a difference.
brandonrossl
 
Posts: 180
Joined: Thu Apr 10, 2014 11:39 pm
Location: VA, USA
Has thanked: 64 times
Been thanked: 11 times

Re: [New Page] Bookmarklets

Postby karlcr9911 » Fri Oct 24, 2014 3:57 am

brandonrossl wrote:That's weird, I tried both.

I do have 64-bit Chrome installed, don't know if that makes a difference.


You have to be zoomed in to a certain level in order for the script to run.


Sent from my iPhone using Tapatalk
Regional Coordinator - U.S. South Central
iOS Beta Leader / Alpha Tester | WME Beta Tester
[ img ][ img ][ img ][ img ][ img ][ img ]
SCR Wazeopedia
karlcr9911
Global Champ Mentor
Global Champ Mentor
 
Posts: 2392
Joined: Fri Aug 23, 2013 2:05 am
Location: North East Texas, USA
Has thanked: 571 times
Been thanked: 1529 times

Re: [New Page] Bookmarklets

Postby brandonrossl » Fri Oct 24, 2014 2:04 pm

brandonrossl
 
Posts: 180
Joined: Thu Apr 10, 2014 11:39 pm
Location: VA, USA
Has thanked: 64 times
Been thanked: 11 times

Re: [New Page] Bookmarklets

Postby crazycaveman » Mon Oct 27, 2014 4:25 pm

I have made a modified version of the min lock bookmarklet to set the locks to the lower of the user's rank or the set lock level for each segment.

Code: Select all
javascript:(function() {

  /* value used is -1 from rank visible in WME */
  /* fwy_lvl = 3 would appear locked at 4 in WME */
  /* can set locks to be null, which will use the auto-lock */
  var fwy_lvl = 3;
  var rmp_lvl = 3;
  var maj_lvl = 2;
  var min_lvl = 1;
  var pri_lvl = 1;
  var absolute = false;
  var count = 0;
  var thisUser = Waze.loginManager.user;
  if (thisUser === null) return;
  var usrRank = thisUser.normalizedLevel;
  var UpdateObject;
 
  if (typeof(require) !== "undefined") {
      UpdateObject = require("Waze/Action/UpdateObject");
  } else {
      UpdateObject = Waze.Action.UpdateObject;
  }
 
  if (fwy_lvl > (usrRank - 1)) fwy_lvl = usrRank - 1;
  if (rmp_lvl > (usrRank - 1)) rmp_lvl = usrRank - 1;
  if (maj_lvl > (usrRank - 1)) maj_lvl = usrRank - 1;
  if (min_lvl > (usrRank - 1)) min_lvl = usrRank - 1;
  if (pri_lvl > (usrRank - 1)) pri_lvl = usrRank - 1;
 
  function onScreen(obj) {
    if (obj.geometry) {
      return(W.map.getExtent().intersectsBounds(obj.geometry.getBounds()));
    }
    return(false);
  }
 
  Object.forEach(W.model.segments.objects, function(k, v) {
   if (count < 150 && onScreen(v) && v.isGeometryEditable()) {
     /* fwy */
      if (v.attributes.roadType == 3 && (v.attributes.lockRank < fwy_lvl || (absolute && v.attributes.lockRank != fwy_lvl))) {
   count++;
        W.model.actionManager.add(new UpdateObject(v, {lockRank: fwy_lvl}));
      }
      /* ramp */
      if (v.attributes.roadType == 4 && (v.attributes.lockRank < rmp_lvl || (absolute && v.attributes.lockRank != rmp_lvl))) {
        count++;
        W.model.actionManager.add(new UpdateObject(v, {lockRank: rmp_lvl}));
      }
      /* MH */
      if (v.attributes.roadType == 6 && (v.attributes.lockRank < maj_lvl || (absolute && v.attributes.lockRank != maj_lvl))) {
        count++;
        W.model.actionManager.add(new UpdateObject(v, {lockRank: maj_lvl}));
      }
      /* mH */
      if (v.attributes.roadType == 7 && (v.attributes.lockRank < min_lvl || (absolute && v.attributes.lockRank != min_lvl))) {
        count++;
        W.model.actionManager.add(new UpdateObject(v, {lockRank: min_lvl}));
      }
      /* primary */
      if (v.attributes.roadType == 2 && (v.attributes.lockRank < pri_lvl || (absolute && v.attributes.lockRank != pri_lvl))) {
        count++;
        W.model.actionManager.add(new UpdateObject(v, {lockRank: pri_lvl}));
      }
    }
  });
})();
[ img ][ img ] [ img ][ img ][ img ]
ARC: South Atlantic Region
crazycaveman
US Waze Champs
US Waze Champs
 
Posts: 830
Joined: Fri Sep 03, 2010 1:48 am
Location: Rock Hill, SC, USA
Has thanked: 352 times
Been thanked: 519 times

Re: [New Page] Bookmarklets

Postby kentsmith9 » Mon Oct 27, 2014 4:51 pm

Just curious, what did the script try to do if the user rank was below the lock level being attempted by the script?
USA: Now Idaho; previously California (Northern, SF/SJ)

[ img ][ img ][ img ][ img ][ img ][ img ]
PLEASE READ: Waze Map Editor (Start Here) | Editing Quick-start | Best Practices | Junctions
kentsmith9
Waze Global Champs
Waze Global Champs
 
Posts: 5683
Joined: Mon Apr 23, 2012 3:33 pm
Location: Boise ID and SF/SJ Bay Area of Northern California
Has thanked: 1577 times
Been thanked: 1791 times

Re: [New Page] Bookmarklets

Postby brandonrossl » Mon Oct 27, 2014 5:07 pm

For me, it simply failed and didn't do anything.
brandonrossl
 
Posts: 180
Joined: Thu Apr 10, 2014 11:39 pm
Location: VA, USA
Has thanked: 64 times
Been thanked: 11 times

Re: [New Page] Bookmarklets

Postby voludu2 » Mon Oct 27, 2014 5:34 pm

The remove all extraneous nodes bookmarklet is dangerous right now because of the ABBA reversing bug in WME. -- it is difficult to spot the reversed segments, even for higher-level editors.

And for lower-level editors editing in areas where major routes are unlocked -- this can really mess up waze navigation.
[ img ]
[ img ]
USA Northeast Region Discord Chat
State Manager - Pennsylvania
Country Manager - USA and Thailand
Wiki Master, Global Mentor
utilitas, simplicitas, retentionis
voludu2
Map Editor - Level 5
Map Editor - Level 5
 
Posts: 3069
Joined: Thu Jul 24, 2014 12:33 pm
Location: Chester County, Pennsylvania
Has thanked: 797 times
Been thanked: 1239 times

PreviousNext

Return to Wiki Updates and Discussion

Who is online

Users browsing this forum: No registered users