javascript - 当用户使用js或ts点击地图时,我们如何转换azure地图语言?
问题描述
我正在为 Angular 6 中的 azure 地图声明一个点击事件,所以如果在迪拜位置点击地图,我会得到阿拉伯文本,我想将其转换为英语。
这是我的代码:
mapClicked(e) {
console.log(e);
OrderOnlineComponent.searchURL.searchAddressReverse(atlas.service.Aborter.timeout(30000), e.position).then(results => {
let data = results.geojson.getFeatures();
console.log(data);
let content = '<div style="padding:10px">';
if (data.features.length > 0 && data.features[0].properties && data.features[0].properties.address && data.features[0].properties.address.freeformAddress) {
content += data.features[0].properties.address.freeformAddress;
} else {
content += 'No address for that location!';
}
content += '</div>';
//Set the popup options.
// console.log("content to display...:", data.features[0].properties.address.freeformAddress.split(','));
// this.setVal(data.features[0].properties.address.freeformAddress.split(','));
OrderOnlineComponent.popup.setOptions({
position: e.position,
content: content
});
OrderOnlineComponent.addressObserve.next(data.features[0].properties.address.freeformAddress.split(','));
//Open the popup.
OrderOnlineComponent.popup.open(OrderOnlineComponent.etAddMap);
// return (data.features[0].properties.address.freeformAddress);
});
}
这有什么帮助吗?
解决方案
推荐阅读
- vb.net - 如何摆脱数组中的图片?
- javascript - 用于可视化、操作和导出数据点的 JavaScript?
- java - 使用 PHP 将值从 Android Studio 发送到 mySQL 数据库
- javascript - 如何在点击后立即更改手风琴的图标
- html - 水平居中堆叠图像
- nginx - 如何以url显示的文件夹少于实际文件夹的方式配置nginx?
- docker - Dockerized Phoenix/Elixir App 拒绝所有 HTTP/socket 请求
- reactjs - 响应 onChange 函数。没有什么像事件一样通过?
- elixir - 使用 scrivener 在 phoenix 框架中删除表单请求后如何重定向回当前页面
- angular - Angular cli:引用散列脚本