android google map marker placing

前端 未结 4 1613
故里飘歌
故里飘歌 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:32

    Try this one:

    googleMap.addMarker(new MarkerOptions().position(
                    new LatLng(51.507351, -0.127758)).icon(
                    BitmapDescriptorFactory.fromBitmap(BitmapFactory
                            .decodeResource(getResources(),
                                    R.drawable.q_icon))).anchor(0.5f, 1f));
    googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(
        new LatLng(51.507351, -0.127758), 20));
    

提交回复
热议问题