You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/google-maps/README.md
+104-105
Original file line number
Diff line number
Diff line change
@@ -9,9 +9,6 @@ A plugin that allows you to use the [Maps SDK](https://developers.google.com/map
9
9
*[Use @nativescript/google-maps with Core](#use-nativescriptgoogle-maps-with-core)
10
10
* [Use @nativescript/google-maps with Angular](#use-nativescriptgoogle-maps-with-angular)
11
11
* [Use @nativescript/google-maps with Vue](#use-nativescriptgoogle-maps-with-vue)
12
-
* [Control the camera](#control-the-camera)
13
-
* [Set the map type](#set-the-map-type)
14
-
* [Styling The Map](#styling-the-map)
15
12
16
13
*[API](#api)
17
14
* [MapView Class](#mapview-class)
@@ -20,10 +17,14 @@ A plugin that allows you to use the [Maps SDK](https://developers.google.com/map
20
17
* [GoogleMap Object](#googlemap-object)
21
18
* [Properties](#properties)
22
19
* [Methods](#methods)
23
-
* [Camera Position](#camera-position)
24
-
* [Projection](#projection)
25
-
* [UISettings](#uisettings-interface)
26
-
* [MapType enum](#maptype-enum)
20
+
* [Control the camera](#control-the-camera)
21
+
* [Camera Position](#camera-position)
22
+
* [Projection](#projection)
23
+
* [Map Customization](#map-customization)
24
+
* [UISettings](#uisettings-interface)
25
+
* [Setting the map type](#setting-the-map-type)
26
+
* [MapType enum](#maptype-enum)
27
+
* [Styling The Map](#styling-the-map)
27
28
* [Markers](#markers)
28
29
* [Adding Markers](#adding-markers)
29
30
* [Marker Object](#marker-object)
@@ -171,15 +172,6 @@ import { GoogleMapsModule } from '@nativescript/google-maps/angular';
171
172
```
172
173
2. Add [MapView](#mapview-class) to your markup.
173
174
174
-
```html
175
-
<MapView
176
-
(mapTap)="onTap($event)"
177
-
(mapLongPress)="onLongPress($event)"
178
-
(markerTap)="onMarkerTap($event)"
179
-
>
180
-
</MapView>
181
-
```
182
-
3. Manage
183
175
```html
184
176
<MapView
185
177
(ready)="onReady($event)"
@@ -228,76 +220,7 @@ app.use(GoogleMaps)
228
220
229
221
3. To manage the mapping features, listen to the map view's `ready` event and get the reference to the [GoogleMap](#googlemap-object) instance from the event data.
230
222
231
-
### Control the camera
232
-
233
-
To programmatically update the camera position, call the `animateCamera()` method on the `GoogleMap` object and pass it a [CameraUpdate](#cameraupdate-class) instance.
See [CameraUpdate](#cameraupdate-class) for more methods you can call and pass to the `animateCamera()` method.
258
-
259
-
### Styling the map
260
-
261
-
You can style the map's items, such as roads, parks, businesses, and other points of interest.
262
-
263
-
Styling works only on the [normal](#maptype-enum) map type. Styling does not affect indoor maps.
264
-
265
-
To style your map, use a JSON file generated by the [Google Maps APIs Styling Wizard](https://mapstyle.withgoogle.com). In addition to changing the appearance of features, you can also hide features completely.
266
-
```json
267
-
[
268
-
{
269
-
"featureType": "all",
270
-
"stylers": [
271
-
{ "color": "#C0C0C0" }
272
-
]
273
-
},{
274
-
"featureType": "road.arterial",
275
-
"elementType": "geometry",
276
-
"stylers": [
277
-
{ "color": "#CCFFFF" }
278
-
]
279
-
},{
280
-
"featureType": "landscape",
281
-
"elementType": "labels",
282
-
"stylers": [
283
-
{ "visibility": "off" }
284
-
]
285
-
}
286
-
]
287
-
```
288
-
To apply a custom style to your map you can set the `mapStyle` property on your `GoogleMap` object:
@@ -348,13 +271,14 @@ The following properties are available for adjusting the camera view on initiali
348
271
349
272
### GoogleMap Object
350
273
351
-
This class provides the mapping features and its instance is available from the [MapView](#mapview-class)instance's `ready`[event](#events):
274
+
This class encapsulates the core, cross-platform mapping features. Its instance is made available when the [MapView](#mapview-class)fires the `ready`[event](#events), and this is where you'll perform the majority of your mapping tasks.
@@ -395,6 +319,24 @@ function onReady(event: MapReadyEvent) {
395
319
396
320
consult the appropriate SDK reference on how to use it: [iOS](https://developers.google.com/maps/documentation/ios-sdk/reference/interface_g_m_s_map_view) | [Android](https://developers.google.com/android/reference/com/google/android/gms/maps/GoogleMap)
397
321
322
+
## Control the camera
323
+
324
+
To programmatically update the camera position, call the `animateCamera()` method on the `GoogleMap` object and pass it a [CameraUpdate](#cameraupdate-class) instance.
The Google Maps API offers the following five types of maps:
@@ -461,9 +416,52 @@ The Google Maps API offers the following five types of maps:
461
416
| `Terrain` | Topographic data. The map includes colors, contour lines and labels, and perspective shading. Some roads and labels are also visible.
462
417
| `Hybrid` | Satellite photograph data with road maps added. Road and feature labels are also visible.
463
418
464
-
### Markers
419
+
### Styling the map
420
+
421
+
You can style the map's items, such as roads, parks, businesses, and other points of interest.
422
+
423
+
Styling works only on the [normal](#maptype-enum) map type. Styling does not affect indoor maps.
424
+
425
+
To style your map, use a JSON file generated by the [Google Maps APIs Styling Wizard](https://mapstyle.withgoogle.com). In addition to changing the appearance of features, you can also hide features completely.
426
+
```json
427
+
[
428
+
{
429
+
"featureType": "all",
430
+
"stylers": [
431
+
{ "color": "#C0C0C0" }
432
+
]
433
+
},{
434
+
"featureType": "road.arterial",
435
+
"elementType": "geometry",
436
+
"stylers": [
437
+
{ "color": "#CCFFFF" }
438
+
]
439
+
},{
440
+
"featureType": "landscape",
441
+
"elementType": "labels",
442
+
"stylers": [
443
+
{ "visibility": "off" }
444
+
]
445
+
}
446
+
]
447
+
```
448
+
To apply a custom style to your map you can set the `mapStyle` property on your `GoogleMap` object:
| `anchorV` | `number` | Vertical icon offset from the marker position
500
498
| `userData` | `any` | Additional information assigned to the marker
501
499
| `zIndex` | `number` | Z-index of the marker
502
-
### Coordinate
500
+
501
+
#### Coordinate
503
502
| Property | Type
504
503
|:---------|:----
505
504
| `lat` | `number`
506
505
| `lng` | `number`
507
506
508
-
####Removing Markers
507
+
### Removing Markers
509
508
510
509
To remove a marker from the map, call the `removeMarker()` method on the [GoogleMap](#googlemap-object) instance and pass it the marker to be removed.
511
510
@@ -514,7 +513,8 @@ function removeMarker(map: GoogleMap, marker: Marker) {
514
513
map.removeMarker(marker);
515
514
}
516
515
```
517
-
### Circles
516
+
517
+
## Circles
518
518
519
519
### Adding Circles
520
520
@@ -541,7 +541,7 @@ function addCircle(map: GoogleMap, circleOptions: CircleOptions): Circle {
541
541
`zIndex` | `number` |
542
542
`userData` | `{ [key: string]: any }` |
543
543
544
-
####Removing Circles
544
+
### Removing Circles
545
545
546
546
You can remove a circle using the [GoogleMap](#googlemap-object)'s `removeCircle()` method.
547
547
@@ -550,8 +550,8 @@ function removeCircle(map: GoogleMap, circle: Circle) {
550
550
map.removeCircle(circle);
551
551
}
552
552
```
553
-
###Polygons
554
-
####Adding Polygons
553
+
## Polygons
554
+
### Adding Polygons
555
555
556
556
You can create polygons using the [GoogleMap](#googlemap-object)'s object `addPolygon()` method by passing in the specified [PolygonOptions](#polygonoptions).
@@ -587,8 +587,8 @@ function removePolygon(map: GoogleMap, polygon: Polygon) {
587
587
}
588
588
```
589
589
590
-
###Polylines
591
-
#####Adding Polylines
590
+
## Polylines
591
+
### Adding Polylines
592
592
593
593
You can create Polylines using the [GoogleMap](#googlemap-object)'s object `addPolyline` function by passing it a [PolylineOptions](#polylineoptions) object.
594
594
@@ -614,7 +614,7 @@ function addPolyline(map: GoogleMap, polylineOptions: PolylineOptions): Polyline
614
614
|`endCap`| Cap & Partial\<NativeObject\>|
615
615
|`userData`|`{ [key: string]: any }`|
616
616
617
-
####Removing Polylines
617
+
### Removing Polylines
618
618
619
619
You can remove a Polyline using the [GoogleMap](#googlemap-object)'s `removePolyline` function, like so:
620
620
@@ -624,8 +624,8 @@ function removePolyline(map: GoogleMap, polyline: Polyline) {
624
624
}
625
625
```
626
626
627
-
###Ground Overlays
628
-
#####Adding Ground Overlays
627
+
## Ground Overlays
628
+
### Adding Ground Overlays
629
629
630
630
You can create Ground Overlays using the [GoogleMap](#googlemap-object)'s object `addGroundOverlay` function by passing in the specified [GroundOverlay Options](#groundoverlayoptions).
631
631
@@ -652,7 +652,7 @@ function addGroundOverlay(map: GoogleMap, groundOverlayOptions: GroundOverlayOpt
652
652
`anchorU` | `number` |
653
653
`anchorV` | `number` |
654
654
655
-
####Removing Ground Overlays
655
+
### Removing Ground Overlays
656
656
657
657
You can remove a GroundOverlay using the [GoogleMap](#googlemap-object)'s `removeGroundOverlay` function, like so:
658
658
@@ -663,9 +663,8 @@ function removeGroundOverlay(map: GoogleMap, groundOverlay: GroundOverlay) {
663
663
```
664
664
665
665
666
-
667
666
## Tile Overlays
668
-
####Adding Tile Overlays
667
+
### Adding Tile Overlays
669
668
670
669
You can create Tile Overlays using the [GoogleMap](#googlemap-object)'s object `addTileOverlay` function by passing in the specified [TileOverlay Options](#tileoverlayoptions).
671
670
@@ -687,7 +686,7 @@ function addTileOverlay(map: GoogleMap, tileOverlayOptions: TileOverlayOptions):
687
686
688
687
Setting tile overlay options after the tile overlay has been added to the map can have no effect on the tile overlay. To update the tile overlay, you may need to call `clearTileCache()`.
689
688
690
-
####Removing Tile Overlays
689
+
### Removing Tile Overlays
691
690
692
691
You can remove a TileOverlay using the [GoogleMap](#googlemap-object)'s `removeTileOverlay` function, like so:
693
692
@@ -697,7 +696,7 @@ function removeTileOverlay(map: GoogleMap, tileOverlay: TileOverlay) {
697
696
}
698
697
```
699
698
700
-
####Tile Providers
699
+
## Tile Providers
701
700
702
701
Tile providers are objects that provide tiles to be used in a Tile Overlay.
0 commit comments