简体   繁体   中英

Set Current Location Title And Subtitle - Google Maps SDK IOS

I've been going about on the internet and have looked at the docs provided by google on trying to find something about this. Set Current Location Title And Subtitle?

What I'm specifically looking for is to set a title and subtitle for the current location "dot". So, when user taps on the dot/current location the title and subtitle appears.

It should work very similar along the lines with GMSMarker. I've been able to set a GMSMarker atop of the current location dot, but not really the same result. Here's my code if interested:

//Creating Marker For Current Location//

 GMSMarker *CurrentLocationMarker = [[GMSMarker alloc] init];

    CLLocation *CurrentLocationNote = GoogleMaps.myLocation;

CurrentLocationMarker.position = CLLocationCoordinate2DMake(CurrentLocationNote.coordinate.latitude, CurrentLocationNote.coordinate.longitude);
CurrentLocationMarker.title = @"Current Location";
CurrentLocationMarker.snippet = CurrentLocation;
CurrentLocationMarker.map = GoogleMaps;

只是一个示例应用程序,因此一团糟

您能做您当前正在做的事情,但是将标记的图标设置为透明图像吗?

As you have currently done, you can add a marker at your current location. Now for the second part of showing the full address, you can utilise the reversegeocode service that is available in google maps ios sdk and take the fields addressline1 and addressline2 from the firstresult in the response and append them to the snippet of this marker

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM