google-maps-sdk-ios

How can I intercept touches on a marker in Google Maps SDK for iOS?

妖精的绣舞 提交于 2019-12-12 11:09:07
问题 I am new to the Google Maps SDK for iOS. When a user clicks on a marker, instead of showing the default info window with a title and snippet, I would like to direct them somewhere else in my app (such as a modal view controller). I have searched through the header files and online and I can't seem to find anything relating to touch events on markers. Does anyone have suggestions or workarounds? 回答1: I believe what you want is to add the delegate and override the didTapMarker method /** *

iOS Google Maps SDK, Can't listen to GMSMarker tap event

烈酒焚心 提交于 2019-12-12 10:56:35
问题 I'm stuck with GoogleMaps SDK for iOS... I want to add some features when I tap on a GMSMarker on my Google Map, but it doesn't work. Is there something wrong? FirstController.h #import <UIKit/UIKit.h> #import <GoogleMaps/GoogleMaps.h> #import <CoreLocation/CoreLocation.h> #import "sqlite3.h" @interface FirstViewController : UIViewController <CLLocationManagerDelegate, GMSMapViewDelegate> { sqlite3 *db; } FirstController.m [...] -(void)locationManager:(CLLocationManager *)manager

Display multiple markers on the Google Map in Objective C

和自甴很熟 提交于 2019-12-12 09:22:28
问题 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

No such module 'GoogleMaps' found however it is installed

[亡魂溺海] 提交于 2019-12-12 08:25:11
问题 I have installed the 'GoogleMaps' pod using cocoa pods and the project was building correctly, however when I transferred my project to another device through iCloud (the projects directory is in iCloud) the GoogleMaps pod stopped working. I attempted to simply run pod install again however this mad no difference, the pod is clearly there and the pod install was successful. I am beyond confused. 回答1: First off try to clean the project by Command + Shift + Options + K If I'm not mistaken,

Zoom in the center of the screen - Google Maps iOS SDK Swift

拈花ヽ惹草 提交于 2019-12-12 05:58:48
问题 I am currently building an iOS app in swift. I put a GMSMapView inside one of my ViewControllers and I put a marker in the middle of the screen. The marker never moves. When I zoom or unzoom, the marker position changes and so does the address associated to the marker. I want to be able to zoom on the same exact position as it is done on the Uber app. I've read some of the answers on stackoverflow like this one : Google Maps Center while zooming but none of them worked. Is there a way to do

Moving GMSMarker by X Meters Deflects

我们两清 提交于 2019-12-12 02:54:31
问题 I'm working with Google Maps SDK for iOS. My project requires the ability of moving the current location marker by x meters along the pre-determined path drawn on to the map view. Therefore I've implemented the following method from this question(the answer by Koray Birand): func distance(distance: Double, AwayFromCoordinate origin: CLLocationCoordinate2D, WithBearing bearing: Double) -> CLLocationCoordinate2D { let earthRadius = 6372797.6 // in meters let radianDistance = distance /

mapView: didTapMarker isn't selecting a marker

北慕城南 提交于 2019-12-12 02:49:18
问题 I have a GMSMapView with a lot of markers, every marker represents one store of my client, every time the user approaches to one of the markers (to one of the stores) he gets a notification with the address of the store. I want that when the user taps on a notification (opens the app via notification) the marker will be presented on the map (already selected). Note: the marker is a property for every Store object, the UILocalNotification stores the Store object's identifier and that's how I

Moving Camera in Google Maps

妖精的绣舞 提交于 2019-12-12 02:44:35
问题 I am trying to move the camera in Google Maps to specified location (lat & long). Here's my code/function, this code is located in ViewController1 (which contains the view for mapView): func select_structure(lat: String, lon: String){ let camera = GMSCameraPosition.cameraWithLatitude(Double(lat)!, longitude: Double(lon)!, zoom: 6.0) mapView = GMSMapView.mapWithFrame(CGRect.zero, camera: camera) mapView.myLocationEnabled = true mapView.mapType = kGMSTypeSatellite mapView.camera = camera view =

Layering a table view and a google map view iOS Swift

大城市里の小女人 提交于 2019-12-11 19:24:12
问题 I'm trying to set up a map search using the google maps sdk in ios. So far, I have the autocompleted search working correctly and when I search, the results show up in a tableview. I want to be able to click on a cell in the table view and reveal the map, then show the table again when the user touches back into the search box. My strategy to do this is to layer the mapview and the table view in the same view Controller, and show/hide or push whichever view to the top. However, because the

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