angular - angular 5-在google mpas api中定义语言
问题描述
我正在使用本教程将谷歌地图添加到我的 Angular 5 项目中: https ://blog.cloudboost.io/integrating-google-maps-in-angular-5-ca5f68009f29
而且我不会在地图上定义一种希伯来语。但我找不到在哪里设置它。
我尝试这样:
var mapProp = {
center: new google.maps.LatLng(32.084573, 34.802909),
zoom: 18,
language: "he",
mapTypeId: google.maps.MapTypeId.ROADMAP
};
但它不起作用。有人知道在哪里设置语言吗?
谢谢!
解决方案
您可以通过指向 api 的链接传递语言:
例如希伯来语:
<script
src="http://maps.google.com/maps/api/js?language=he&dir='rtl'"
type="text/javascript"></script>
正如@mxr7350 的评论中提到的,请参阅此链接以获取更多信息:https ://developers.google.com/maps/documentation/javascript/examples/map-language
对于希伯来语,您可能还需要通过&dir='rtl'
,因为文本从右到左而不是从左到右
推荐阅读
- javascript - React app web app 给出 404 错误和 Uncaught in Promise 错误
- java - 如何调整自定义日历的网格视图
- android - Android startForegroundService/startService 实际上并没有启动 Intent/Service?
- authentication - 在某些请求上出现 (401) UnAuthorized 错误,不是全部,而是大多数
- python - 如何在Python中Concat()具有1行的数据框和具有多行的数据框
- opencv - 边缘检测中边缘周围最亮的像素
- flutter - Flutter:用 for 循环说明字符串列表不起作用
- c# - C# 是否有一个“规则”,我可以在枚举上设置它中的每个项目都必须具有特定的属性
- embedded - STM32 Nucleo EEPROM 仿真器 ee_init 问题
- c - 我应该如何返回结构指针?