Skip to content

Commit 710a189

Browse files
fix: Update docs and references for Polygon (#89)
1 parent 4fb47b5 commit 710a189

File tree

7 files changed

+737
-650
lines changed

7 files changed

+737
-650
lines changed

README.md

Lines changed: 20 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -979,30 +979,36 @@ A marker is an icon placed at a particular point on the map's surface.
979979

980980
#### Point
981981

982-
<a href="#point">Point</a> geometry object.
983-
https://tools.ietf.org/html/rfc7946#section-3.1.2
984-
985-
| Prop | Type | Description |
986-
| ----------------- | --------------------------------------------- | ------------------------------------- |
987-
| **`type`** | <code>'<a href="#point">Point</a>'</code> | Specifies the type of GeoJSON object. |
988-
| **`coordinates`** | <code><a href="#position">Position</a></code> | |
982+
| Prop | Type |
983+
| ------- | ------------------- |
984+
| **`x`** | <code>number</code> |
985+
| **`y`** | <code>number</code> |
989986

990987

991988
#### Polygon
992989

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

996-
| Prop | Type | Description |
997-
| ----------------- | --------------------------------------------- | ------------------------------------- |
998-
| **`type`** | <code>'<a href="#polygon">Polygon</a>'</code> | Specifies the type of GeoJSON object. |
999-
| **`coordinates`** | <code>Position[][]</code> | |
994+
| Prop | Type | Description |
995+
| ------------------- | ----------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
996+
| **`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. |
997+
| **`strokeColor`** | <code>string</code> | The stroke color. All CSS3 colors are supported except for extended named colors. |
998+
| **`strokeOpacity`** | <code>number</code> | The stroke opacity between 0.0 and 1.0 |
999+
| **`strokeWeight`** | <code>number</code> | The stroke width in pixels. |
1000+
| **`fillColor`** | <code>string</code> | The fill color. All CSS3 colors are supported except for extended named colors. |
1001+
| **`fillOpacity`** | <code>number</code> | The fill opacity between 0.0 and 1.0 |
1002+
| **`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. |
1003+
| **`clickable`** | <code>boolean</code> | Indicates whether this &lt;code&gt;<a href="#polygon">Polygon</a>&lt;/code&gt; handles mouse events. |
1004+
| **`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. |
1005+
| **`tag`** | <code>string</code> | |
10001006

10011007

10021008
#### Circle
10031009

10041010
For web, all the javascript <a href="#circle">Circle</a> options are available as
1005-
Polygon extends google.maps.CircleOptions.
1011+
Circle extends google.maps.CircleOptions.
10061012
For iOS and Android only the config options declared on <a href="#circle">Circle</a> are available.
10071013

10081014
| Prop | Type | Description |
@@ -1172,29 +1178,6 @@ The callback function to be called when map events are emitted.
11721178
<code>(data: T): void</code>
11731179

11741180

1175-
#### Position
1176-
1177-
A <a href="#position">Position</a> is an array of coordinates.
1178-
https://tools.ietf.org/html/rfc7946#section-3.1.1
1179-
Array should contain between two and three elements.
1180-
The previous GeoJSON specification allowed more elements (e.g., which could be used to represent M values),
1181-
but the current specification only allows X, Y, and (optionally) Z to be defined.
1182-
1183-
Note: the type will not be narrowed down to `[number, number] | [number, number, number]` due to
1184-
marginal benefits and the large impact of breaking change.
1185-
1186-
See previous discussions on the type narrowing:
1187-
- {@link https://github.com/DefinitelyTyped/DefinitelyTyped/pull/21590|Nov 2017}
1188-
- {@link https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/67773|Dec 2023}
1189-
- {@link https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/71441| Dec 2024}
1190-
1191-
One can use a
1192-
{@link https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates|user-defined type guard that returns a type predicate}
1193-
to determine if a position is a 2D or 3D position.
1194-
1195-
<code>number[]</code>
1196-
1197-
11981181
#### Marker
11991182

12001183
Supports markers of either either "legacy" or "advanced" types.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616
"ci:publish:dev": "lerna publish prerelease --conventional-commits --conventional-prerelease --preid dev-$(date +\"%Y%m%dT%H%M%S\") --force-publish --no-changelog --no-git-tag-version --dist-tag dev --no-push --yes"
1717
},
1818
"devDependencies": {
19-
"@capacitor/ios": "next",
19+
"@capacitor/ios": ">=7.0.0",
2020
"@types/node": "^20.11.25",
21+
"glob": "^11.0.0",
2122
"husky": "^9.0.1",
2223
"lerna": "^8.1.2",
2324
"typescript": "^5.4.2"

0 commit comments

Comments
 (0)