Why do the markers not appear?

前端 未结 2 1955
予麋鹿
予麋鹿 2021-01-25 04:15

What I have: A RecyclerView with images of Restaurants, Bars, etc, that when are clicked take you to a map

What I want: That when they be clicked take you to a map with

相关标签:
2条回答
  • 2021-01-25 04:56

    I don't see any Marker in your code, but just to try it, create and add a Marker like this and see if it is on your map

    MarkerOptions options = new MarkerOptions();
    options.position(latitude,longitude);options.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_RED));
    options.title("Restaurante");
    options.snippet("Burger King");
    mMap.addMarker(options);
    

    Edit

    Try to change this code

    MarkerOptions options = new MarkerOptions();   //options.position(LatLng);options.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_RED));
                options.title("Restaurante");
                options.snippet("Burger King");
                mMap.addMarker(options);
                markerOptions.position(latLng);
                markerOptions.title(placeName + " : " + vicinity);
                mMap.addMarker(markerOptions);//esto añade los marcadores
                markerOptions.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_RED));//aqui se le pone el color a los marcadores
    

    To this one

    MarkerOptions options = new MarkerOptions();
    options.position(latLng);
    options.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_RED));
    options.title(placeName + " : " + vicinity);
    mMap.addMarker(options);
    
    0 讨论(0)
  • 2021-01-25 05:09

    You should create the MarkerOption object like this:
    MarkerOptions myLocationMarker = new MarkerOptions().position(lat,long);

    0 讨论(0)
提交回复
热议问题