Google maps Marker Label with multiple characters

前端 未结 7 1283
别那么骄傲
别那么骄傲 2020-11-27 14:48

I am trying to add a 4 character label (eg \'A123\') to a Google Maps marker which has a wide icon defined with a custom path.



        
7条回答
  •  难免孤独
    2020-11-27 15:14

    You can change easy marker label css without use any extra plugin.

    var marker = new google.maps.Marker({
            position: this.overlay_text,
            draggable: true,
            icon: '',
            label: {
              text: this.overlay_field_text,
              color: '#fff',
              fontSize: '20px',
              fontWeight: 'bold',
              fontFamily: 'custom-label'
            },
            map:map
          });
          marker.setMap(map);
    
    $("[style*='custom-label']").css({'text-shadow': '2px 2px #000'})
    

提交回复
热议问题