android google map marker placing

前端 未结 4 1596
故里飘歌
故里飘歌 2021-02-06 00:40

In my Android application I need to place marker at exact position on map. I pin a marker on map with 51.507351, -0.127758 (London) location. I used the following code to do the

4条回答
  •  别那么骄傲
    2021-02-06 01:13

    Try this,

    private GoogleMap mMap;
    
    mMap = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap();
    
    mMap.addMarker(new MarkerOptions()
        .position(new LatLng(0, 0))
        .title("Hello world")
    .icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_AZURE)));
    

提交回复
热议问题