Android Google Maps API String inside the Marker Icon

前端 未结 3 1330
被撕碎了的回忆
被撕碎了的回忆 2021-01-21 08:46

Is there a way I can put a value of a String inside the Marker\'s icon on Google Maps API 2.0? Like this image

3条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-21 09:04

    You can use the Google Maps API Utility Library and customize you markers using bubble icons:

    IconGenerator iconFactory = new IconGenerator(this);
    
    MarkerOptions markerOptions = new MarkerOptions().
        icon(BitmapDescriptorFactory.fromBitmap(iconFactory.makeIcon("Your text"))).
        position(new LatLng(-33.8696, 151.2094)).
        anchor(iconFactory.getAnchorU(), iconFactory.getAnchorV());
    

提交回复
热议问题