javascript - How to use
in google map label's text:
问题描述
How can I use br
in google map label's text. I tried to use like below. But not worked out. Any specific way to use this? ??
var marker = new google.maps.Marker({
map: this.map,
icon: 'img/background.png',
label: {
text: "name: " + String(account.name) + "\ncity :" + String(account.city),
color: "#fff",
},
position: {
lat: parseFloat(account.lat),
lng: parseFloat(account.lng)
}
});
解决方案
\n
像这样使用
var marker = new google.maps.Marker({
position: myLatLng,
map: map,
title: 'Hello\nWorld!'
});
您可以在此处阅读有关 Google 地图标记的更多信息 简单标记
推荐阅读
- python - Scrapy如何在输出中添加“查询网址”作为项目
- socketcan - 向上/向下时的 SocketCAN 行为
- javascript - 未捕获的 ReferenceError:deleted1 未在 HTMLButtonElement.onclick 中定义
- shell - 使用 awk 删除重复的行,使其靠近另一个文件
- xmpp - 需要在 IOS 和 Android 的 ejabbered 16 版本的消息节中添加自定义参数
- asp.net-core - 在 .NET 5.0 中禁用特定枚举的 Swagger 枚举字符串转换
- powerpoint - PowerPointApi BETA 中的形状(仅限预览版)] API 不可用
- android - 无法在反应原生 android 应用程序中使用 rnFetchBlob 下载 fie
- selenium - 有没有办法在网页上的 Cypress 中发送或触发击键?
- javascript - wkt OpenLayers 的坐标