Skip to content

Commit

Permalink
マーカーとテキストの間隔を調整 (#391)
Browse files Browse the repository at this point in the history
  • Loading branch information
naogify authored Jun 27, 2024
1 parent d170cd0 commit 1dba750
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
6 changes: 3 additions & 3 deletions src/lib/simplestyle-vector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,9 @@ class SimpleStyleVector {
'text-max-width': 12,
'text-offset': [
'case',
['==', 'small', ['get', 'marker-size']], ['literal', [0, 0.6]],
['==', 'large', ['get', 'marker-size']], ['literal', [0, 1.2]],
['literal', [0, 0.8]],
['==', 'small', ['get', 'marker-size']], ['literal', [0, 1]],
['==', 'large', ['get', 'marker-size']], ['literal', [0, 1.6]],
['literal', [0, 1.2]],
],
'text-allow-overlap': false,
},
Expand Down
13 changes: 3 additions & 10 deletions src/lib/simplestyle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,22 +230,15 @@ export class SimpleStyle {
'text-field': ['get', 'title'],
'text-font': ['Noto Sans Regular'],
'text-size': 12,
'text-anchor': 'top',
'text-max-width': 12,
'text-offset': [
'case',
['==', 'small', ['get', 'marker-size']], ['literal', [0, 0.6]],
['==', 'large', ['get', 'marker-size']], ['literal', [0, 1.2]],
['literal', [0, 0.8]],
],
'text-allow-overlap': true,
'icon-allow-overlap': true,
'text-variable-anchor': ['top', 'bottom', 'left', 'right'],
'text-radial-offset': [
'case',
['==', 'small', ['get', 'marker-size']], 0.6,
['==', 'large', ['get', 'marker-size']], 1.3,
0.8,
['==', 'small', ['get', 'marker-size']], 1,
['==', 'large', ['get', 'marker-size']], 1.6,
1.2,
],
},
});
Expand Down

0 comments on commit 1dba750

Please sign in to comment.