Skip to content

Commit 6416bab

Browse files
mbehrlichjelbourn
authored andcommitted
feat(google-maps): add google-map component skeleton (#16623)
1 parent 917871b commit 6416bab

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+515
-5
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
/src/material/core/util/** @jelbourn
5959

6060
# Miscellaneous components
61+
/src/google-maps/** @mbehrlich
6162
/src/youtube-player/** @nathantate
6263

6364
# CDK
@@ -141,6 +142,7 @@
141142
/src/dev-app/expansion/** @josephperrott
142143
/src/dev-app/focus-origin/** @mmalerba
143144
/src/dev-app/gestures/** @jelbourn
145+
/src/dev-app/google-map/** @mbehrlich
144146
/src/dev-app/grid-list/** @jelbourn
145147
/src/dev-app/icon/** @jelbourn
146148
/src/dev-app/input/** @mmalerba

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
"@angular/elements": "^8.1.0",
4747
"@angular/forms": "^8.1.0",
4848
"@angular/platform-browser": "^8.1.0",
49+
"@types/googlemaps": "^3.37.0",
4950
"@types/youtube": "^0.0.38",
5051
"@webcomponents/custom-elements": "^1.1.0",
5152
"core-js": "^2.6.1",

packages.bzl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ MATERIAL_SCSS_LIBS = [
8080
for p in MATERIAL_PACKAGES
8181
]
8282

83+
GOOGLE_MAPS_PACKAGES = [
84+
"google-map",
85+
]
86+
87+
GOOGLE_MAPS_TARGETS = ["//src/google-maps"] + ["//src/google-maps/%s" % p for p in GOOGLE_MAPS_PACKAGES]
88+
8389
MATERIAL_EXPERIMENTAL_PACKAGES = [
8490
"mdc-button",
8591
"mdc-card",
@@ -122,6 +128,7 @@ ROLLUP_GLOBALS = {
122128
"@angular/material": "ng.material",
123129
"@angular/material-experimental": "ng.materialExperimental",
124130
"@angular/youtube-player": "ng.youtubePlayer",
131+
"@angular/google-maps": "ng.googleMaps",
125132
}
126133

127134
# Rollup globals for cdk subpackages in the form of, e.g., {"@angular/cdk/table": "ng.cdk.table"}

src/dev-app/BUILD.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package(default_visibility = ["//visibility:public"])
22

33
load("@io_bazel_rules_sass//:defs.bzl", "sass_binary")
4-
load("//:packages.bzl", "CDK_EXPERIMENTAL_TARGETS", "CDK_TARGETS", "MATERIAL_EXPERIMENTAL_SCSS_LIBS", "MATERIAL_EXPERIMENTAL_TARGETS", "MATERIAL_TARGETS")
4+
load("//:packages.bzl", "CDK_EXPERIMENTAL_TARGETS", "CDK_TARGETS", "GOOGLE_MAPS_TARGETS", "MATERIAL_EXPERIMENTAL_SCSS_LIBS", "MATERIAL_EXPERIMENTAL_TARGETS", "MATERIAL_TARGETS")
55
load("//tools:defaults.bzl", "ng_module")
66
load("//tools:sass_generate_binaries.bzl", "sass_generate_binaries")
77

@@ -50,7 +50,7 @@ ng_module(
5050
"//src/material-experimental/mdc-slide-toggle",
5151
"//src/material-experimental/mdc-tabs",
5252
"//src/material-examples:examples",
53-
] + CDK_TARGETS + CDK_EXPERIMENTAL_TARGETS + MATERIAL_TARGETS + MATERIAL_EXPERIMENTAL_TARGETS,
53+
] + CDK_TARGETS + CDK_EXPERIMENTAL_TARGETS + MATERIAL_TARGETS + MATERIAL_EXPERIMENTAL_TARGETS + GOOGLE_MAPS_TARGETS,
5454
)
5555

5656
sass_binary(

src/dev-app/dev-app/dev-app-layout.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export class DevAppLayout {
4141
{name: 'Expansion Panel', route: '/expansion'},
4242
{name: 'Focus Origin', route: '/focus-origin'},
4343
{name: 'Gestures', route: '/gestures'},
44+
{name: 'Google Map', route: '/google-map'},
4445
{name: 'Grid List', route: '/grid-list'},
4546
{name: 'Icon', route: '/icon'},
4647
{name: 'Input', route: '/input'},

src/dev-app/dev-app/routes.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export const DEV_APP_ROUTES: Routes = [
4040
loadChildren: 'focus-origin/focus-origin-demo-module#FocusOriginDemoModule'
4141
},
4242
{path: 'gestures', loadChildren: 'gestures/gestures-demo-module#GesturesDemoModule'},
43+
{path: 'google-map', loadChildren: 'google-map/google-map-demo-module#GoogleMapDemoModule'},
4344
{path: 'grid-list', loadChildren: 'grid-list/grid-list-demo-module#GridListDemoModule'},
4445
{path: 'icon', loadChildren: 'icon/icon-demo-module#IconDemoModule'},
4546
{path: 'input', loadChildren: 'input/input-demo-module#InputDemoModule'},
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
8+
9+
import {CommonModule} from '@angular/common';
10+
import {HttpClientJsonpModule, HttpClientModule} from '@angular/common/http';
11+
import {NgModule} from '@angular/core';
12+
import {GoogleMapModule} from '@angular/google-maps/google-map';
13+
import {RouterModule} from '@angular/router';
14+
15+
import {GoogleMapDemo} from './google-map-demo';
16+
17+
@NgModule({
18+
imports: [
19+
CommonModule,
20+
GoogleMapModule,
21+
HttpClientJsonpModule,
22+
HttpClientModule,
23+
RouterModule.forChild([{path: '', component: GoogleMapDemo}]),
24+
],
25+
declarations: [GoogleMapDemo],
26+
})
27+
export class GoogleMapDemoModule {
28+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<google-map *ngIf="isReady"></google-map>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
8+
9+
import {Component} from '@angular/core';
10+
import {HttpClient} from '@angular/common/http';
11+
12+
/** Demo Component for @angular/google-maps/map */
13+
@Component({
14+
moduleId: module.id,
15+
selector: 'google-map-demo',
16+
templateUrl: 'google-map-demo.html',
17+
})
18+
export class GoogleMapDemo {
19+
isReady = false;
20+
21+
constructor(httpClient: HttpClient) {
22+
httpClient.jsonp('https://maps.googleapis.com/maps/api/js?', 'callback')
23+
.subscribe(() => {
24+
this.isReady = true;
25+
});
26+
}
27+
}

src/dev-app/system-config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,9 @@ System.config({
153153
'dist/packages/material-experimental/mdc-helpers/index.js',
154154
'@angular/material-experimental/popover-edit':
155155
'dist/packages/material-experimental/popover-edit/index.js',
156+
157+
'@angular/google-maps/google-map':
158+
'dist/packages/google-maps/google-map/index.js',
156159
},
157160
packages: {
158161
// Set the default extension for the root package, because otherwise the dev-app can't

0 commit comments

Comments
 (0)