Skip to content

Commit e68d377

Browse files
committed
【fix】优化ol矢量瓦片沿线标注中文显示
1 parent 6d43576 commit e68d377

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/openlayers/overlay/vectortile/MapboxStyles.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import Text from 'ol/style/Text';
1616
* <div style="padding: 20px;border: 1px solid #eee;border-left-width: 5px;border-radius: 3px;border-left-color: #ce4844;">
1717
* <p style="color: #ce4844">Notice</p>
1818
* <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>`
2020
* </div>
2121
* @category Visualization VectorTile
2222
* @param {Object} options - 初始化参数。

src/openlayers/overlay/vectortile/olExtends.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ export var olExtends = function(targetMap) {
141141
maxAngle
142142
) {
143143
var result = [];
144+
const originStartM = startM;
144145

145146
// Keep text upright
146147
var anglereverse = Math.atan2(
@@ -264,7 +265,7 @@ export var olExtends = function(targetMap) {
264265
} else {
265266
chunk = char;
266267
chunkLength = charLength;
267-
data = [x, y, charLength / 2, angle, chunk];
268+
data = [x, y, charLength * originStartM, angle, chunk];
268269
if (reverse) {
269270
result.unshift(data);
270271
} else {

0 commit comments

Comments
 (0)