Skip to content

Commit

Permalink
Update to 5.4.3
Browse files Browse the repository at this point in the history
  • Loading branch information
bedo2991 committed Jul 26, 2023
1 parent 1942dcf commit ae1f8ce
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion header.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ==UserScript==
// @name Street Vector Layer
// @namespace wme-champs-it
// @version 5.4.2
// @version 5.4.3
// @description Adds a vector layer for drawing streets on the Waze Map editor
// @match https://www.waze.com/editor*
// @match https://beta.waze.com/editor*
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "svl",
"version": "5.4.2",
"version": "5.4.3",
"description": "Street Vector Layer (SVL)\r The Road layer for the Waze editors, made by editors.",
"main": "svl.user.js",
"watch": {
Expand Down
11 changes: 5 additions & 6 deletions svl.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -944,18 +944,16 @@
const address = segmentModel.getAddress();
const hasStreetName = segmentModel.hasNonEmptyStreet();
if (
attributes.primaryStreetID !== null &&
address.attributes.state === undefined
attributes.primaryStreetID !== null && !address.hasState()
) {
consoleDebug('Address not ready', address, attributes);
setTimeout(() => {
drawLabels(segmentModel, simplified, true);
}, 500);
} else {
const addressAttributes = address.attributes;
let streetPart = '';
if (hasStreetName) {
streetPart = addressAttributes.street.name;
streetPart = address.getStreetName();
} else if (attributes.roadType < 10 && !segmentModel.isInRoundabout()) {
streetPart = '⚑';
}
Expand All @@ -973,7 +971,7 @@
break;
}
const altStreet = W.model.streets.objects[streetID];
if (altStreet && altStreet.name !== addressAttributes.street.name) {
if (altStreet && altStreet.name !== streetPart) {
ANsShown += 1;
altStreetPart += altStreet.name ? `(${altStreet.name})` : '';
}
Expand Down Expand Up @@ -3962,6 +3960,7 @@
'Street Vector Layer',
SVL_VERSION,
`<b>${_('whats_new')}</b>
<br>- 5.4.3: Fixed missing streetnames on beta.
<br>- 5.4.2: Fixed ghosts segments when all segments get redrawn (when layer got toggled or because of zoom). Nodes are now drawn on new segments, too.
<br>- 5.4.0: Replaced deprecated tampermonkey includes with match. Support for the new WME script API.
<br>- 5.3.2: Bug fixes, rectoring for more performance.
Expand Down Expand Up @@ -4876,7 +4875,7 @@
console.error('SVL: could not find topCountry');
return;
}
const defaultLaneWidth = W.model.topCountry.defaultLaneWidthPerRoadType;
const defaultLaneWidth = W.model.topCountry?.defaultLaneWidthPerRoadType ?? W.model.topCountry.attributes.defaultLaneWidthPerRoadType;
if (defaultLaneWidth) {
Object.keys(defaultLaneWidth).forEach((e) => {
defaultSegmentWidthMeters[e] = defaultLaneWidth[e] / 50.0; //50: (width * 2) / 100
Expand Down

0 comments on commit ae1f8ce

Please sign in to comment.