GoogleMapsAPI:始终以短模式获取省名

carvr3hs  于 2021-09-29  发布在  Java
关注(0)|答案(0)|浏览(262)

对不起,我的英语不好。我使用了谷歌Map的api。有没有办法让省名始终处于短模式?
类似于:province name=“acre”short name=“ac”。
tks!
我的代码:

  1. var customStyled = [
  2. {
  3. featureType: "all",
  4. elementType: "labels",
  5. stylers: [
  6. { visibility: "off" }
  7. ]
  8. },
  9. {
  10. featureType: "administrative.province",
  11. elementType: "labels",
  12. stylers: [
  13. {
  14. visibility: "on"
  15. }
  16. ]
  17. },
  18. ];
  19. function initMap(data) {
  20. map = new google.maps.Map(document.getElementById("map"), {
  21. //center: new google.maps.LatLng(-13.6632305, -69.6410913),//Brasil
  22. zoom: 4.3,
  23. minZoom: 3,
  24. maxZoom: 7,
  25. streetViewControl: false,
  26. center: BRASIL,
  27. restriction: {
  28. latLngBounds: BRASIL_BOUNDS,
  29. strictBounds: false,
  30. },
  31. stylers: {
  32. color: "#7c0a02",
  33. visibility: "off",
  34. },
  35. });
  36. map.data.setStyle({
  37. fillColor: "red",
  38. strokeWeight: 1
  39. });
  40. map.set('styles', customStyled);

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题