Skip to content

chore(ios): replace deprecated GMSMapView initializers - #182

Merged
andredestro merged 1 commit into
nextfrom
chore/RMET-5362/ios-deprecated-map-init
Oct 7, 2026
Merged

andredestro merged 1 commit into
nextfrom
chore/RMET-5362/ios-deprecated-map-init

Conversation

@andredestro

Copy link
Copy Markdown

Description

Replaces the deprecated GMSMapView initializers in GMViewController.viewDidLoad (Map.swift) with GMSMapView(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 a GMSMapViewOptions, so both branches collapse into a single code path.

GMSMapViewOptions and -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

  • Fix
  • Feature
  • Refactor
  • Breaking Change
  • Documentation
  • Other (CI, chores, etc.)

Tests or Reproductions

  • Plugin package (SPM, Maps 10.15.0): builds for iOS with no warnings left in Map.swift.
  • example-app (CocoaPods, Maps 9.4.0): builds with no warnings left in Map.swift.
  • Runtime check on an iPhone 17 Pro simulator (iOS 26.5), in both example-app and example-app-spm: created a map without and with iOSMapId, then called getMapBounds(). 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.
  • The same runtime check against the old initializers gives identical results.

Screenshots / Media

N/A

Platforms Affected

  • Android
  • iOS
  • Web

Notes / Comments

  • The runtime check used a placeholder API key, so tiles and cloud-based styling for a real map ID were not exercised. Only the map view creation path changed here.

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
andredestro merged commit eb706db into next Oct 7, 2026
11 checks passed
@andredestro
andredestro deleted the chore/RMET-5362/ios-deprecated-map-init branch October 7, 2026 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants