gmsmapview

Crash while getting my location on GoogleMaps on iPhone

谁说我不能喝 提交于 2019-12-23 21:31:13
问题 I am writing you because I am stuck with a super strange error. I tried to add GMS on my app, and finally, when I have to get device location, I am stuck with this crash: Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'An instance 0x7ff7fd82def0 of class GMSMapView was deallocated while key value observers were still registered with it. Current observation info: ( Context: 0x0, Property: 0x7ff7fdc2f470> Code is initialized here: self.mapView

didChangeCameraPosition get bounding box/ rectangle of available coordinates

谁说我不能喝 提交于 2019-12-21 04:28:12
问题 How can I retrieve the GMSCoordinateBounds from a GMSCameraPosition? I want to know the visible coordinates on the map (at least Northeast/Southwest points) everytime the user moves the camera as in: (void)mapView:(GMSMapView *)mapView didChangeCameraPosition:(GMSCameraPosition *)position 回答1: GMSVisibleRegion visibleRegion = mapView.projection.visibleRegion; GMSCoordinateBounds *bounds = [[GMSCoordinateBounds alloc] initWithRegion:visibleRegion]; // we've got what we want, but here are NE

Google maps iOS sdk get tapped overlay coordinates

断了今生、忘了曾经 提交于 2019-12-19 09:09:13
问题 i'm working with Google maps iOS sdk. i want to get the coordinates of the touched point when user taps an overlay. there is this delegate method: - (void)mapView:(GMSMapView *)mapView didTapAtCoordinate:(CLLocationCoordinate2D)coordinate but it's not called when you tap an overlay or a marker. can i call it programmatically (but coordinate parameter is missing-that's what i want..)? or get location from this: - (void) mapView: (GMSMapView *) mapView didTapOverlay: (GMSOverlay *) overlay any

GMSMarker icon from center (iOS)

北城余情 提交于 2019-12-18 11:41:50
问题 I just switched from Apple Maps to Google Maps. An issue that I can't seem to find an answer to is how do you make the icon for a GMSMarker to start from the center rather then from the bottom of the image. An example of what I mean is the current location dot icon starts centered at the coordinates it is meant to express. However GMSMarkers icons start from the bottom of the icon. 回答1: You can change the start position of your marker icon with the property groundAnchor . Google Maps SDK for

How to create my own GMSMarker? (GoogleMaps, iOS) - Swift

浪子不回头ぞ 提交于 2019-12-12 15:02:04
问题 I would like to create my own markers because I need to track extra information about them (for example, date added, marker ID)... So I created another class, as follows: class myMarker: GMSMarker { var markerID: Int var addedDate: NSDate } But I don't know what do to next... should I create an "init" method to populate my markerId and addedDate? or I should override the GMSMarker constructor (which is not "init") It can be class myMarker: GMSMarker { var markerID: Int var addedDate: NSDate

Swift Google Maps does not delete polygons

醉酒当歌 提交于 2019-12-12 05:29:23
问题 I'm developing an app with Swift 3.0 and working with the Google Maps SDK. I arrived at the point that by clicking on the map I draw a polygon where at each vertex I add a marker. Like the image given below: What I want to do is when I move a marker. With the "didDrag" event, repaint the new polygon with the new markers' positions. But this happens: The code is: //Path Line and Polygon var pathLine = GMSMutablePath() //Create Line of Poligon var linePolygon = GMSPolyline() //All markers and

how to show different markerInfoWindow?

时光总嘲笑我的痴心妄想 提交于 2019-12-12 02:16:50
问题 i'm using GMS for ios. and i'm facing problem that i can't detect which marker did tapped!(Custom markerInfoWindow) you can see my code for custom markerInfoWindow : here i'm creating the markers : -(void)CreateMarks{ for (int l=0 ; l<self.NSMuatableArray.count; l++) { CLLocationCoordinate2D pos = CLLocationCoordinate2DMake([[[self.NSMuatableArray objectAtIndex:l] objectForKey:@"lati"] doubleValue],[[[self.NSMuatableArray objectAtIndex:l] objectForKey:@"longi"] doubleValue]); GMSMarker

Google Maps SDK crash on ItunesConnect test not Xcode

旧巷老猫 提交于 2019-12-12 01:16:51
问题 Google Maps SDK makes my app crash, I don't know what I'm doing wrong... I put my GMSMapView in a UIView in interface builder. Here is my code : Contact.h : #import <UIKit/UIKit.h> #import <MessageUI/MessageUI.h> #import <ParseFacebookUtils/PFFacebookUtils.h> #import <GoogleMaps/GoogleMaps.h> @interface Contact : UIViewController <MFMailComposeViewControllerDelegate> - (IBAction)openMail:(id)sender; @property (weak, nonatomic) IBOutlet GMSMapView *mapView; @property (weak, nonatomic) IBOutlet

add some button to GMSMapView (Google Map) and change the image button

拟墨画扇 提交于 2019-12-11 17:07:55
问题 I try but can't show the button Code: btnLokasiSaya = UIButton(frame: CGRect(x: 341, y: 28, width: 100, height: 30)) self.viewMap.addSubview(btnLokasiSaya) StoryBoard: Output: my button is not found in simulation 回答1: In your Main.Storyboard add button outside the mapview as shown below: 来源: https://stackoverflow.com/questions/52440728/add-some-button-to-gmsmapview-google-map-and-change-the-image-button

Random KVO block crashes when allocating mapView, happens only when open/close screen several times

早过忘川 提交于 2019-12-11 12:58:05
问题 App is crashing on a map screen when it open and close several times. (Mostly on 6th attempt) Class that inherits from GMSMapView class AirportMapView: GMSMapView , AirportMapViewProtocol{ weak var airportMapViewModuleDelegate: AirportMapViewModuleProtocol? required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) } override init(frame: CGRect) { super.init(frame: frame) } convenience init(from frame: CGRect, with cameraPosition: GMSCameraPosition) { self.init(frame: frame) self