Skip to content

Commit

Permalink
fix style presentation
Browse files Browse the repository at this point in the history
  • Loading branch information
birm authored Feb 20, 2025
1 parent 44c2476 commit ceabcf6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion apps/port/xml2geo.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,11 @@ function xml2geo() {
maxY = Math.max(maxY, y);
coordinates.push([x, y]);
}

let isFill = false;
// **Detect Polygon vs. Polyline**
if (regionType === 'Polygon') {
coordinates.push(coordinates[0]); // Close the polygon by repeating the first point
isFill = true;
}

let boundRect = [[minX, minY], [minX, maxY], [maxX, maxY], [maxX, minY], [minX, minY]];
Expand All @@ -83,6 +84,10 @@ function xml2geo() {
'properties': {
'regionId': regionId,
'lineColor': hexColor,
'style':{
'color': hexColor,
'isFill': isFill,
},
'group': region.parentNode.getAttribute('Name') || 'Ungrouped',
},
'bound': {
Expand Down

0 comments on commit ceabcf6

Please sign in to comment.