简体   繁体   English

Google Maps iOS SDK,获取用户的当前位置

[英]Google Maps iOS SDK, Getting Current Location of user

I have used GoogleMapKit in order to show user's current location. 我已经使用GoogleMapKit来显示用户的当前位置。 According to my code http://pastie.org/10908950 its working fine but currently its showing blue dot for current location. 根据我的代码http://pastie.org/10908950,它的工作正常,但当前在当前位置显示蓝点。 What i need now to display current location with the pink icon as shown in the image as well as the image should be static in the centre of the map while it shows current location whenever a location is chosen from the list of the search engine. 我现在需要用粉色图标显示当前位置,如图所示,并且该图像在地图中心应该是静态的,而无论何时从搜索引擎列表中选择一个位置,它都将显示当前位置。 Just like in image below- 就像下面的图片一样-

[ [ image2 [2]

How to display that list of places in alphabetically order? 如何按字母顺序显示该地点列表? And if a place is selected from that list it catches the value and the pink location is shown above that place. 如果从该列表中选择一个位置,它将捕获该值,并且粉红色位置显示在该位置上方。

图片1 .

I know the query is lengthy but i know i can use some great help from here. 我知道查询时间很长,但我知道我可以在这里使用一些很大的帮助。 Thanks in advance. 提前致谢。

By using Google Maps SDK, solution can be achieved easily: 通过使用Google Maps SDK,可以轻松实现解决方案:

GMSMarker *marker = [[GMSMarker alloc] init];
marker = [GMSMarker markerWithPosition:position]; 
marker.icon = [GMSMarker markerImageWithColor:[UIColor blackColor]];
marker.icon = [UIImage imageNamed:@"house"];

You can change colour and image based on your requirement. 您可以根据需要更改颜色和图像。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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