google-maps-sdk-ios

fixed marker on center of google map ios sdk

自古美人都是妖i 提交于 2019-12-08 04:24:22
问题 I want to fix the marker in the center of the map irrespective of the location coordinates. If the user moves the camera on map I want it to keep showing up in the center without any flickering in marker and new location on that marker shows,If it is possible then How can I do that? Please help out. Thanks i am using iOS google map sdk(objective-c) 回答1: GMSCameraPosition *lastCameraPosition; - (void)mapView:(GMSMapView *)pMapView didChangeCameraPosition:(GMSCameraPosition *)position { /* move

How to update Google Maps marker position in swift/iOS

…衆ロ難τιáo~ 提交于 2019-12-08 02:43:26
问题 I would like to have multiple markers and update their position, based on new data from server. This is how I show marker on map (basic stuff): func showMarkerOnMap() { mapView.clear() //<- That's GMSMapView for all in dataFromServer { let lat5 = all.latitude let lon5 = all.longitude let position = CLLocationCoordinate2DMake(lat5, lon5) let marker = GMSMarker(position: position) marker.flat = true marker.map = self.mapView } } This is how I get dataFromServer using Alamofire: var

Cocoa Pods and Google Maps SDK

泄露秘密 提交于 2019-12-08 02:15:30
问题 When using CocoaPods to get the Google Maps SDK for iOS, I'm having troubles importing the sdk header file ( #import <GoogleMaps/GoogleMaps.h> ). I'm new to CocoaPods but I think I have everything working fine with the other libraries that I use (RestKit, AFNetworking...). For these APIs I still need to import the lib like this #import <AFNetworking/AFNetworking.h> instead of just #import "AFNetworking" . But it works fine. For Google Maps SDK I need to import it like this #import <Google

How to change default camera behavior when marker is tapped?

人走茶凉 提交于 2019-12-07 15:44:18
问题 In release 1.2 of the Google Maps for iOS SDK the default behavior of a tapped marker changed. The release note says: "The default behavior when a marker is tapped has been updated to also pan the camera to the marker's position" How can I get the old behavior back, i.e. not panning the camera center to the position of the marker? 回答1: Add the following method to your GMSMapView delegate implementation. GMSMapView will no longer center on the selected marker and brings back the existing

Cant interact with custom infowindow in google map

不羁岁月 提交于 2019-12-07 11:59:32
I have a google map and I've created a custom info window for my markers. I've put a couple buttons on the window, but I can't interact with them for the life of me. Here is my custom view: class MarkerWindowView: UIView, UIGestureRecognizerDelegate { //@IBOutlet weak var thumbNail: UIImageView! @IBOutlet weak var userName: UILabel! @IBOutlet weak var videoLocation: UILabel! @IBOutlet weak var tags: UILabel! override func awakeFromNib() { println("awake From Nib") self.userInteractionEnabled = true print(self.userInteractionEnabled) /*let recognizer = UITapGestureRecognizer(target: self,

Search Bar disappears after tap on it

五迷三道 提交于 2019-12-07 10:56:04
问题 Am trying to implement search nearby places using google maps. The below is the code what I have done so far override func viewDidLoad() { super.viewDidLoad() //Adding Mapview mapView = GMSMapView(frame: CGRectMake(0, 120, self.view.bounds.width, self.view.bounds.height - 120)) self.view.addSubview(mapView) mapView.mapType = kGMSTypeNormal locationManager.delegate = self locationManager.requestWhenInUseAuthorization() let resultTableView = UITableView(frame: CGRectMake(10, 100, 300, 60)) self

Error use unresolved identifier GMSPlacePickerConfig & GooglePlacePicker? (Google Places 2.0)

ぐ巨炮叔叔 提交于 2019-12-07 08:35:44
问题 Error use unresolved identifier GMSPlacePickerConfig & GooglePlacePicker? (Google Places 2.0) import GoogleMaps import GooglePlaces are already declared on top. Here 回答1: Now, google has broken it into multiple frameworks. You need to add a new pod 'GooglePlacePicker'. 回答2: I don't see any error on your code based on this sample code. If you are using cocoapod , you need to add pod 'GooglePlaces'. Error Use of unresolved identifier usually occurs when your new class has a different Target(s)

GMSMarker not showing in 1.3

旧时模样 提交于 2019-12-07 07:40:01
问题 I updated my app to use Google Maps iOS SDK 1.3. Everything seems to work except for the GMSMarkers. They either don't appear or appear with the wrong image. They still respond to touches and can be moved, but are otherwise invisible or corrupt. Here is the code for adding GMSMarkers: playerAnnotation = [[CustomPlayerAnnotation markerWithPosition:coord] retain]; [playerAnnotation setType:ANNOTATION_PLAYER]; [playerAnnotation setIcon:[UIImage imageNamed:@"Icon-72.png"]]; [playerAnnotation

How to detect that a point is inside a Polygon using Google Maps SDK for iOS?

百般思念 提交于 2019-12-07 06:32:01
问题 With the Googlemaps SDK for iOS, is it possible to detect that a point is inside a Polygon ? I found containsLocation() function in Google Maps JavaScript API, however, I couldn't find the same one in the iOS SDK. Do you know any other ways? 回答1: The Google Maps SDK for iOS now contains a function called GMSGeometryContainsLocation , which will help you out with a single line of code. if (GMSGeometryContainsLocation(yourPoint, pathOfPolygon, YES)) { NSLog(@"YES: you are in this polygon."); }

GMSTileURLConstructor Returns Strange Data for Zoom

我怕爱的太早我们不能终老 提交于 2019-12-07 02:50:15
问题 I am trying to draw a custom overlay on Google Maps for iOS using GMSTileURLConstructor . I am using the following code to get my URL GMSTileURLConstructor urls = ^(NSUInteger x, NSUInteger y, NSUInteger zoom) { NSString *url = @""; for (NSDictionary *limits in [selectedPropertyMap objectForKey:@"property_map_zoom_levels"]) { int zoomLevel = [[limits objectForKey:@"level"] intValue]; int tileMinX = 0; int tileMaxX = 0; int tileMinY = 0; int tileMaxY = 0; if ([limits objectForKey:@"tile_min_x"