Android - Google Maps Extensions - IllegalArgumentException

前端 未结 2 651
自闭症患者
自闭症患者 2021-01-14 03:22

I\'m getting an IllegalArgumentException when I call this createMarker() method:

private void createMarker(GoogleMap map, MarkerOptions options, OnMarkerCrea         


        
相关标签:
2条回答
  • 2021-01-14 04:08
    Caused by: java.lang.IllegalArgumentException: no position in marker options
    

    Apparently, your MarkerOptions does not have a position. Please call position() to supply the position in which to place the marker.

    0 讨论(0)
  • 2021-01-14 04:11

    It worked for me,

    MarkerOptions mMarkerOptions = new MarkerOptions();
    mMarkerOptions.position(new LatLng(lat, lang));
    mMarkerOptions.anchor(0.5f, 0.5f);
    
    0 讨论(0)
提交回复
热议问题