GithubHelp home page GithubHelp logo

googlemaps-samples / maps-sdk-for-ios-samples Goto Github PK

View Code? Open in Web Editor NEW
285.0 31.0 160.0 2.5 MB

Samples for the Google Maps and Places SDKs for iOS

Home Page: https://developers.google.com/maps/documentation/ios-sdk/

License: Apache License 2.0

Objective-C 59.60% Ruby 0.17% Swift 39.74% C 0.42% Shell 0.06%
maps-sdk objective-c swift samples ios-sample places-sdk google-maps google-places

maps-sdk-for-ios-samples's Introduction

GitHub contributors Apache-2.0

Google Maps SDK for iOS, Google Places SDK for iOS, and Google Navigation SDK for iOS sample code

This repository contains sample code for use with the Google Maps SDK for iOS, Google Places SDK for iOS and Google Navigation SDK for iOS.

GoogleMaps

The GoogleMaps and GoogleMaps-Swift sub-directory contains the sample code that is downloaded when you run pod try GoogleMaps. To use this project:

$ cd GoogleMaps
$ pod install
$ open GoogleMapsDemos.xcworkspace

For Swift samples:

$ cd GoogleMaps-Swift
$ pod install
$ open GoogleMapsSwiftDemos.xcworkspace

You will need to add an API Key to GoogleMapsDemos/SDKDemoAPIKey.h. Please see the documentation for details on how to get an API Key.

GooglePlaces

The GooglePlaces and GooglePlaces-Swift sub-directory contains the sample code that is downloaded when you run pod try GooglePlaces. To use this project:

$ cd GooglePlaces
$ pod install
$ open GooglePlacesDemos.xcworkspace

For Swift samples:

$ cd GooglePlaces-Swift
$ pod install
$ open GooglePlacesSwiftDemos.xcworkspace

You will need to add an API Key to GooglePlacesDemos/SDKDemoAPIKey.h. Please see the documentation for details on how to get an API Key.

GoogleNavigation

The GoogleNavigation and GoogleNavigation-Swift sub-directory contains the sample code that is downloaded when you run pod try GoogleNavigation. To use this project:

$ cd GoogleNavigation
$ pod install
$ open GoogleNavigationDemos.xcworkspace

For Swift samples:

$ cd GoogleNavigation-Swift
$ pod install
$ open GoogleNavigationSwiftDemos.xcworkspace

You will need to add an API Key to GoogleNavigationDemos/SDKDemoAPIKey.h. Please contact the sales team for details on how to get an API Key.

MapsAndPlacesDemo

Description

This demo application looks to bridge some of the features found in the GooglePlaces and GoogleMaps demo applications as well as utilize some of the ways the two API's can work together. Click this link to watch a video demonstration.

This project was made by Haiming Xu as an internship project from 05/2020 to 08/2020

Requirements

  • If you are emulating this from you Mac, please make sure to set the emulated phone's location (otherwise, location features will not work)
  • A Google Cloud Platform API key with Maps SDK for iOS and Places SDK for iOS enabled
  • A light and dark themed map, which can be created here (make sure you sign in first)
  • If you want a different data set, ensure that it follows the correct formatting (and is also a JSON file) like the one provided (the data set provided can be found in dataset.json)

Installation

  1. Make sure you are in the right folder (MapsAndPlacesDemo)
  2. Run pod install
  3. Open MapsAndPlacesDemo.xcworkspace
  4. Drag the data set (dataset.json) into the Xcode file explorer (left pane)

Tutorials

The tutorials sub-directory contains sample code that accompanies tutorials in the developer documentation, such as Adding a Map with a Marker, and more. Follow the tutorials for a quick guide to using the SDK.

Snippets

The snippets sub-directory contains code snippets that can be found in the developer documentation site.

Support

If you find a bug or have a feature request related to these samples, please file an issue.

If you find a bug or have a feature request related to one of the SDKs, you can file an issue on either the Google Maps SDK for iOS Issue Tracker.or the Places SDK for iOS Issue Tracker.

You can also discover additional support services for the Google Maps Platform, including developer communities, technical guidance, and expert support at the Google Maps Platform support resources page.

Thanks!

maps-sdk-for-ios-samples's People

Contributors

amuramoto avatar arriolac avatar cwoodwar6 avatar domesticmouse avatar googlemaps-bot avatar haimingxu679 avatar hansemannn avatar jenperson avatar jpoehnelt avatar oppenheimera avatar owenlarosa avatar sarahmaddox avatar sgilsonapigee avatar wangela avatar waynewbishop avatar willum070 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

maps-sdk-for-ios-samples's Issues

Required File: LICENSE

The following file is missing from this repository: LICENSE

Do not edit below:
meta: [LICENSE]

render crash

Environment details

  1. Specify the API at the beginning of the title
    __ZN7gmscore6vector4text24CreateCFAttributedStringERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEPK8__CTFontf
  2. OS type and version
    iOS12 - iOS13
  3. Library version and other environment information
    GoogleMapSDK 3.4.1

Steps to reproduce

  1. I hook the UIFont API
  2. crash when call navigation

Stack trace

Application Specific Information:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** __NSSingleEntryDictionaryI_new: object cannot be nil'

