doubt about google maps bookmarks

1

I have a couple of bookmarks in my android application, which are displayed correctly, what I want to do is, get the title of a bookmark and open a snackbar with the information currently displayed by my bookmarks (point, title, snippet, icon), after searching a bit, I found the method gettitle (), but what I can not find is the syntax of how to use this method, if you could help me with documentation about the syntax of this or some similar example to what I want to do I would be very grateful

    
asked by zhet 08.12.2016 в 02:12
source

1 answer

0

When you create a Marker , you define a title:

 GoogleMap map = ... // get a map.
 // Add a marker at San Francisco.
 Marker marker = map.addMarker(new MarkerOptions()
     .position(new LatLng(37.7750, 122.4183))
     .title("San Francisco")
     .snippet("Population: 776733"));

That title can be obtained using the method getTitle () , this title can be stored in a variable and displayed in your SnackBar.

Obtaining the title can be done when you click the infoWindow (map is the instance of your Google Map):

 map.setOnInfoWindowClickListener(new OnInfoWindowClickListener(){
                @Override
                public void onInfoWindowClick(Marker marker){

                     Toast.makeText(getActivity(), "El titulo de este marcador es: " + marker.getTitle(), 
   Toast.LENGTH_LONG).show();                 

                }
            });
    
answered by 08.12.2016 / 16:36
source