Wazeopedia.png

Wazeopedia

USA

MobileDiff/83953

Talk:Bookmarklets

398 bytes added, 5 years ago
Set segment locks in area: Update script to only set as high as the user's level
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");
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) {
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++;
249
edits