我要声明角度为6的天蓝色地图的点击事件,因此,如果在迪拜位置单击地图,我会得到阿拉伯文字,我想将其转换为英语。
这是我的代码:
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);
});
}
有什么帮助吗?