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

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

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

var customStyled = [
        {
            featureType: "all",
            elementType: "labels",
            stylers: [
                { visibility: "off" }
            ]
        },
        {
            featureType: "administrative.province",
            elementType: "labels",
            stylers: [
                {
                    visibility: "on"
                }
            ]
        },
    ];

    function initMap(data) {
        map = new google.maps.Map(document.getElementById("map"), {
            //center: new google.maps.LatLng(-13.6632305, -69.6410913),//Brasil
            zoom: 4.3,
            minZoom: 3,
            maxZoom: 7,
            streetViewControl: false,

            center: BRASIL,
            restriction: {
                latLngBounds: BRASIL_BOUNDS,
                strictBounds: false,
            },

            stylers: {
                color: "#7c0a02",
                visibility: "off",
            },

        });
        map.data.setStyle({
            fillColor: "red",
            strokeWeight: 1
        });
        map.set('styles', customStyled);

暂无答案!

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

相关问题