简体   繁体   English

GMSMapview当前位置标记未来

[英]GMSMapview current location marker not coming

I have do lots of the thing not able to find the solution for this situation.In Google map my current location marker not coming only overlay of the ground was coming. 我已经做了很多事情,无法找到适合这种情况的解决方案。在Google地图中,我当前的位置标记不会只是地面的覆盖层即将到来。

I am using Google map SDK 1.13.0 . 我使用的是谷歌地图SDK 1.13.0。

    GMSMapView *mapView = [[GMSMapView alloc] init];
    mapView.tag = Tag_googleMapView;
    mapView.frame = CGRectMake(0.0, 0.0, view.frame.size.width,view.frame.size.height);
    mapView.delegate = self;
    mapView.indoorEnabled = YES;
    [mapView setMyLocationEnabled:YES];
    [mapView.settings setMyLocationButton:YES]; 

It looks like this. 看起来像这样。

在此输入图像描述

It not proper blue current location marker was not coming 它没有正确的蓝色当前位置标记未来

在此输入图像描述

I had this issue. 我有这个问题。 It was due to an issue with the Google Maps library not being properly included in the project through Cocoapods. 这是因为谷歌地图库的问题没有通过Cocoapods正确地包含在项目中。 If using Cocoapods, make sure that the COCOAPODS = 1 flag is set in your target under Build Settings > Preprocessor Macros. 如果使用Cocoapods,请确保在Build Settings> Preprocessor Macros下的目标中设置了COCOAPODS = 1标志。 I faced this issue because when including the dependency in a project with multiple targets, the flag is not automatically set in all targets unless the Pod is explicitly added to each target in the Podfile. 我遇到了这个问题,因为在包含多个目标的项目中包含依赖项时,除非将Pod显式添加到Podfile中的每个目标,否则不会在所有目标中自动设置该标志。 If you have multiple targets your Podfile should be something similar to: 如果你有多个目标,你的Podfile应该类似于:

def map_pod
    source 'https://github.com/CocoaPods/Specs.git'
    pod 'GoogleMaps'
end

target 'target_1_name' do
    map_pod
end

target 'target_2_name' do
    map_pod
end

I believe the location icon does not appear properly because without the compiler flag, the libraries required to render it are not properly linked. 我相信位置图标没有正确显示,因为没有编译器标志,呈现它所需的库没有正确链接。

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

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