【问题标题】:hi, is there a way to reduce my maps markers size, here is my code: [duplicate]嗨,有没有办法减少我的地图标记大小,这是我的代码:[重复]
【发布时间】:2020-03-17 07:33:41
【问题描述】:
showMap() {
        var src = 'https://github.com/Fireflymedia-github/firefly/blob/master/kml/Ligne'
        //var src = 'https://raw.githubusercontent.com/Fireflymedia-github/firefly/kml/Ligne';
        //  var src = 'https://raw.githubusercontent.com/amad1dia/my-pocket/firefly/kml-ff/Ligne';

        const location = { lat: 14, lng: -17 };
        var options = {
            center: location,
            zoom: 100,
        }

        const map = new google.maps.Map(this.mapRef.nativeElement, options);
        for (let index = 1; index < 45; index++) {
            this.addKmlLayer(map, src, index);
        }
        //this.addMarket(map, location);
    }

    addMarket(pos, map) {
        return new google.maps.Marker({
            position: pos,
            map: map,
        });
    }

    addKmlLayer(map, src, index) {
        return new google.maps.KmlLayer({
            //Dans le serveur les fichiers kml sont nommés du genre Ligne1AFTU.kmz
            url: src + index + 'AFTU.kmz?raw=true',
            map: map
        });
    }

【问题讨论】:

    标签: google-maps


    【解决方案1】:

    您可以通过向标记图标添加 scaledSize 或 size 属性来更改标记的大小。

    更多信息在这里:https://developers.google.com/maps/documentation/javascript/markers#complex_icons

    问候

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-06-17
      • 2014-02-25
      • 2016-04-16
      • 2011-11-23
      • 2021-09-24
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多