Showing
1 changed file
with
8 additions
and
4 deletions
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2023-05-19 14:54:27 | 2 | * @Date: 2023-05-19 14:54:27 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2024-09-12 10:05:39 | 4 | + * @LastEditTime: 2024-09-12 10:30:25 |
| 5 | * @FilePath: /map-demo/src/views/index.vue | 5 | * @FilePath: /map-demo/src/views/index.vue |
| 6 | * @Description: 公众地图主体页面 | 6 | * @Description: 公众地图主体页面 |
| 7 | --> | 7 | --> |
| ... | @@ -438,6 +438,7 @@ export default { | ... | @@ -438,6 +438,7 @@ export default { |
| 438 | // let writing_mode = 'vertical'; // 文字方向 | 438 | // let writing_mode = 'vertical'; // 文字方向 |
| 439 | if (entity_info[i]?.writing_mode === 'vertical') { // 标题文字垂直 | 439 | if (entity_info[i]?.writing_mode === 'vertical') { // 标题文字垂直 |
| 440 | var textMarker = new AMap.Text({ | 440 | var textMarker = new AMap.Text({ |
| 441 | + zooms: [18, 20], // 点标记显示的层级范围,超过范围不显示。 | ||
| 441 | text: entity_info[i].name, //标记显示的文本内容 | 442 | text: entity_info[i].name, //标记显示的文本内容 |
| 442 | anchor: "center", //设置文本标记锚点位置 | 443 | anchor: "center", //设置文本标记锚点位置 |
| 443 | // draggable: true, //是否可拖拽 | 444 | // draggable: true, //是否可拖拽 |
| ... | @@ -445,18 +446,21 @@ export default { | ... | @@ -445,18 +446,21 @@ export default { |
| 445 | // angle: 10, //点标记的旋转角度 | 446 | // angle: 10, //点标记的旋转角度 |
| 446 | style: { | 447 | style: { |
| 447 | //设置文本样式,Object 同 css 样式表 | 448 | //设置文本样式,Object 同 css 样式表 |
| 448 | - // "padding": ".75rem 1.25rem", | 449 | + "padding": ".5rem .3rem .5rem .2rem", |
| 449 | // "margin-bottom": "1rem", | 450 | // "margin-bottom": "1rem", |
| 450 | // "border-radius": ".25rem", | 451 | // "border-radius": ".25rem", |
| 451 | "background-color": "#965f13", | 452 | "background-color": "#965f13", |
| 452 | "width": "1rem", | 453 | "width": "1rem", |
| 453 | - "border-width": 0, | 454 | + // "border-width": 0, |
| 454 | // "box-shadow": "0 2px 6px 0 rgba(114, 124, 245, .5)", | 455 | // "box-shadow": "0 2px 6px 0 rgba(114, 124, 245, .5)", |
| 455 | - "text-align": "center", | 456 | + // "text-align": "center", |
| 456 | "font-size": "0.8rem", | 457 | "font-size": "0.8rem", |
| 457 | "color": "white", | 458 | "color": "white", |
| 458 | "writing-mode": "vertical-rl", | 459 | "writing-mode": "vertical-rl", |
| 459 | "text-orientation": "mixed", | 460 | "text-orientation": "mixed", |
| 461 | + "display": "flex", | ||
| 462 | + "justify-content": "center", | ||
| 463 | + "align-items": "end", | ||
| 460 | }, | 464 | }, |
| 461 | position: entity_info[i].position, //点标记在地图上显示的位置 | 465 | position: entity_info[i].position, //点标记在地图上显示的位置 |
| 462 | }); | 466 | }); | ... | ... |
-
Please register or login to post a comment