Is it possible to write custom text on Google Maps API v3?

前端 未结 6 509
渐次进展
渐次进展 2020-11-30 01:15

Is it possible to write a custom text on Google Maps API v3 next to the marker, or I can use only the info window to do that?

6条回答
  •  清歌不尽
    2020-11-30 01:40

    By far the easiest way to add a Text Overlay is to use the MapLabel class from https://github.com/googlemaps/js-map-label

    var mapLabel = new MapLabel({
      text: 'Test',
      position: new google.maps.LatLng(50,50),
      map: map,
      fontSize: 20,
      align: 'right'
    });
    

提交回复
热议问题