Skip to content

Commit ee061b4

Browse files
committed
feat(google-maps): Add map-marker component
Make various fixes internal cleanup fixes. Change google-map-marker to map-marker. Use QueryList's changes property instead of a setter for ContentChildren.
1 parent d0c3ff4 commit ee061b4

20 files changed

+115
-135
lines changed

packages.bzl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ MATERIAL_SCSS_LIBS = [
8282

8383
GOOGLE_MAPS_PACKAGES = [
8484
"google-map",
85-
"google-map-marker",
8685
]
8786

8887
GOOGLE_MAPS_TARGETS = ["//src/google-maps"] + ["//src/google-maps/%s" % p for p in GOOGLE_MAPS_PACKAGES]

src/dev-app/google-map/BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ ng_module(
88
assets = ["google-map-demo.html"],
99
deps = [
1010
"//src/google-maps/google-map",
11-
"//src/google-maps/google-map-marker",
1211
"@npm//@angular/router",
1312
],
1413
)

src/dev-app/google-map/google-map-demo-module.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import {CommonModule} from '@angular/common';
1010
import {HttpClientJsonpModule, HttpClientModule} from '@angular/common/http';
1111
import {NgModule} from '@angular/core';
1212
import {GoogleMapModule} from '@angular/google-maps/google-map';
13-
import {GoogleMapMarkerModule} from '@angular/google-maps/google-map-marker';
1413
import {RouterModule} from '@angular/router';
1514

1615
import {GoogleMapDemo} from './google-map-demo';
@@ -19,7 +18,6 @@ import {GoogleMapDemo} from './google-map-demo';
1918
imports: [
2019
CommonModule,
2120
GoogleMapModule,
22-
GoogleMapMarkerModule,
2321
HttpClientJsonpModule,
2422
HttpClientModule,
2523
RouterModule.forChild([{path: '', component: GoogleMapDemo}]),

src/dev-app/google-map/google-map-demo.html

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@
44
[center]="center"
55
[zoom]="zoom"
66
(mapClick)="handleClick($event)"
7-
(mapMousemove)="handleMove($event)">
8-
<google-map-marker [position]="markerPosition"
7+
(mapMousemove)="handleMove($event)"
8+
(mapRightclick)="handleRightclick()">
9+
<map-marker></map-marker>
10+
<map-marker *ngFor="let markerPosition of markerPositions"
11+
[position]="markerPosition"
912
[options]="markerOptions"
10-
(mapClick)="clickMarker($event)"></google-map-marker>
13+
(mapClick)="clickMarker($event)"></map-marker>
1114
</google-map>
1215

1316
<div>Latitude: {{display?.lat}}</div>

src/dev-app/google-map/google-map-demo.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export class GoogleMapDemo {
2020

2121
center = {lat: 24, lng: 12};
2222
markerOptions = {draggable: false};
23-
markerPosition = {lat: 39.830205, lng: -77.232949};
23+
markerPositions: google.maps.LatLngLiteral[] = [];
2424
zoom = 4;
2525
display?: google.maps.LatLngLiteral;
2626

@@ -32,7 +32,7 @@ export class GoogleMapDemo {
3232
}
3333

3434
handleClick(event: google.maps.MouseEvent) {
35-
this.center = event.latLng.toJSON();
35+
this.markerPositions.push(event.latLng.toJSON());
3636
}
3737

3838
handleMove(event: google.maps.MouseEvent) {
@@ -43,4 +43,8 @@ export class GoogleMapDemo {
4343
console.log(this.markerOptions);
4444
this.markerOptions = {draggable: true};
4545
}
46+
47+
handleRightclick() {
48+
this.markerPositions.pop();
49+
}
4650
}

src/dev-app/system-config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ var MATERIAL_PACKAGES = [
5757

5858
var GOOGLE_MAPS_PACKAGES = [
5959
'google-map',
60-
'google-map-marker',
6160
];
6261

6362
var MATERIAL_EXPERIMENTAL_PACKAGES = [

src/google-maps/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ ng_module(
1212
),
1313
module_name = "@angular/google-maps",
1414
deps = ["//src/google-maps/%s" % p for p in GOOGLE_MAPS_PACKAGES] + [
15+
"//src/google-maps/map-marker",
1516
"@npm//@angular/core",
1617
"@npm//@types/googlemaps",
1718
],

src/google-maps/google-map-marker/google-map-marker.md

Whitespace-only changes.

src/google-maps/google-map-marker/public-api.ts

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/google-maps/google-map-marker/tsconfig-build.json

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)