Repository navigation
chore(ios): replace deprecated GMSMapView initializers - #182
Merged
Merged
Conversation
Use GMSMapView(options:) with GMSMapViewOptions instead of init(frame:camera:) and init(frame:mapID:camera:), which are deprecated. GMSMapViewOptions is available in Maps SDK 9.4 (CocoaPods) and 10.x (SPM), so a single code path covers both.
andredestro
requested review from
ItsChaceD,
OS-pedrogustavobilro,
OS-ruimoreiramendes,
alexgerardojacinto,
jcesarmobile,
markemer and
theproducer
October 6, 2026 09:47
theproducer
approved these changes
Oct 6, 2026
jcesarmobile
approved these changes
Oct 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Replaces the deprecated
GMSMapViewinitializers inGMViewController.viewDidLoad(Map.swift) withGMSMapView(options:):init(frame:mapID:camera:)is deprecated: Use -init or -initWithOptions: instead.init(frame:camera:)is deprecated: Use -init or -initWithOptions: instead.Frame, camera and the optional map ID (
iOSMapId) are now set on aGMSMapViewOptions, so both branches collapse into a single code path.GMSMapViewOptionsand-initWithOptions:already exist in Maps SDK 9.4 (CocoaPods), where the old initializers are also deprecated, so the same code works for CocoaPods (9.4) and SPM (10.x).Change Type
Tests or Reproductions
Map.swift.example-app(CocoaPods, Maps 9.4.0): builds with no warnings left inMap.swift.example-appandexample-app-spm: created a map without and withiOSMapId, then calledgetMapBounds(). In both cases the bounds center matches the configured center and the longitude span matches the one expected for the element width (402pt) at the configured zoom (2.208 at z8, 0.552 at z10), so frame and camera from the options are applied. No errors or crashes.Screenshots / Media
N/A
Platforms Affected
Notes / Comments