GeezerVison is showing github.com — 【fix】优化ol矢量瓦片沿线标注中文显示 · checkoss/iClient-JavaScript@e68d377
File tree
Expand file treeCollapse file tree
Open diff view settings
src/openlayers/overlay/vectortile
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: src/openlayers/overlay/vectortile/MapboxStyles.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -16,7 +16,7 @@ import Text from 'ol/style/Text'; |
16 | 16 | * <div style="padding: 20px;border: 1px solid #eee;border-left-width: 5px;border-radius: 3px;border-left-color: #ce4844;"> |
17 | 17 | * <p style="color: #ce4844">Notice</p> |
18 | 18 | * <p style="font-size: 13px">该功能依赖 <a href='https://github.com/boundlessgeo/ol-mapbox-style'>ol-mapbox-style</a> 插件,请确认引入该插件。</p> |
19 | | - * `<script type="text/javascript" src="https://rawgit.com/boundlessgeo/ol-mapbox-style/v2.11.2/dist/olms.js"></script>` |
| 19 | + * `<script type="text/javascript" src="https://rawgit.com/boundlessgeo/ol-mapbox-style/v2.11.2-1/dist/olms.js"></script>` |
20 | 20 | * </div> |
21 | 21 | * @category Visualization VectorTile |
22 | 22 | * @param {Object} options - 初始化参数。 |
|
Collapse file
Copy file name to clipboardExpand all lines: src/openlayers/overlay/vectortile/olExtends.js +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -141,6 +141,7 @@ export var olExtends = function(targetMap) { |
141 | 141 | maxAngle |
142 | 142 | ) { |
143 | 143 | var result = []; |
| 144 | + const originStartM = startM; |
144 | 145 |
|
145 | 146 | // Keep text upright |
146 | 147 | var anglereverse = Math.atan2( |
@@ -264,7 +265,7 @@ export var olExtends = function(targetMap) { |
264 | 265 | } else { |
265 | 266 | chunk = char; |
266 | 267 | chunkLength = charLength; |
267 | | - data = [x, y, charLength / 2, angle, chunk]; |
| 268 | + data = [x, y, charLength * originStartM, angle, chunk]; |
268 | 269 | if (reverse) { |
269 | 270 | result.unshift(data); |
270 | 271 | } else { |
|