Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 32 additions & 32 deletions example-app-spm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,38 +11,38 @@
"@capacitor/ios": "next",
"@capacitor/keyboard": "next",
"@capacitor/status-bar": "next",
"@ionic/react": "^6.0.0",
"@ionic/react-router": "^6.0.0",
"@testing-library/jest-dom": "^5.11.9",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^12.6.3",
"@ionic/react": "^8.7.9",
"@ionic/react-router": "^8.7.9",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.0",
"@testing-library/user-event": "^14.6.1",
"@types/google.maps": "~3.58.1",
"@types/jest": "^26.0.20",
"@types/node": "^12.19.15",
"@types/react": "^16.14.3",
"@types/react-dom": "^16.9.10",
"@types/react-router": "^5.1.11",
"@types/react-router-dom": "^5.1.7",
"ionicons": "^5.4.0",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-router": "^5.2.0",
"react-router-dom": "^5.2.0",
"react-scripts": "^5.0.0",
"typescript": "^4.1.3",
"web-vitals": "^0.2.4",
"workbox-background-sync": "^5.1.4",
"workbox-broadcast-update": "^5.1.4",
"workbox-cacheable-response": "^5.1.4",
"workbox-core": "^5.1.4",
"workbox-expiration": "^5.1.4",
"workbox-google-analytics": "^5.1.4",
"workbox-navigation-preload": "^5.1.4",
"workbox-precaching": "^5.1.4",
"workbox-range-requests": "^5.1.4",
"workbox-routing": "^5.1.4",
"workbox-strategies": "^5.1.4",
"workbox-streams": "^5.1.4"
"@types/jest": "^30.0.0",
"@types/node": "^24.10.1",
"@types/react": "^19.2.6",
"@types/react-dom": "^19.2.3",
"@types/react-router": "^5.1.20",
"@types/react-router-dom": "^5.3.3",
"ionicons": "^8.0.13",
"react": "^19.2.0",
"react-dom": "^19.2.0",
"react-router": "^5.3.4",
"react-router-dom": "^5.3.4",
"react-scripts": "^5.0.1",
"typescript": "^5.9.3",
"web-vitals": "^5.1.0",
"workbox-background-sync": "^7.3.0",
"workbox-broadcast-update": "^7.3.0",
"workbox-cacheable-response": "^7.3.0",
"workbox-core": "^7.3.0",
"workbox-expiration": "^7.3.0",
"workbox-google-analytics": "^7.3.0",
"workbox-navigation-preload": "^7.3.0",
"workbox-precaching": "^7.3.0",
"workbox-range-requests": "^7.3.0",
"workbox-routing": "^7.3.0",
"workbox-strategies": "^7.3.0",
"workbox-streams": "^7.3.0"
},
"scripts": {
"start": "react-scripts start",
Expand Down Expand Up @@ -72,4 +72,4 @@
"@capacitor/cli": "next"
},
"description": "An Ionic project"
}
}
12 changes: 12 additions & 0 deletions example-app-spm/src/custom-elements.d.ts
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to confirm, this change was necessary because of the dependency updates in the app, not the dependency updates in the plugin?

In other words if they update the plugin to the future Cap 8 compatible version without touching anything else, they won't need to add this right?

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import '@capacitor/google-maps';

declare global {
namespace JSX {
interface IntrinsicElements {
'capacitor-google-map': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
}
}
}

export {};

17 changes: 10 additions & 7 deletions example-app-spm/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
import React from 'react';
import ReactDOM from 'react-dom';
import { createRoot } from 'react-dom/client';
import App from './App';
import * as serviceWorkerRegistration from './serviceWorkerRegistration';
import reportWebVitals from './reportWebVitals';

ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('root')
);
const container = document.getElementById('root');
if (container) {
const root = createRoot(container);
root.render(
<React.StrictMode>
<App />
</React.StrictMode>
);
}

// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
Expand Down
1 change: 1 addition & 0 deletions example-app-spm/src/pages/Drawing/Circles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ const CircleMapPage: React.FC = () => {
autoGrow={true}
></IonTextarea>
</div>
{/* @ts-ignore - custom element */}
<capacitor-google-map
id="map_circles"
style={{
Expand Down
10 changes: 10 additions & 0 deletions example-app-spm/src/react-app-env.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
/// <reference types="react-scripts" />

declare global {
namespace JSX {
interface IntrinsicElements {
'capacitor-google-map': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
}
}
}

export {};
16 changes: 7 additions & 9 deletions example-app-spm/src/reportWebVitals.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import { ReportHandler } from 'web-vitals';
import { onCLS, onINP, onFCP, onLCP, onTTFB, Metric } from 'web-vitals';

const reportWebVitals = (onPerfEntry?: ReportHandler) => {
const reportWebVitals = (onPerfEntry?: (metric: Metric) => void) => {
if (onPerfEntry && onPerfEntry instanceof Function) {
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
getCLS(onPerfEntry);
getFID(onPerfEntry);
getFCP(onPerfEntry);
getLCP(onPerfEntry);
getTTFB(onPerfEntry);
});
onCLS(onPerfEntry);
onINP(onPerfEntry);
onFCP(onPerfEntry);
onLCP(onPerfEntry);
onTTFB(onPerfEntry);
}
};

Expand Down
3 changes: 2 additions & 1 deletion example-app-spm/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"jsx": "react-jsx"
},
"include": [
"src"
"src",
"src/**/*.d.ts"
]
}
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
},
"devDependencies": {
"@capacitor/ios": "next",
"@types/node": "^20.11.25",
"glob": "^11.0.0",
"husky": "^9.0.1",
"lerna": "^8.1.2",
"typescript": "^5.4.2"
"@types/node": "^24.10.1",
"glob": "^11.0.3",
"husky": "^9.1.7",
"lerna": "^9.0.1",
"typescript": "^5.9.3"
},
"engines": {
"node": ">=20",
Expand Down
7 changes: 0 additions & 7 deletions plugin/.eslintignore

This file was deleted.

39 changes: 0 additions & 39 deletions plugin/.eslintrc.json

This file was deleted.

4 changes: 0 additions & 4 deletions plugin/.prettierignore

This file was deleted.

29 changes: 0 additions & 29 deletions plugin/.prettierrc

This file was deleted.

63 changes: 44 additions & 19 deletions plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1068,30 +1068,32 @@ A marker is an icon placed at a particular point on the map's surface.

#### Point

| Prop | Type |
| ------- | ------------------- |
| **`x`** | <code>number</code> |
| **`y`** | <code>number</code> |
<a href="#point">Point</a> geometry object.
https://tools.ietf.org/html/rfc7946#section-3.1.2

| Prop | Type | Description |
| ----------------- | --------------------------------------------- | ------------------------------------- |
| **`type`** | <code>'<a href="#point">Point</a>'</code> | Specifies the type of GeoJSON object. |
| **`coordinates`** | <code><a href="#position">Position</a></code> | |


#### Position

| Prop | Type | Description |
| ------------ | ------------------- | ----------- |
| **`line`** | <code>number</code> | &gt;= 1 |
| **`column`** | <code>number</code> | &gt;= 0 |
Comment on lines +1071 to +1085
Copy link
Contributor

@OS-pedrogustavobilro OS-pedrogustavobilro Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I think this is something that has resurfaced, that was originally fixed by #89. Perhaps the script I added no longer works with these updated dependencies?



#### Polygon

For web, all the javascript <a href="#polygon">Polygon</a> options are available as
Polygon extends google.maps.PolygonOptions.
For iOS and Android only the config options declared on <a href="#polygon">Polygon</a> are available.
<a href="#polygon">Polygon</a> geometry object.
https://tools.ietf.org/html/rfc7946#section-3.1.6

| Prop | Type | Description |
| ------------------- | ----------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`paths`** | <code>any[] \| MVCArray&lt;any&gt;</code> | The ordered sequence of coordinates that designates a closed loop. Unlike polylines, a polygon may consist of one or more paths. As a result, the paths property may specify one or more arrays of &lt;code&gt;<a href="#latlng">LatLng</a>&lt;/code&gt; coordinates. Paths are closed automatically; do not repeat the first vertex of the path as the last vertex. Simple polygons may be defined using a single array of &lt;code&gt;<a href="#latlng">LatLng</a>&lt;/code&gt;s. More complex polygons may specify an array of arrays. Any simple arrays are converted into &lt;code&gt;&lt;a href="#MVCArray"&gt;MVCArray&lt;/a&gt;&lt;/code&gt;s. Inserting or removing &lt;code&gt;<a href="#latlng">LatLng</a>&lt;/code&gt;s from the &lt;code&gt;MVCArray&lt;/code&gt; will automatically update the polygon on the map. |
| **`strokeColor`** | <code>string</code> | The stroke color. All CSS3 colors are supported except for extended named colors. |
| **`strokeOpacity`** | <code>number</code> | The stroke opacity between 0.0 and 1.0 |
| **`strokeWeight`** | <code>number</code> | The stroke width in pixels. |
| **`fillColor`** | <code>string</code> | The fill color. All CSS3 colors are supported except for extended named colors. |
| **`fillOpacity`** | <code>number</code> | The fill opacity between 0.0 and 1.0 |
| **`geodesic`** | <code>boolean</code> | When &lt;code&gt;true&lt;/code&gt;, edges of the polygon are interpreted as geodesic and will follow the curvature of the Earth. When &lt;code&gt;false&lt;/code&gt;, edges of the polygon are rendered as straight lines in screen space. Note that the shape of a geodesic polygon may appear to change when dragged, as the dimensions are maintained relative to the surface of the earth. |
| **`clickable`** | <code>boolean</code> | Indicates whether this &lt;code&gt;<a href="#polygon">Polygon</a>&lt;/code&gt; handles mouse events. |
| **`title`** | <code>string</code> | Title, a short description of the overlay. Some overlays, such as markers, will display the title on the map. The title is also the default accessibility text. Only available on iOS. |
| **`tag`** | <code>string</code> | |
| Prop | Type | Description |
| ----------------- | --------------------------------------------- | ------------------------------------- |
| **`type`** | <code>'<a href="#polygon">Polygon</a>'</code> | Specifies the type of GeoJSON object. |
| **`coordinates`** | <code>Position[][]</code> | |


#### Circle
Expand Down Expand Up @@ -1267,6 +1269,29 @@ The callback function to be called when map events are emitted.
<code>(data: T): void</code>


#### Position

A <a href="#position">Position</a> is an array of coordinates.
https://tools.ietf.org/html/rfc7946#section-3.1.1
Array should contain between two and three elements.
The previous GeoJSON specification allowed more elements (e.g., which could be used to represent M values),
but the current specification only allows X, Y, and (optionally) Z to be defined.

Note: the type will not be narrowed down to `[number, number] | [number, number, number]` due to
marginal benefits and the large impact of breaking change.

See previous discussions on the type narrowing:
- {@link https://github.com/DefinitelyTyped/DefinitelyTyped/pull/21590|Nov 2017}
- {@link https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/67773|Dec 2023}
- {@link https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/71441| Dec 2024}

One can use a
{@link https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates|user-defined type guard that returns a type predicate}
to determine if a position is a 2D or 3D position.

<code>number[]</code>


#### Marker

Supports markers of either either "legacy" or "advanced" types.
Expand Down
Loading
Loading