Thread 0 Crashed:
0 CoreFoundation ___exceptionPreprocess
1 libobjc.A.dylib _objc_exception_throw
2 CoreFoundation -[__NSCFString characterAtIndex:].cold.1
3 CoreFoundation __CFThrowFormattedException
4 CoreFoundation ___NSSingleEntryDictionaryI_new
5 CoreFoundation ___NSCFDictionaryCreate
6 CoreFoundation _CFDictionaryCreate
7 DriverApp __ZN7gmscore6vector4text24CreateCFAttributedStringERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEPK8__CTFontf
8 DriverApp __ZN7gmscore6vector4text12CreateCTLineERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEPK8__CTFontf
9 DriverApp __ZN7gmscore6vector23GLLabelGroupElementTextC2EfRKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEffP13GMSModelStyleSC_SC_NS0_13LabelFontTypeE
10 DriverApp __ZN7gmscore6vector23GLLabelGroupElementTextC1EfRKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEffP13GMSModelStyleSC_SC_NS0_13LabelFontTypeE
11 DriverApp _ZN7gmscore6vector12GLLabelGroup32CreateGLLabelGroupElementForTextERKNS_5model12LabelElementEP13GMSModelStyleS7_S7
12 DriverApp __ZN7gmscore6vector12GLLabelGroup22ConfigureGroupElementsERKNS_5model10LabelGroupEi
13 DriverApp __ZN7gmscore6vector12GLLabelGroup18ReconfigureForZoomEf
14 DriverApp __ZN7gmscore6vector12GLPointLabel34ReconfigureGroupsForNearestKeyZoomEf
15 DriverApp __ZN7gmscore6vector12GLPointLabel12UpdateCameraERKNS_4base10reffed_ptrINS0_6CameraEEE
16 DriverApp __ZN7gmscore6vector13LabelRenderer13PrepareToDrawEbNS0_7GLLabel14RenderingFlagsEPb
17 DriverApp __ZN7gmscore6vector16LabelingBehavior14CommitInternalEPNS_8renderer14EntityRendererE
18 DriverApp __ZN7gmscore6vector16LabelingBehavior6CommitEPNS_8renderer14EntityRendererE
19 DriverApp __ZN7gmscore8renderer14EntityRenderer4DrawEb
20 DriverApp -[GMSPhoenixRenderer drawForced:]
21 DriverApp -[GMSEntityRendererView draw]
22 DriverApp -[GMSVectorMapView draw]
23 DriverApp -[GMSEntityRendererView displayLinkFired:]
24 DriverApp -[GMSDisplayLink displayLinkFired:]
25 QuartzCore CA::Display::DisplayLink::dispatch_items
26 QuartzCore display_timer_callback
27 CoreFoundation ___CFMachPortPerform
28 CoreFoundation _CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION
29 CoreFoundation ___CFRunLoopDoSource1
30 CoreFoundation ___CFRunLoopRun
31 CoreFoundation _CFRunLoopRunSpecific
32 GraphicsServices _GSEventRunModal
33 UIKitCore _UIApplicationMain
34 DriverApp main main.m:41
35 libdyld.dylib _start

Following these steps will guarantee the quickest resolution possible.

Thanks!

Draggable Polygon

Hi!, Why polygon has not Draggable feature in iOS and android Google maps? this Is only in javascript. please implement this feature in mobile apps as well.

pod try sync action fails since macos-latest bumped to macOS 12 runner image

The GitHub action managed by https://github.com/googlemaps/maps-sdk-for-ios-samples/blob/main/.github/workflows/pod_try_sync.yml began failing 19 days ago, when L27 specifying macos-latest updated from running macOS 11.7 to macOS 12.6. Runner image environment diff summary provided with the announcement from GitHub. The error may be because the macOS 12 image runs Ruby 3.0 by default instead of Ruby 2.7 by default.


Error reported by action:

Downloading dependencies
-> Installing GoogleMaps (7.1.0)

[!] Error installing GoogleMaps

Command

/usr/local/lib/ruby/gems/3.0.0/bin/pod --verbose try GoogleMaps

Report

  • What did you do?

  • What did you expect to happen?

  • What happened instead?

Stack

   CocoaPods : 1.6.1
        Ruby : ruby 3.0.4p208 (2022-04-12 revision 3fa771dded) [x86_64-darwin21]
    RubyGems : 3.3.23
        Host : macOS 12.6 (21G115)
       Xcode : 14.0.1 (14A400)
         Git : git version 2.38.0
Ruby lib dir : /usr/local/Cellar/[email protected]/3.0.4_1/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ 7ab84e56b917463f82ba12a5a9b1e784b96b4de1

Plugins

cocoapods-deintegrate : 1.0.5
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.1
cocoapods-stats       : 1.1.0
cocoapods-trunk       : 1.6.0
cocoapods-try         : 1.2.0

Podfile

source 'https://github.com/CocoaPods/Specs.git'

target 'GoogleMapsDemos' do
    platform :ios, '13.0'
    pod 'GoogleMaps', '= 7.1.0'
end

Error

