Skip to content

Commit ac36a4f

Browse files
committed
chore: release 7.0.1
1 parent 80edf08 commit ac36a4f

File tree

5 files changed

+53
-42
lines changed

5 files changed

+53
-42
lines changed

plugin/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
# [7.0.1](https://github.com/ionic-team/capacitor-google-maps/compare/@capacitor/[email protected]...@capacitor/[email protected]) (2025-02-21)
7+
8+
### Refactor
9+
* migrate deprecated `Marker` to use `AdvancedMarkerElement` ([#72](https://github.com/ionic-team/capacitor-google-maps/pull/72))
10+
11+
612
# [7.0.0](https://github.com/ionic-team/capacitor-google-maps/compare/@capacitor/[email protected]...@capacitor/[email protected]) (2025-01-20)
713

814
**Note:** Version bump only for package @capacitor/google-maps

plugin/ios/Plugin/CapacitorGoogleMapsPlugin.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@ public class CapacitorGoogleMapsPlugin: CAPPlugin, GMSMapViewDelegate {
6868
private var maps = [String: Map]()
6969
private var isInitialized = false
7070
private var locationManager = CLLocationManager()
71-
72-
71+
7372
func checkLocationPermission() -> String {
7473
let locationState: String
7574

@@ -684,7 +683,7 @@ public class CapacitorGoogleMapsPlugin: CAPPlugin, GMSMapViewDelegate {
684683
guard let enabled = call.getBool("enabled") else {
685684
throw GoogleMapErrors.invalidArguments("enabled is missing")
686685
}
687-
686+
688687
let locationStatus = checkLocationPermission()
689688

690689
if enabled && !(locationStatus == "granted" || locationStatus == "prompt") {

plugin/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@capacitor/google-maps",
3-
"version": "7.0.0",
3+
"version": "7.0.1",
44
"description": "Google maps on Capacitor",
55
"main": "dist/plugin.cjs.js",
66
"module": "dist/esm/index.js",

plugin/src/web.ts

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,14 @@ export class CapacitorGoogleMapsWeb extends WebPlugin implements CapacitorGoogle
125125
});
126126
const google = await loader.load();
127127
this.gMapsRef = google.maps;
128-
128+
129129
// Import marker library once
130-
const { AdvancedMarkerElement, PinElement } = await google.maps.importLibrary('marker') as google.maps.MarkerLibrary;
130+
const { AdvancedMarkerElement, PinElement } = (await google.maps.importLibrary(
131+
'marker'
132+
)) as google.maps.MarkerLibrary;
131133
this.AdvancedMarkerElement = AdvancedMarkerElement;
132134
this.PinElement = PinElement;
133-
135+
134136
console.log('Loaded google maps API');
135137
}
136138
}
@@ -416,7 +418,7 @@ export class CapacitorGoogleMapsWeb extends WebPlugin implements CapacitorGoogle
416418
const mapInstance = this.maps[_args.id];
417419
if (mapInstance.markerClusterer) {
418420
const markers = Object.values(mapInstance.markers);
419-
421+
420422
mapInstance.markerClusterer.setMap(null);
421423
mapInstance.markerClusterer = undefined;
422424

@@ -531,7 +533,11 @@ export class CapacitorGoogleMapsWeb extends WebPlugin implements CapacitorGoogle
531533
});
532534
}
533535

534-
async setMarkerListeners(mapId: string, markerId: string, marker: google.maps.marker.AdvancedMarkerElement): Promise<void> {
536+
async setMarkerListeners(
537+
mapId: string,
538+
markerId: string,
539+
marker: google.maps.marker.AdvancedMarkerElement
540+
): Promise<void> {
535541
marker.addListener('click', () => {
536542
const position = marker.position as google.maps.LatLngLiteral;
537543
this.notifyListeners('onMarkerClick', {
@@ -638,7 +644,7 @@ export class CapacitorGoogleMapsWeb extends WebPlugin implements CapacitorGoogle
638644
}
639645

640646
let content: HTMLElement | undefined = undefined;
641-
647+
642648
if (marker.iconUrl) {
643649
const img = document.createElement('img');
644650
img.src = marker.iconUrl;
@@ -651,7 +657,9 @@ export class CapacitorGoogleMapsWeb extends WebPlugin implements CapacitorGoogle
651657
const pinOptions: google.maps.marker.PinElementOptions = {
652658
scale: marker.opacity ?? 1,
653659
glyph: marker.title,
654-
background: marker.tintColor ? `rgb(${marker.tintColor.r}, ${marker.tintColor.g}, ${marker.tintColor.b})` : undefined,
660+
background: marker.tintColor
661+
? `rgb(${marker.tintColor.r}, ${marker.tintColor.g}, ${marker.tintColor.b})`
662+
: undefined,
655663
};
656664

657665
const pin = new this.PinElement(pinOptions);

pnpm-lock.yaml

Lines changed: 29 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)