google-maps-sdk-ios

Can I intercept marker deselect when I tap another marker in Google Maps SDK for iOS?

∥☆過路亽.° 提交于 2019-12-01 11:31:51
I know that I can use didTapAtCoordinate that will deselect the marker when I tap else where on the map. But If there are multiple marker and I tap another one (Ex. MarkerA -> MarkerB), Is there any call back when the previous marker DidDeselect?. I look around in GMSMapView the but can't find any thing I can use. I want to change the marker color or image when it being selected and change it back when another marker select or the marker deselect. Thank you. The doco for selectedMarker says: The marker that is selected. Setting this property selects a particular marker, showing an info window

I want to shake the google map marker in iOS Swift

跟風遠走 提交于 2019-12-01 10:32:13
I am working on a project where I wants to shake the marker on google Map. I am using the custom marker icon to represent on the map. Like a head of person is shaking. I don't know how to do it and search a lot but didn't find any solution. You can add a CAKeyframeAnimation or CABasicAnimation to your marker.iconView!.layer we add a UIView with a frame bigger than our UIImageView inside then we need to adjust the anchor point of your UIImageView to bottom in vertical and horizontally centered this will be the point that will work as pivot in our animation, our animation will be a rotation

How to load a KML file URL into Google Maps using iOS API?

為{幸葍}努か 提交于 2019-12-01 09:47:43
I've got Google Map embedded in a View Controller in a Map on an iPhone. I can create my map using: GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:39.93 longitude:-75.17 zoom:12]; mapView_ = [GMSMapView mapWithFrame:CGRectZero camera:camera]; // use GPS to determine location of self mapView_.myLocationEnabled = YES; mapView_.settings.myLocationButton = YES; mapView_.settings.compassButton = YES; Now, I want to add a kml file (from a URL) that displays a route. I would imagine there is something within GMSMapView to allow this either as a layer or something else, but I'm not

Can I intercept marker deselect when I tap another marker in Google Maps SDK for iOS?

江枫思渺然 提交于 2019-12-01 09:34:09
问题 I know that I can use didTapAtCoordinate that will deselect the marker when I tap else where on the map. But If there are multiple marker and I tap another one (Ex. MarkerA -> MarkerB), Is there any call back when the previous marker DidDeselect?. I look around in GMSMapView the but can't find any thing I can use. I want to change the marker color or image when it being selected and change it back when another marker select or the marker deselect. Thank you. 回答1: The doco for selectedMarker

Google Maps SDK iOS - prevent map from changing location on zoom

微笑、不失礼 提交于 2019-12-01 09:31:31
I have a problem that I can't solve for some time. I have a GMSMapView with imageView in front of it in the center. In result - I can drag map and always have centered pin. But problems come when I zoom the map. On zooming - position of map target changes and my imageView points to another location. I can detect if zoom changed, but I cant actually force GMSMapView to do ONLY zoom without any location changing. -(void) mapView:(GMSMapView *)mapView didChangeCameraPosition:(GMSCameraPosition *)position { if (mZoomLevel != mapView.camera.zoom) { mZoomLevel = mapView.camera.zoom; } } So basically

adding multiple pins on google map in ios

旧时模样 提交于 2019-12-01 09:30:14
I want to add multiple pins on a google map, while it is being loaded. I have a list of Latitude and Longitude values of nearby locations. How can I show all these locations on the map with a pin. I am using Google SDK for iOS. I am using the following code, but it didn't work for me. NSMutableArray *array = [NSMutableArray arrayWithObjects:@"12.981902,80.266333",@"12.982902,80.266363", nil]; CLLocationCoordinate2D pointsToUse[5]; for (int i = 0; i < [array Size]; i++) { pointsToUse[i] = CLLocationCoordinate2DMake([[[[array objectAtIndex:0] componentsSeparatedByString:@","] objectAtIndex:0]

How to load a KML file URL into Google Maps using iOS API?

好久不见. 提交于 2019-12-01 08:28:54
问题 I've got Google Map embedded in a View Controller in a Map on an iPhone. I can create my map using: GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:39.93 longitude:-75.17 zoom:12]; mapView_ = [GMSMapView mapWithFrame:CGRectZero camera:camera]; // use GPS to determine location of self mapView_.myLocationEnabled = YES; mapView_.settings.myLocationButton = YES; mapView_.settings.compassButton = YES; Now, I want to add a kml file (from a URL) that displays a route. I would

Google maps iOS sdk get tapped overlay coordinates

我只是一个虾纸丫 提交于 2019-12-01 06:22:07
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 suggestion's precious! thanks! UPDATE 6/2/15 Just staple a UITapGestureRecognizer onto the map and then

Very high memory and CPU usage when using Google Maps SDK for iOS

烈酒焚心 提交于 2019-12-01 04:50:46
问题 I am creating an app in which I have to show the registered users on the map. I have to display their profile pictures. There can be many of them, may be 1000, 2000, or 3000. The problem is, by adding every image, its memory usage increases and the app slows down. For example, I am using just this piece of code: UIImageView * imgView = imgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"like_r.png"]]; for(int i=0;i<1000;i++) { GMSMarker *marker = [[GMSMarker alloc] init];

GMSMapView animateToCameraPosition zoom in - zoom out animation

安稳与你 提交于 2019-12-01 03:34:05
问题 I am using Google maps services in iOS (Swift) and Android. In android, the map view has a method called animatreCamera that has an animation in which the movement has a "zoom out - zoom in" effect (if both cameras have the same zoom, the map view will zoom out the first part of the movement and then zoom in the second part). I want to achieve this effect with the GMSMapView in iOS, I have tried te following methods: animateToCameraPosition , animateToLocation , animateWithCameraUpdate ,