ArgumentError - wrong number of arguments (given 1, expected 0)
/usr/local/lib/ruby/gems/3.0.0/gems/cocoapods-1.6.1/lib/cocoapods/downloader/request.rb:61:in `slug'
/usr/local/lib/ruby/gems/3.0.0/gems/cocoapods-1.6.1/lib/cocoapods/downloader/cache.rb:114:in `path_for_spec'
/usr/local/lib/ruby/gems/3.0.0/gems/cocoapods-1.6.1/lib/cocoapods/downloader/cache.rb:140:in `cached_spec'
/usr/local/lib/ruby/gems/3.0.0/gems/cocoapods-1.6.1/lib/cocoapods/downloader/cache.rb:125:in `cached_pod'
/usr/local/lib/ruby/gems/3.0.0/gems/cocoapods-1.6.1/lib/cocoapods/downloader/cache.rb:33:in `download_pod'
/usr/local/lib/ruby/gems/3.0.0/gems/cocoapods-1.6.1/lib/cocoapods/downloader.rb:42:in `download'
/usr/local/lib/ruby/gems/3.0.0/gems/cocoapods-1.6.1/lib/cocoapods/installer/pod_source_installer.rb:104:in `download_source'
/usr/local/lib/ruby/gems/3.0.0/gems/cocoapods-1.6.1/lib/cocoapods/installer/pod_source_installer.rb:62:in `install!'
/usr/local/lib/ruby/gems/3.0.0/gems/cocoapods-1.6.1/lib/cocoapods/installer.rb:426:in `install_source_of_pod'
/usr/local/lib/ruby/gems/3.0.0/gems/cocoapods-1.6.1/lib/cocoapods/installer.rb:377:in `block (2 levels) in install_pod_sources'
/usr/local/lib/ruby/gems/3.0.0/gems/cocoapods-1.6.1/lib/cocoapods/user_interface.rb:86:in `titled_section'
/usr/local/lib/ruby/gems/3.0.0/gems/cocoapods-1.6.1/lib/cocoapods/installer.rb:376:in `block in install_pod_sources'
/usr/local/lib/ruby/gems/3.0.0/gems/cocoapods-1.6.1/lib/cocoapods/installer.rb:359:in `each'
/usr/local/lib/ruby/gems/3.0.0/gems/cocoapods-1.6.1/lib/cocoapods/installer.rb:359:in `install_pod_sources'
/usr/local/lib/ruby/gems/3.0.0/gems/cocoapods-1.6.1/lib/cocoapods/installer.rb:189:in `block in download_dependencies'
/usr/local/lib/ruby/gems/3.0.0/gems/cocoapods-1.6.1/lib/cocoapods/user_interface.rb:64:in `section'
/usr/local/lib/ruby/gems/3.0.0/gems/cocoapods-1.6.1/lib/cocoapods/installer.rb:188:in `download_dependencies'
/usr/local/lib/ruby/gems/3.0.0/gems/cocoapods-1.6.1/lib/cocoapods/installer.rb:137:in `install!'
/usr/local/lib/ruby/gems/3.0.0/gems/cocoapods-1.6.1/lib/cocoapods/command/install.rb:48:in `run'
/usr/local/lib/ruby/gems/3.0.0/gems/claide-1.1.0/lib/claide/command.rb:544:in `invoke'
/usr/local/lib/ruby/gems/3.0.0/gems/cocoapods-try-1.2.0/lib/pod/command/try.rb:244:in `block in perform_cocoapods_installation'
/usr/local/lib/ruby/gems/3.0.0/gems/cocoapods-1.6.1/lib/cocoapods/user_interface.rb:86:in `titled_section'
/usr/local/lib/ruby/gems/3.0.0/gems/cocoapods-try-1.2.0/lib/pod/command/try.rb:243:in `perform_cocoapods_installation'
/usr/local/lib/ruby/gems/3.0.0/gems/cocoapods-try-1.2.0/lib/pod/command/try.rb:198:in `block in install_podfile'
/usr/local/lib/ruby/gems/3.0.0/gems/cocoapods-try-1.2.0/lib/pod/command/try.rb:197:in `chdir'
/usr/local/lib/ruby/gems/3.0.0/gems/cocoapods-try-1.2.0/lib/pod/command/try.rb:197:in `install_podfile'
/usr/local/lib/ruby/gems/3.0.0/gems/cocoapods-try-1.2.0/lib/pod/command/try.rb:54:in `block in run'
/usr/local/lib/ruby/gems/3.0.0/gems/cocoapods-1.6.1/lib/cocoapods/user_interface.rb:118:in `title'
/usr/local/lib/ruby/gems/3.0.0/gems/cocoapods-try-1.2.0/lib/pod/command/try.rb:49:in `run'
/usr/local/lib/ruby/gems/3.0.0/gems/claide-1.1.0/lib/claide/command.rb:334:in `run'
/usr/local/lib/ruby/gems/3.0.0/gems/cocoapods-1.6.1/lib/cocoapods/command.rb:52:in `run'
/usr/local/lib/ruby/gems/3.0.0/gems/cocoapods-1.6.1/bin/pod:55:in `<top (required)>'
/usr/local/lib/ruby/gems/3.0.0/bin/pod:25:in `load'
/usr/local/lib/ruby/gems/3.0.0/bin/pod:25:in `<main>'

Google Maps 2.0.1 Integration Throws error

M unable to integrate Google Maps 2.0.1. Every time when i build application, it throws error:
Auto-Linking supplied 'Pods/GoogleMaps/Subspecs/Base/Frameworks/GoogleMapsBase.framework/GoogleMapsBase', framework linker option at Pods/GoogleMaps/Subspecs/Base/Frameworks/GoogleMapsBase.framework/GoogleMapsBase is not a dylib
Undefined symbols for architecture i386:
"OBJC_CLASS$_GMSCameraPosition", referenced from:
objc-class-ref in ViewController.o
"OBJC_CLASS$_GMSMapView", referenced from:
objc-class-ref in ViewController.o

Also, i added '($inherited) in linker flags', but it is throwing same error. Please look into this issue. As i urgently need this functionality in my application.

GMSOverlay zIndex issue on tap

I have been trying to implement GMSOverlay on map with overlapping overlays. Setting zIndex did work on displaying overlays on top of each other. But when tapping on top overlay, its not working as it should. The one behind is overtaking tap.
IMG_4609

Marker Disappear Animation

Thanks for stopping by to let us know something could be better!


PLEASE READ

If you have a support contract with Google, please create an issue in the support console. This will ensure a timely response.

