google-maps-sdk-ios

How to change myLocationButton position from a GMSMapView?

烈酒焚心 提交于 2019-12-05 11:45:28
Anybody know how to get the instance of the myLocationButton from a GMSMapView instance? Or a way to change the default position? I just need to move it some pixels up. According the the issue tracker for this Issue 5864: Bug: GMSMapView Padding appears not to work with AutoLayout there is an easier workaround: - (void)viewDidAppear:(BOOL)animated { // This padding will be observed by the mapView _mapView.padding = UIEdgeInsetsMake(64, 0, 64, 0); } Raspu's solution moves the whole GMSUISettingsView including the compass. I found a solution to move only the Location Button: for (UIView *object

Adding a subview like UISlider or UIButtom in Google Maps in iPhone

喜欢而已 提交于 2019-12-05 11:28:37
I am new to iOS Programming and have very little knowledge about COCOA Touch. I am trying to add a button on the screen at the bottom over Google maps for giving an option to the user to go back to the previous screen. I just know that UIButton is a subclass of UIView and we can make button appear on a view by making it the sub view of that class. Previously iOS used to use Google Maps by default by in MKMapView and I have seen examples in books an on the Internet showing screen shots of apps where a button or a text box would appear on the map. But now just dragging the button in the

GMSTileURLConstructor Returns Strange Data for Zoom

半世苍凉 提交于 2019-12-05 07:43:53
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"] != (id)[NSNull null]) { tileMinX = [[limits objectForKey:@"tile_min_x"] intValue]; } if ([limits

How to customize the InfoWindow of google map iOS SDK?

心不动则不痛 提交于 2019-12-05 07:29:11
问题 I want to change the width of the InfoWindow of google map iOS SDK. Is there anyway to do? The reason I want to do it is to show the full address in the InfoWindow. Is there any other way to do so instead of customizing the InfoWindow? Also, can I change the text size in the InfoWindow? At least, I would like to achieve the effect like this map: http://www.google.com/about/company/facts/locations/ where hyperlink can be applied as well. 回答1: Set the map delegate to the view controller, then

How to implement GMSMarker drag drop on GMSMapView?

安稳与你 提交于 2019-12-05 03:53:50
I set the marker on google map but when i drag it's all of map are drag. I want drag marker when click and drag on it's and drag map when click and drag outside marker. this is my code self.camera = [GMSCameraPosition cameraWithLatitude:-33.86 longitude:151.20 zoom:6 bearing:0 viewingAngle:0]; self.Map = [GMSMapView mapWithFrame:self.MapView.bounds camera:self.camera]; self.Map.myLocationEnabled = YES; self.Map.delegate = self; GMSMarker *marker = [[GMSMarker alloc] init]; marker.position = self.camera.target; marker.draggable = YES; marker.title = @"Sydney"; marker.snippet = @"Australia";

Use of Unresolved Identifier 'GMSServices'

孤人 提交于 2019-12-05 00:28:44
I am using Xcode 7.1 and the deployment target is iOS 9.1. The app is "AreaCalculator" and it was written in Swift. I did following to set up the framework and import the map: $ sudo gem install cocoapods under "AreaCalculator" $ touch Podfile in Podfile I put: source 'https://github.com/CocoaPods/Specs.git' platform :ios, '9.1' pod 'GoogleMaps' $ pod install in the terminal: [!] Unable to load a specification for the plugin /Library/Ruby/Gems/2.0.0/gems/cocoapods-try-release-fix-0.1.2 Updating local specs repositories Analyzing dependencies Downloading dependencies Installing GoogleMaps (1.10

Drag/pan gestures on a GMSMapView not getting captured after update to SDK 1.3.1

試著忘記壹切 提交于 2019-12-05 00:23:00
问题 I'm having a strange problem with capturing drag/pan gestures on a GMSMapView through a Gesture Recognizer. This problem surfaced only after updating from GMS 1.2 to 1.3.1, where (quoting the documentation), Touches are consumed more agressively by GMSMapView I have a UIViewController holding a GMSMapView under its main view. I found GMSMapDelegate does not provide methods for handling drag/pan gestures, so I added a UIPanGestureRecognizer to the UIViewController, linked it to an IBAction

How to draw a proper polylines on google maps [closed]

北城余情 提交于 2019-12-04 22:06:23
Closed. This question is off-topic . It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 months ago . I have successfully drawn a polyline from point a to point b, but for some reason , it shows linear line not the correct waypoints Here's the code let path = GMSMutablePath() path.addLatitude(3.1970044, longitude:101.7389365) path.addLatitude(3.2058354, longitude:101.729536) let polyline = GMSPolyline(path: path) polyline.strokeWidth = 5.0 polyline.geodesic = true polyline.map = mapView I was expecting that it

Google Maps API: Getting coordinates of current location iOS

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-04 20:16:06
问题 I am currently working with Google Maps API in my project. I am trying to set the default camera/zoom to the users location. I do this: @implementation ViewController{ GMSMapView *mapView_; } @synthesize currentLatitude,currentLongitude; - (void)viewDidLoad { [super viewDidLoad]; mapView_.settings.myLocationButton = YES; mapView_.myLocationEnabled = YES; } - (void)loadView{ CLLocation *myLocation = mapView_.myLocation; GMSMarker *marker = [[GMSMarker alloc] init]; marker.position =

Display multiple markers on the Google Map in Objective C

≡放荡痞女 提交于 2019-12-04 18:53:31
How can I display multiple markers on the Google Map in iOS? I used the following approach, but it didn't work. for (int i = 0; i < [array count]; i++) { pointsToUse[i] = CLLocationCoordinate2DMake([[[[array objectAtIndex:0] componentsSeparatedByString:@","] objectAtIndex:0] floatValue],[[[[array objectAtIndex:0] componentsSeparatedByString:@","] objectAtIndex:1] floatValue]); [_map animateToLocation:pointsToUse[i]]; GMSMarkerOptions *options = [[GMSMarkerOptions alloc] init]; options.position = pointsToUse[i]; [_map animateToLocation:pointsToUse[i]]; [_map addMarkerWithOptions:options]; } You