Discover additional support services for the Google Maps Platform, including developer communities, technical guidance, and expert support at the Google Maps Platform support resources page.

If your bug or feature request is not related to this particular library, please visit the Google Maps Platform issue trackers.

Check for answers on StackOverflow with the google-maps tag.


Is your feature request related to a problem? Please describe.

Lack of ability to animate out a marker

Describe the solution you'd like

Offer a .disappearAnimation allowing for the animated removal of a marker

Describe alternatives you've considered

Manually animating layer via CATransaction, CAKeyframeAnimation both of which don't appear to have an effect?

Additional context

Is there a way to animate the removal of a GMSMarker?

I've been reading through add/remove documentation and came across the appearAnimation property which provides what I"m looking for for the addition of a marker.

Use Case:
In our use case, we tend to add new annotations as well remove annotations from screen to maintain performance and provide focus on new content. The problem we're running into is when we remove annotations, its not animated. Placed alongside the animated introduction of new markers, the end user experience is weird.

Is there a way to offer: .disappearAnimation?

Or suggest a way to perform our own animations? So far I had attempting interacting with the layer/opacity direction with a UIView.animate(duration:animation:completion), as well as a CATransaction + CAKeyframeAnimation "transform.scale", both being unsuccessful at animating out the markers.

I would be very grateful for any guidance for how to approach.

gmscore::vector::MetalIconTextureCache::AtlasForRenderScaleCreatingIfNeeded(float)

Thanks for stopping by to let us know something could be better!

We found this crash using Firebase Crashlytics, which your company provides. At this point, we don't know the cause, but we've found that this bug doesn't occur in an older version that has the same Firebase SDK installed. Therefore, we believe that the cause of this crash is in the app itself. Would it be possible to determine the cause by looking at the log of this "stack trace" that we're currently providing? Alternatively, could you please provide us with some possible causes of the crash, even if they're general? Thank you and we look forward to your response

Environment details

iOS 16.2.0
iPhone 8
Google map SDK for iOS version: 7.2.0

Steps to reproduce

see the stack trace
I do not have any other information besides that

Code example

see the stack trace
I do not have any other information besides that

Stack trace

Crashed: com.apple.root.utility-qos
0  MyApp                     0xfdaef0 std::__1::unordered_map<float, std::__1::unique_ptr<gmscore::vector::MetalMutableTextureAtlas, std::__1::default_delete<gmscore::vector::MetalMutableTextureAtlas> >, std::__1::hash<float>, std::__1::equal_to<float>, std::__1::allocator<std::__1::pair<float const, std::__1::unique_ptr<gmscore::vector::MetalMutableTextureAtlas, std::__1::default_delete<gmscore::vector::MetalMutableTextureAtlas> > > > >::operator[](float const&) + 581604
1  MyApp                     0xfdaa44 gmscore::vector::MetalIconTextureCache::AtlasForRenderScaleCreatingIfNeeded(float) + 580408
2  MyApp                     0xfdae14 gmscore::vector::MetalIconTextureCache::AddElementForKey(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, float, CGImage*, bool, float) + 581384
3  MyApp                     0xfdb6bc gmscore::vector::MetalIconTextureCache::InternalAddIconImageForKey(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, float, UIImage*, GMSModelStyleIcon*, bool, float) + 583600
4  MyApp                     0xfdc730 invocation function for block in gmscore::vector::MetalIconTextureCache::FetchIconLayers(GMSModelStyleIcon*, bool, float, float, GMSServerResourceManager*, GMSx_absl::flat_hash_set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, GMSx_absl::container_internal::StringHash, GMSx_absl::container_internal::StringEq, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >*, void (GMSServerResource*) block_pointer) + 587812
5  libdispatch.dylib              0x63850 _dispatch_call_block_and_release + 24
6  libdispatch.dylib              0x647c8 _dispatch_client_callout + 16
7  libdispatch.dylib              0x48e68 _dispatch_root_queue_drain + 616
8  libdispatch.dylib              0x49514 _dispatch_worker_thread2 + 160
9  libsystem_pthread.dylib        0x1b14 _pthread_wqthread + 224
10 libsystem_pthread.dylib        0x167c start_wqthread + 8

Following these steps will guarantee the quickest resolution possible.

Thanks!

we need support for swift 4

Thanks for stopping by to let us know something could be better!

Is your feature request related to a problem? Please describe.
I just wanted some samples using this using Swift, the objc is not known by many programmers
Describe the solution you'd like
Samples developed with swift language would be most than needed
Describe alternatives you've considered
no alternatives.
Additional context
there are a bunch of people that only knows swift and no Objc

Add a code sample for `GMSPanoramaService`

Is your feature request related to a problem? Please describe.
No

Describe the solution you'd like
A quick working demo of how to use GMSPanoramaService

Describe alternatives you've considered
N/A

Additional context
N/A

[RFC] Swift only code samples?

The Google Maps Platform iOS team is evaluating whether or not new code samples should be released only in Swift. Objective-C samples can still be referenced on this repository, however, they will no longer be supported.

To help us inform this decision, please comment (or react) in this issue if you support this decision, or if you would like to continue to see samples in Objective-C.

Add a build action that runs on every PR and on a weekly schedule

Is your feature request related to a problem? Please describe.
We should have health measures in place to ensure buildable samples.

Describe the solution you'd like
Create a test github action workflow that triggers on every pull request and also on a weekly cadence.

Describe alternatives you've considered
Do nothing or use Travis.

didTapAt method not calling when I tap on google map transparent label

I need to adding functionality. if the user taps on anywhere in the map it should drop a pin. But when I tap on a transparent label on google map it should not call this delegate method.

func mapView(_ mapView: GMSMapView, didTapAt coordinate: CLLocationCoordinate2D) {
}

for your better understanding, we attach the below image. so you can identify what is a transparent label on the map.

Simulator Screen Shot - iPhone 8 - 2021-03-02 at 10 54 55

You can see in the image if I tap on the red circle area the above delegate method not working.

I want to click anywhere on the map. it should get the touch event.
Can you please help me?

Flaky "Update samples from CocoaPods" workflow

The pod_try_sync workflow has been flaky and occasionally times out and fails.

Failure logs show:

  warning: the following paths have collided (e.g. case-sensitive paths
  on a case-insensitive filesystem) and only one from the same
  colliding group is in the working tree:
  
    'Specs/5/1/1/Governor/1.0.11-APPS-1582-beta11/Governor.podspec.json'
    'Specs/5/1/1/Governor/1.0.11-apps-1582-beta11/Governor.podspec.json'
Copying contents of '/Unable' into '/Users/runner/work/maps-sdk-for-ios-samples/maps-sdk-for-ios-samples/GoogleMaps'
cp: /Unable/*: No such file or directory

Required File: LICENSE

The following file is missing from this repository: LICENSE

Do not edit below:
meta: [LICENSE]

Result not load when change marker position

Result not load when i change marker position on GMSPlacePickerViewController but if tap on search icon at top right corner and search something then result will be display in bottom list but if tried to change marker postion on map then bottom list showing Result not load

I'm using the Google sdk
Using GoogleMaps (3.1.0)
Using GooglePlacePicker (3.1.0)
Using GooglePlaces (3.1.0)

i already enable the place sdk and google place api at console developer.

here is my piece of code

  let config = GMSPlacePickerConfig(viewport: nil)
        let placePicker = GMSPlacePickerViewController(config: config)
        placePicker.delegate = self
         UserLocationDetail.shared.getCurrentSavedLocation(iscustom: true)
        self.present(placePicker, animated: true, completion: nil)

i'm attaching the Screenshots with error
Simulator Screen Shot - iPhone X - 2019-10-25 at 10 58 53

Simulator Screen Shot - iPhone X - 2019-10-25 at 11 49 14

How do I calculate the distance between two latitudes and longitudes

PLEASE READ

If you have a support contract with Google, please create an issue in the support console. This will ensure a timely response.

Discover additional support services for the Google Maps Platform, including developer communities, technical guidance, and expert support at the Google Maps Platform support resources page.

If your bug or feature request is not related to this particular library, please visit the Google Maps Platform issue trackers.

Check for answers on StackOverflow with the google-maps tag.


Crash activating kGMSTypeSatellite

If you just try to activate satellite map type, SDK crash

Environment details

  • OS type and version: iOS, any version
  • Library version and other environment information: "GoogleMaps 3.10.0-beta1"

Steps to reproduce

  1. download https://github.com/googlemaps/maps-sdk-for-ios-samples and open project inside folder "GoogleMapsBeta"
  2. open file SDKDemoAPIKey.h and set a valid API key obviously..
  3. open file "CloudBasedMapStylingViewController.m" and add just single line to switch to map type "satellite":

[_mapView setMapType:kGMSTypeSatellite];

for example just below lines that init the map:

_mapView = [GMSMapView mapWithFrame:CGRectZero camera:camera];
self.view = _mapView;
[_mapView setMapType:kGMSTypeSatellite];

  1. Crash!

Exception

libc++abi.dylib: terminating with uncaught exception of type NSException
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[GMSx_GMPMapCopyrights messageSetExtension]: unrecognized selector sent to class 0x10972e1f8'
terminating with uncaught exception of type NSException

Stack trace

0   CoreFoundation                      0x00007fff20421af6 __exceptionPreprocess + 242
1   libobjc.A.dylib                     0x00007fff20177e78 objc_exception_throw + 48
2   CoreFoundation                      0x00007fff20430610 __CFExceptionProem + 0
3   CoreFoundation                      0x00007fff20426036 ___forwarding___ + 1489
4   CoreFoundation                      0x00007fff20428068 _CF_forwarding_prep_0 + 120
5   GoogleMapsBeta                      0x00000001091f1e2d GMSMapTileDataProtoFromPaintedRegion + 413
6   GoogleMapsBeta                      0x00000001091f254d _Z32GMSBuildTileProtosFromRegionListP28GMSx_GMMMapTileResponseProtoP7NSArrayIP20GMSx_GMMMapTileProtoEPS1_IP21GMSx_GMPPaintedRegionEm + 177
7   GoogleMapsBeta                      0x00000001091f28d8 GMSMapTileResponseFromPaintResponse + 760
8   GoogleMapsBeta                      0x000000010924b13f __52-[GMSPaintService sendRequest:tileType:tileService:]_block_invoke + 381
9   GoogleMapsBeta                      0x000000010924a950 __50-[GMSPaintService requestTiles:completionHandler:]_block_invoke + 423
10  GoogleMapsBeta                      0x000000010906b734 __85-[GMSPaintRPCService sendRequestWithSigningKey:fetchURLComponents:completionHandler:]_block_invoke.97 + 112
11  GoogleMapsBeta                      0x000000010916ce18 __76-[GMSx_GTMSessionFetcher invokeFetchCallbacksOnCallbackQueueWithData:error:]_block_invoke + 25
12  libdispatch.dylib                   0x0000000109f2d7ec _dispatch_call_block_and_release + 12
13  libdispatch.dylib                   0x0000000109f2e9c8 _dispatch_client_callout + 8
14  libdispatch.dylib                   0x0000000109f3cf45 _dispatch_main_queue_callback_4CF + 1360
15  CoreFoundation                      0x00007fff2038fdbb __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
16  CoreFoundation                      0x00007fff2038a63e __CFRunLoopRun + 2685
17  CoreFoundation                      0x00007fff203896d6 CFRunLoopRunSpecific + 567
18  GraphicsServices                    0x00007fff2c257db3 GSEventRunModal + 139
19  UIKitCore                           0x00007fff24696cf7 -[UIApplication _run] + 912
20  UIKitCore                           0x00007fff2469bba8 UIApplicationMain + 101
21  GoogleMapsBeta                      0x0000000108ffb942 main + 114
22  libdyld.dylib                       0x00007fff2025a3e9 start + 1

Note: I'm using BETA version just because it's the only version having "cloud-based map style" and "Stamped polylines", I don't understand why 3.10.0-BETA has these features but the official 4.2.0 still not.

Swift Package Manager support

Hi. I am using only Swift Package Manager and for me it better than cocoapod or carthage.
Can I know when I can use GoogleMaps with SPM?

Add contributing guide

This repo was made before we consistently required a contributing guide.

Related: Now that GitHub has a list of Contributors in the repo homepage UI, the CONTRIBUTORS.md file is obsolete and should be removed.

How to set the mapView language?

PLEASE READ

If you have a support contract with Google, please create an issue in the support console. This will ensure a timely response.

Discover additional support services for the Google Maps Platform, including developer communities, technical guidance, and expert support at the Google Maps Platform support resources page.

If your bug or feature request is not related to this particular library, please visit the Google Maps Platform issue trackers.

Check for answers on StackOverflow with the google-maps tag.


Bizarre behavior of GMSCameraPosition-GMSMapView

Hy,
This is the very bizarre behavior of 'GMSCameraPosition'. The code crashes some time that is written in 'viewDidLoad', saying EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000008.
'[AppConfig sharedInstance].theLocation' get a location from location manager. The controller where below code is written comes after once the app gets location. Here is the code.

  • (void)viewDidLoad
    {
    [super viewDidLoad];
    self.extendedLayoutIncludesOpaqueBars = TRUE;
    GMSCameraPosition *camera =
    [GMSCameraPosition cameraWithLatitude:[AppConfig sharedInstance].theLocation.latitude
    longitude:[AppConfig sharedInstance].theLocation.longitude
    zoom:14]; //Some thing goes wrong over here

homeMapView = [GMSMapView mapWithFrame:CGRectZero camera:camera]; // Code crashes here
homeMapView.settings.compassButton = YES;
homeMapView.settings.myLocationButton = YES;
homeMapView.settings.zoomGestures = YES;
homeMapView.delegate = self;
self.view = homeMapView;
}

For more help here is the stack:

Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x18a7fa804 object_isClass + 24
1 Foundation 0x18c7d49b8 -[NSObject(NSKeyValueObserverNotification) willChangeValueForKey:] + 328
2 HooSafe 0x100465f94 -[GMSMapView internalSetCamera:] + 4299415444
3 HooSafe 0x100462608 -[GMSMapView setCamera:] + 4299400712
4 HooSafe 0x100460f8c -[GMSMapView sharedInitWithServices:camera:forPlaces:] + 4299394956
5 HooSafe 0x10045ff84 -[GMSMapView initWithFrame:camera:] + 4299390852
6 HooSafe 0x10045fdc8 +[GMSMapView mapWithFrame:camera:] + 4299390408
7 HooSafe 0x10011dc14 -[DemoViewController viewDidLoad] (DemoViewController.m:107)
8 UIKit 0x191c7a924 -[UIViewController loadViewIfRequired] + 1056
9 UIKit 0x191d342bc -[UINavigationController _layoutViewController:] + 72
10 UIKit 0x191d34194 -[UINavigationController _updateScrollViewFromViewController:toViewController:] + 416
11 UIKit 0x191d334dc -[UINavigationController _startTransition:fromViewController:toViewController:] + 140
12 UIKit 0x191d32f28 -[UINavigationController _startDeferredTransitionIfNeeded:] + 856
13 UIKit 0x191d32adc -[UINavigationController __viewWillLayoutSubviews] + 64
14 UIKit 0x191d32a40 -[UILayoutContainerView layoutSubviews] + 188
15 UIKit 0x191c77a80 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1196
16 QuartzCore 0x18f1259d8 -[CALayer layoutSublayers] + 148
17 QuartzCore 0x18f11a4cc CA::Layer::layout_if_needed(CA::Transaction*) + 292
18 QuartzCore 0x18f11a38c CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 32
19 QuartzCore 0x18f0973e0 CA::Context::commit_transaction(CA::Transaction*) + 252
20 QuartzCore 0x18f0bea68 CA::Transaction::commit() + 512
21 QuartzCore 0x18f0bf488 CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 120
22 CoreFoundation 0x18bd720c0 CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION + 32
23 CoreFoundation 0x18bd6fcf0 __CFRunLoopDoObservers + 372
24 CoreFoundation 0x18bd70180 __CFRunLoopRun + 1024
25 CoreFoundation 0x18bc9e2b8 CFRunLoopRunSpecific + 444
26 GraphicsServices 0x18d752198 GSEventRunModal + 180
27 UIKit 0x191ce57fc -[UIApplication _run] + 684
28 UIKit 0x191ce0534 UIApplicationMain + 208
29 HooSafe 0x1000b12d0 main (main.m:16)
30 libdispatch.dylib 0x18ac815b8 (Missing)

Google Maps 5.2.0 not available on Carthage

According to your /snippets/Cartfile one can use this line to download GoogleMaps 5.2.0:

https://github.com/googlemaps/maps-sdk-for-ios-samples/blob/e39a08c23ae0afea45001e8f5bb3ea195e5a44b0/snippets/Cartfile#L2

But at the moment, the json file doesn't include such version, and it results on this error on carthage update:

No available version for binary "https://dl.google.com/geosdk/GoogleMaps.json" satisfies the requirement: == 5.2.0

When is this going to be included in the json file? thanks!

Sample code for SwiftUI

We're trying to getting started with using Google Maps in a SwiftUI app. We were looking for code samples and finally landed here, only to find all ObjC code.

Kindly provide sample code in Swift for SwiftUI. At the very least, provide sample code in Swift, for us to understand better.

Preferred Bulgarian language missing in iOS

Hello,

Since you don't have an official email I can submit mu feature/bug request I am forced to done it here.

For some reason in Google Maps Bulgarian language missing as a preferred option.

Are you able to add it ?

If this is not the right place please reroute the ticket to the rights and responsible persons for this!

Thank you in advance.
Google Maps missing Preferred Bulgarian language
Google Maps missing Preferred Bulgarian language2 jpg

custom color for one street

I have an iOS app with a map where the user can see roads of different colors with a specific meaning.

For example - Show some roads red which has a particular meaning and some roads green which has a different meaning etc. so that the user will see the map with color-coded roads.

All I have is the name of the road and the color which has to be assigned to the road from the API.

I am aware of Google Maps Platform Styling Wizard but that changes the color of all the roads in the map whereas I want to set the color to only specific roads and that also in different colors as required. Is it possible

Endless indicator when navigate to Google Maps

https://stackoverflow.com/questions/67316279/google-maps-ios-continous-spinner-for-navigation

In my application user has possible to open Google Maps application with navigation mode to the stop. When user has enabled location permission in the system dialog, everything works correct - Google Maps is opened, load and show path between selected stop and current user location. The situation changes when user has disabled location permission in my application. In this case Google Maps opens but is unable to load path on the maps. It also show endless loading indicator in navigation steps place. Google Maps in both cases has permission to user location.

Recorded movie: https://drive.google.com/file/d/1MriakRfRhILNmdv_TvAXDhaz_uMrZag4/view?usp=sharing

Any ideas how to make workaround this issue, to force Google maps showing navigation path in case of disabled location permission in my app?

For opening google maps we use url:

comgooglemaps://?saddr=&center=56.66927193017708,12.864841503952087&directionsmode=walking&daddr=Halmstad+C+(T%C3%A5g)

I use Google Maps

pod 'GoogleMaps', '~> 4.1.0'

While custom marker adding using iconView it will hang map and memory high

    let marker = GMSMarker()
    
    // Creates a marker in the center of the map.
    marker.position = CLLocationCoordinate2D(latitude: trackList["lat"].doubleValue, longitude: trackList["lng"].doubleValue)
    marker.title = "Sydney"
    marker.snippet = "Australia"
    marker.map = viewGoogleMap

    marker.tracksViewChanges = false
    marker.tracksInfoWindowChanges = false
    
    let customInfoWindow = CustomIconView(frame: CGRect(x: 0, y: 0, width: 75, height: 75))
        customInfoWindow.imgUserPhoto.layer.masksToBounds = true
        customInfoWindow.imgUserPhoto.layer.borderWidth = 1.0
        customInfoWindow.imgUserPhoto.layer.borderColor = UIColor.green.cgColor
        customInfoWindow.imgUserPhoto.layer.cornerRadius = customInfoWindow.imgUserPhoto.frame.size.width / 2
        customInfoWindow.imgUserPhoto.image = UIImage(named: "sample")
        marker.iconView = customInfoWindow

I am displaying custom marker for google map implementation in swift. there is memory issue while using marker.iconView.
if i used (marker.icon) it will working fine.

When i build GooglePlaces Demo is linker error.

Environment details

  1. Xcode 11.2

Stack trace

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_PlacePickerViewController", referenced from:
      objc-class-ref in DemoData.o
  "_OBJC_CLASS_$_PhotosViewController", referenced from:
      objc-class-ref in DemoData.o
  "_OBJC_CLASS_$_AutocompleteWithSearchDisplayController", referenced from:
      objc-class-ref in DemoData.o
  "_OBJC_CLASS_$_MainSplitViewControllerBehaviorManager", referenced from:
      objc-class-ref in DemoAppDelegate.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Thanks!

Invalid bitcode version on latest google maps version 7.1.0 while Archive

On the latest google maps SDK version 7.1.0, facing Invalid bitcode version while archive.
Downgraded to 7.0.0 its working fine.

Using Xcode 13.2.1
OS : Monterey 12.2

Stack trace

Could not reparse object file in bitcode bundle: 'Invalid bitcode version (Producer: '1316.0.21.2.5_0' Reader: '1300.0.29.30_0')', using libLTO version 'LLVM version 13.0.0, (clang-1300.0.29.30)' for architecture arm64

Support SPM

Could you tell me when to expect SPM support? We need to integrate into the project, but we encountered a problem you do not support SPM

Polygon cuts from the left side for some region.

Problem Statement:

Polygons are not drawing properly on Google Maps. It is cutting from the left side. I have verified my code it seems perfect from my side as I took it from Google. Please find the code snippet and image of the Polygon below.

I have drawn Polylin with the same latitude and longitude but the same result in the iOS Google Maps. [Same latitude and longitude are working fine in the android google maps]

Required Details:

pod GoogleMaps
version: GoogleMaps (6.2.1)

Code example:

       let camera = GMSCameraPosition.camera(withLatitude: 51.504669, longitude: -719.999682, zoom: 12)

        // Create a GMSMapView with the camera position
        mapView = GMSMapView.map(withFrame: view.bounds, camera: camera)
        view.addSubview(mapView)

        // Draw the polygon
        let polygonPath = GMSMutablePath()
        polygonPath.add(CLLocationCoordinate2D(latitude:51.504669, longitude:-719.999682))
        polygonPath.add(CLLocationCoordinate2D(latitude:51.503922, longitude:-720.000712))
        polygonPath.add(CLLocationCoordinate2D(latitude:51.500397, longitude:-720.003116))
        polygonPath.add(CLLocationCoordinate2D(latitude:51.496871, longitude:-720.000884))
        polygonPath.add(CLLocationCoordinate2D(latitude:51.493452, longitude:-719.998824))
        polygonPath.add(CLLocationCoordinate2D(latitude:51.489071, longitude:-719.997794))
        polygonPath.add(CLLocationCoordinate2D(latitude:51.486827, longitude:-719.999339))
        polygonPath.add(CLLocationCoordinate2D(latitude:51.484369, longitude:-720.00552))
        polygonPath.add(CLLocationCoordinate2D(latitude:51.482873, longitude:-720.011872))
        polygonPath.add(CLLocationCoordinate2D(latitude:51.48298, longitude:-720.017709))
        polygonPath.add(CLLocationCoordinate2D(latitude:51.479774, longitude:-720.018396))
        polygonPath.add(CLLocationCoordinate2D(latitude:51.476247, longitude:-720.020799))
        polygonPath.add(CLLocationCoordinate2D(latitude:51.474216, longitude:-720.023203))
        polygonPath.add(CLLocationCoordinate2D(latitude:51.469833, longitude:-720.019597))
        polygonPath.add(CLLocationCoordinate2D(latitude:51.466519, longitude:-720.01685))
        polygonPath.add(CLLocationCoordinate2D(latitude:51.465129, longitude:-720.006035))
        polygonPath.add(CLLocationCoordinate2D(latitude:51.466198, longitude:-719.987493))
        polygonPath.add(CLLocationCoordinate2D(latitude:51.468657, longitude:-719.984746))
        polygonPath.add(CLLocationCoordinate2D(latitude:51.472933, longitude:-719.979252))
        polygonPath.add(CLLocationCoordinate2D(latitude:51.474216, longitude:-719.979081))
        polygonPath.add(CLLocationCoordinate2D(latitude:51.475071, longitude:-719.975304))
        polygonPath.add(CLLocationCoordinate2D(latitude:51.481484, longitude:-719.979252))
        polygonPath.add(CLLocationCoordinate2D(latitude:51.483835, longitude:-719.979768))
        polygonPath.add(CLLocationCoordinate2D(latitude:51.484583, longitude:-719.97496))
        polygonPath.add(CLLocationCoordinate2D(latitude:51.487896, longitude:-719.965861))
        polygonPath.add(CLLocationCoordinate2D(latitude:51.490353, longitude:-719.958651))
        polygonPath.add(CLLocationCoordinate2D(latitude:51.492918, longitude:-719.954187))
        polygonPath.add(CLLocationCoordinate2D(latitude:51.494414, longitude:-719.955389))
        polygonPath.add(CLLocationCoordinate2D(latitude:51.493879, longitude:-719.964316))
        polygonPath.add(CLLocationCoordinate2D(latitude:51.493238, longitude:-719.971355))
        polygonPath.add(CLLocationCoordinate2D(latitude:51.493986, longitude:-719.978737))
        polygonPath.add(CLLocationCoordinate2D(latitude:51.494841, longitude:-719.981999))
        polygonPath.add(CLLocationCoordinate2D(latitude:51.497512, longitude:-719.986978))
        polygonPath.add(CLLocationCoordinate2D(latitude:51.501465, longitude:-719.990583))
        polygonPath.add(CLLocationCoordinate2D(latitude:51.504242, longitude:-719.99436))
        polygonPath.add(CLLocationCoordinate2D(latitude:51.504669, longitude:-719.999682))

        polygon = GMSPolygon(path: polygonPath)
        polygon.fillColor = UIColor.red
        polygon.strokeColor = .blue // Set stroke color
        polygon.strokeWidth = 2 // Set stroke width
        polygon.map = mapView

Issues screenshot:

Polygon Polylin
Polygon PolylineDraw

Actual/Expected Result:

Result

Sample Lat-long:

-719.999682, 51.504669
-720.000712, 51.503922
-720.003116, 51.500397
-720.000884, 51.496871
-719.998824, 51.493452
-719.997794, 51.489071
-719.999339, 51.486827
-720.00552, 51.484369
-720.011872, 51.482873
-720.017709, 51.48298
-720.018396, 51.479774
-720.020799, 51.476247
-720.023203, 51.474216
-720.019597, 51.469833
-720.01685, 51.466519
-720.006035, 51.465129
-719.987493, 51.466198
-719.984746, 51.468657
-719.979252, 51.472933
-719.979081, 51.474216
-719.975304, 51.475071
-719.979252, 51.481484
-719.979768, 51.483835
-719.97496, 51.484583
-719.965861, 51.487896
-719.958651, 51.490353
-719.954187, 51.492918
-719.955389, 51.494414
-719.964316, 51.493879
-719.971355, 51.493238
-719.978737, 51.493986
-719.981999, 51.494841
-719.986978, 51.497512
-719.990583, 51.501465
-719.99436, 51.504242
-719.999682, 51.504669

Please let me know if you have any questions.

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.