Skip to content

Commit a1a17a6

Browse files
authoredNov 5, 2019
feat: support google maps drawing library (#1749)
Add Drawing library to support DrawingManager
1 parent 56a858e commit a1a17a6

17 files changed

+470
-15
lines changed
 

‎README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ This project is a mono repo and hosts multiple packages:
2323
| @agm/core | [![@agm/core](https://img.shields.io/npm/dm/@agm/core.svg)](https://www.npmjs.com/package/@agm/core) |
2424
| @agm/snazzy-info-window | [![@agm/snazzy-info-window](https://img.shields.io/npm/dm/@agm/snazzy-info-window.svg)](https://www.npmjs.com/package/@agm/snazzy-info-window) |
2525
| @agm/js-marker-clusterer | [![@agm/js-marker-clusterer](https://img.shields.io/npm/dm/@agm/js-marker-clusterer.svg)](https://www.npmjs.com/package/@agm/js-marker-clusterer) |
26+
| @agm/drawing | [![@agm/drawing](https://img.shields.io/npm/dm/@agm/drawing.svg)](https://www.npmjs.com/package/@agm/drawing) |
2627

2728
---
2829

@@ -34,7 +35,7 @@ If you just want to play with AGM and don't want to set up a full project, you c
3435

3536
## Installation
3637

37-
`AGM` gets shipped via the Node Package Manager. So make sure that you have [NodeJS](https://nodejs.org) installed.
38+
`AGM` gets shipped via the Node Package Manager. So make sure that you have [NodeJS](https://nodejs.org) installed.
3839
You can install the package with the following command:
3940

4041
```shell

‎docs/content/api-docs/index.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ title = "API Docs for Angular Google Maps"
66

77
**Here you find the API docs for the @agm Packages:**
88

9-
* [@agm/core](https://angular-maps.com/api-docs/agm-core/modules/AgmCoreModule.html)
9+
* [@agm/core](https://angular-maps.com/api-docs/agm-core/modules/AgmCoreModule.html)
1010
Provides Angular integration solutions for the official Google Maps Core API v3
11-
* [@agm/snazzy-info-window](https://angular-maps.com/api-docs/agm-snazzy-info-window/modules/AgmSnazzyInfoWindowModule.html)
11+
* [@agm/snazzy-info-window](https://angular-maps.com/api-docs/agm-snazzy-info-window/modules/AgmSnazzyInfoWindowModule.html)
1212
Styled Info Windows with [Snazzy Info Window](https://github.com/atmist/snazzy-info-window)
13-
* [@agm/js-marker-clusterer](https://angular-maps.com/api-docs/js-marker-clusterer/modules/AgmJsMarkerClustererModule.html)
14-
Clustered markers with [googlemaps/js-marker-clusterer](https://github.com/googlemaps/js-marker-clusterer)
13+
* [@agm/js-marker-clusterer](https://angular-maps.com/api-docs/js-marker-clusterer/modules/AgmJsMarkerClustererModule.html)
14+
Clustered markers with [googlemaps/js-marker-clusterer](https://github.com/googlemaps/js-marker-clusterer)
15+
* [@agm/drawing](https://angular-maps.com/api-docs/drawing/modules/AgmDrawingModule.html)
16+
Drawing on the map with
+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
+++
2+
date = "2017-08-31T13:51:15-05:00"
3+
draft = false
4+
title = "google.maps.drawing.DrawingManager in AGM"
5+
+++
6+
7+
Angular Google Maps provides a package that allows users to draw new shapes on the map, integrating google.maps.drawing.DrawingManager
8+
9+
## Install the needed packages
10+
First make sure that you install the following NPM packages:
11+
12+
```bash
13+
npm install @agm/core @agm/drawing
14+
```
15+
16+
## Loading the modules
17+
18+
Update your root component (e.g. src/app/app.module.ts) and import the following modules:
19+
20+
```typescript
21+
import { AgmCoreModule } from '@agm/core';
22+
import { AgmDrawingModule } from '@agm/drawing';
23+
24+
@NgModule({
25+
declarations: [
26+
AppComponent
27+
],
28+
imports: [
29+
BrowserModule,
30+
AgmCoreModule.forRoot({
31+
apiKey: ['YOUR_API_KEY_HERE']
32+
}),
33+
AgmDrawingModule
34+
],
35+
providers: [],
36+
bootstrap: [AppComponent]
37+
})
38+
export class AppModule { }
39+
```
40+
41+
## Using the directive
42+
43+
When you import the `AgmDrawingManager`, you can use the `agm-drawing-manager` directive in your
44+
template. Agm-drawing-manager takes form of an html elements outside the `agm-map` component, where
45+
it is configured with properties. It is connected to the map via `agmDrawingManager` trigger
46+
directive, similar to MatAutocomplete from angular/components library.
47+
48+
```html
49+
<agm-map style="height: 300px" [latitude]="51.673858" [longitude]="7.815982" [agmDrawingManager]="drawing">
50+
</agm-map>
51+
<agm-drawing-manager #drawing="agmDrawingManager" (circleComplete)="circleAdded($event)" [drawingMode]="'circle'" [circleOptions]="{fillColor:'red', radius: 150}"></agm-drawing-manager>
52+
```
53+
54+
### Customizing drawn figures
55+
56+
If you want to control how the figures the user draws will look like, specifically colors,
57+
line thickness, opacity, et cetera, you can provide CircleOptions or PolylineOptions
58+
to the drawing manager, similar how you would do in vanilla javascript with Google Maps javascript.
59+
60+
### Ignored properties
61+
62+
These \*Options interfaces are originally made for the developer displaying the shapes, so they have
63+
properties useless to us such as `map` and `center`. These properties are ignored.

‎package.json

+8-5
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,18 @@
2020
"packages": [
2121
"packages/core",
2222
"packages/js-marker-clusterer",
23-
"packages/snazzy-info-window"
23+
"packages/snazzy-info-window",
24+
"packages/drawing-manager"
2425
],
2526
"scripts": {
2627
"clean": "rimraf dist node_modules/@agm 'packages/**/*.ngfactory.ts' && mkdirp dist",
2728
"prebuild": "yarn clean",
2829
"build": "yarn lint && yarn build:all",
29-
"build:all": "yarn build:core && yarn packagejson && mkdirp node_modules/@agm/core && ncp dist/@agm/core node_modules/@agm/core && yarn build:js-marker-clusterer && yarn build:snazzy-info-window && yarn packagejson",
30+
"build:all": "yarn build:core && yarn packagejson && mkdirp node_modules/@agm/core && ncp dist/@agm/core node_modules/@agm/core && yarn build:js-marker-clusterer && yarn build:snazzy-info-window && yarn build:drawing && yarn packagejson",
3031
"build:core": "ng-packagr -p packages/core/package.json",
3132
"build:js-marker-clusterer": "ng-packagr -p packages/js-marker-clusterer/package.json",
3233
"build:snazzy-info-window": "ng-packagr -p packages/snazzy-info-window/package.json",
34+
"build:drawing": "ng-packagr -p packages/drawing/package.json",
3335
"lint": "tslint --project tsconfig.json -c tslint.json 'packages/**/*.ts'",
3436
"packagejson": "node ./scripts/update-package-json.js",
3537
"clang:format": "clang-format --glob=packages/**/*.ts -i",
@@ -39,10 +41,11 @@
3941
"docs:clean": "rimraf docs/public",
4042
"docs:hugo": "cd docs && hugo",
4143
"docs:injectga": "node scripts/inject-google-analytics.js",
42-
"docs": "yarn docs:hugo && yarn apidocs:core && yarn apidocs:snazzy && yarn apidocs:jsmarkerclusterer",
44+
"docs": "yarn docs:hugo && yarn apidocs:core && yarn apidocs:snazzy && yarn apidocs:jsmarkerclusterer && yarn apidocs:drawing",
4345
"apidocs:core": "compodoc -p packages/core/tsconfig.compodoc.json --name @agm/core --output docs/public/api-docs/agm-core/ --hideGenerator --disableCoverage",
4446
"apidocs:snazzy": "compodoc -p packages/snazzy-info-window/tsconfig.compodoc.json --name @agm/snazzy-info-window --output docs/public/api-docs/agm-snazzy-info-window/ --hideGenerator --disableCoverage",
45-
"apidocs:jsmarkerclusterer": "compodoc -p packages/js-marker-clusterer/tsconfig.compodoc.json --name @agm/js-marker-clusterer --output docs/public/api-docs/js-marker-clusterer/ --hideGenerator --disableCoverage"
47+
"apidocs:jsmarkerclusterer": "compodoc -p packages/js-marker-clusterer/tsconfig.compodoc.json --name @agm/js-marker-clusterer --output docs/public/api-docs/js-marker-clusterer/ --hideGenerator --disableCoverage",
48+
"apidocs:drawing": "compodoc -p packages/drawing/tsconfig.compodoc.json --name @agm/drawing --output docs/public/api-docs/drawing/ --hideGenerator --disableCoverage"
4649
},
4750
"author": "Sebastian Holstein <info@sebastian-holstein.de>",
4851
"license": "MIT",
@@ -97,4 +100,4 @@
97100
"dependencies": {
98101
"yarn": "^1.17.3"
99102
}
100-
}
103+
}

‎packages/core/directives/marker.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { AfterContentInit, ContentChildren, Directive, EventEmitter, forwardRef, Input, OnChanges, OnDestroy, Output, QueryList, SimpleChange } from '@angular/core';
22
import { Observable, ReplaySubject, Subscription } from 'rxjs';
3-
import { MarkerLabel, MouseEvent } from '../map-types';
3+
import { MouseEvent } from '../map-types';
44
import { FitBoundsAccessor, FitBoundsDetails } from '../services/fit-bounds';
55
import * as mapTypes from '../services/google-maps-types';
66
import { MarkerManager } from '../services/managers/marker-manager';
@@ -61,7 +61,7 @@ export class AgmMarker implements OnDestroy, OnChanges, AfterContentInit, FitBou
6161
/**
6262
* The label (a single uppercase character) for the marker.
6363
*/
64-
@Input() label: string | MarkerLabel;
64+
@Input() label: string | mapTypes.MarkerLabel;
6565

6666
/**
6767
* If true, the marker can be dragged. Default value is false.

‎packages/core/index.ts

-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ export * from './directives';
33
export * from './services';
44
export * from './map-types';
55

6-
// Google Maps types
7-
export { LatLngBounds, LatLng, LatLngLiteral, MapTypeStyle, Padding, PolyMouseEvent } from './services/google-maps-types';
8-
96
// core module
107
// we explicitly export the module here to prevent this Ionic 2 bug:
118
// http://stevemichelotti.com/integrate-angular-2-google-maps-into-ionic-2/

‎packages/core/map-types.ts

+24
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,30 @@ export {
1818
GeocoderRequest,
1919
GeocoderResult,
2020
GeocoderStatus,
21+
MapTypeStyle,
22+
Padding,
23+
ControlPosition,
24+
OverviewMapControlOptions,
25+
PanControlOptions,
26+
RotateControlOptions,
27+
MapTypeControlOptions,
28+
MapTypeId,
29+
ScaleControlOptions,
30+
ScaleControlStyle,
31+
StreetViewControlOptions,
32+
ZoomControlOptions,
33+
ZoomControlStyle,
34+
FullscreenControlOptions,
35+
CircleOptions,
36+
Circle,
37+
Polyline,
38+
PolylineOptions,
39+
Polygon,
40+
PolygonOptions,
41+
Rectangle,
42+
RectangleOptions,
43+
Marker,
44+
MarkerOptions,
2145
} from './services/google-maps-types';
2246

2347
/**

‎packages/drawing/LICENSE

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../LICENSE

‎packages/drawing/README.md

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Map Drawing for AGM
2+
3+
-----
4+
5+
this package adds drawing support to [AGM][agm].
6+
7+
## Installation
8+
9+
```sh
10+
npm install @agm/drawing
11+
# or
12+
yarn add @agm/drawing
13+
```
14+
15+
## Usage
16+
17+
1. Import the module
18+
19+
```typescript
20+
import { BrowserModule } from '@angular/platform-browser';
21+
import { NgModule } from '@angular/core';
22+
import { AppComponent } from './app.component
23+
// add these imports
24+
import { AgmCoreModule } from '@agm/core';
25+
import { AgmDrawingModule } from '@agm/drawing
26+
@NgModule({
27+
declarations: [
28+
AppComponent
29+
],
30+
imports: [
31+
BrowserModule,
32+
AgmCoreModule.forRoot({
33+
apiKey: ['YOUR_API_KEY_HERE']
34+
}),
35+
AgmDrawingModule
36+
],
37+
providers: [],
38+
bootstrap: [AppComponent]
39+
})
40+
export class AppModule { }
41+
```
42+
2. use it in your template
43+
44+
```html
45+
<agm-map style="height: 300px" [latitude]="51.673858" [longitude]="7.815982" [agmDrawingManager]="drawing">
46+
</agm-map>
47+
<agm-drawing-manager #drawing="agmDrawingManager" [drawingMode]="'circle'" [circleOptions]="{fillColor:'red', radius: 150}"></agm-drawing-manager>
48+
```
49+
50+
51+
[drawing-manager]: https://developers.google.com/maps/documentation/javascript/reference/#drawing
52+
[agm]: https://angular-maps.com/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { AgmMap } from '@agm/core';
2+
import { AfterViewInit, Directive, Host, Input, OnDestroy } from '@angular/core';
3+
import { first } from 'rxjs/operators';
4+
import { AgmDrawingManager } from './drawing-manager';
5+
6+
@Directive({
7+
selector: 'agm-map[agmDrawingManager]',
8+
exportAs: 'matDrawingManagerTrigger',
9+
})
10+
export class AgmDrawingManagerTrigger implements AfterViewInit, OnDestroy{
11+
12+
/** The drawing manager to be attached to this trigger. */
13+
// tslint:disable-next-line: no-input-rename
14+
@Input('agmDrawingManager') drawingManager: AgmDrawingManager;
15+
16+
constructor(@Host() private _agmMap: AgmMap) {
17+
}
18+
19+
ngAfterViewInit(): void {
20+
this._agmMap.mapReady.pipe(first()).subscribe(map => this.drawingManager.setMap(map));
21+
}
22+
23+
ngOnDestroy() {
24+
this._agmMap.mapReady.pipe(first()).subscribe(() => this.drawingManager.setMap(null));
25+
}
26+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
1+
import { Circle, CircleOptions, GoogleMap, MapsEventListener, Marker, MarkerOptions, MVCObject, Polygon, PolygonOptions, Polyline, PolylineOptions, Rectangle, RectangleOptions } from '@agm/core/services/google-maps-types';
2+
import { Directive, EventEmitter, Input, isDevMode, NgZone, OnChanges, OnDestroy, Output, SimpleChanges } from '@angular/core';
3+
import { fromEventPattern, Observable, Subscription } from 'rxjs';
4+
import { DrawingControlOptions, OverlayCompleteEvent, OverlayType } from '../google-drawing-types';
5+
6+
declare var google: any;
7+
8+
@Directive({
9+
selector: 'agm-drawing-manager',
10+
exportAs: 'agmDrawingManager',
11+
})
12+
export class AgmDrawingManager implements OnChanges, OnDestroy{
13+
14+
/**
15+
* The enabled/disabled state of the drawing control. Defaults to `true`.
16+
*
17+
* @type {boolean}
18+
*/
19+
@Input() drawingControl: boolean;
20+
21+
/**
22+
* The DrawingManager's drawing mode, which defines the type of overlay to be
23+
* added on the map. A drawing mode of null means that the user can interact
24+
* with the map as normal, and clicks do not draw anything.
25+
*/
26+
@Input() drawingMode: OverlayType | null;
27+
28+
/**
29+
* The display options for the drawing control.
30+
*
31+
* @type {DrawingControlOptions}
32+
*/
33+
@Input() drawingControlOptions: DrawingControlOptions;
34+
35+
/**
36+
* Options to apply to any new circles created with this DrawingManager.
37+
* The `center` and `radius` properties are ignored, and the `map` property of a
38+
* new circle is always set to the DrawingManager's map.
39+
*
40+
* @type {CircleOptions}
41+
*/
42+
@Input() circleOptions: CircleOptions;
43+
44+
/**
45+
* Options to apply to any new markers created with this DrawingManager.
46+
* The `position` property is ignored, and the `map` property of a new marker
47+
* is always set to the DrawingManager's map.
48+
*
49+
* @type {MarkerOptions}
50+
*/
51+
@Input() markerOptions: MarkerOptions;
52+
53+
/**
54+
* Options to apply to any new polygons created with this DrawingManager.
55+
* The `paths` property is ignored, and the map property of a new polygon is
56+
* always set to the DrawingManager's map.
57+
*
58+
* @type {PolygonOptions}
59+
*/
60+
@Input() polygonOptions: PolygonOptions;
61+
62+
/**
63+
* Options to apply to any new polylines created with this DrawingManager.
64+
* The `path` property is ignored, and the map property of a new polyline is
65+
* always set to the DrawingManager's map.
66+
*
67+
* @type {PolylineOptions}
68+
* @memberof AgmDrawingManager
69+
*/
70+
@Input() polylineOptions: PolylineOptions;
71+
72+
/**
73+
* Options to apply to any new rectangles created with this DrawingManager.
74+
* The `bounds` property is ignored, and the map property of a new rectangle
75+
* is always set to the DrawingManager's map.
76+
*
77+
* @type {RectangleOptions}
78+
* @memberof AgmDrawingManager
79+
*/
80+
@Input() rectangeOptions: RectangleOptions;
81+
82+
/**
83+
* This event is fired when the user has finished drawing a circle.
84+
*/
85+
@Output() circleComplete = new EventEmitter<Circle>();
86+
87+
/**
88+
* This event is fired when the user has finished drawing a marker.
89+
*/
90+
@Output() markerComplete = new EventEmitter<Marker>();
91+
92+
/**
93+
* This event is fired when the user has finished drawing an overlay of any
94+
* type.
95+
*/
96+
@Output() overlayComplete = new EventEmitter<OverlayCompleteEvent>();
97+
98+
/**
99+
* This event is fired when the user has finished drawing a polygon.
100+
*/
101+
@Output() polygonComplete = new EventEmitter<Polygon>();
102+
103+
/**
104+
* This event is fired when the user has finished drawing a polyline.
105+
*/
106+
@Output() polylineComplete = new EventEmitter<Polyline>();
107+
108+
/**
109+
* This event is fired when the user has finished drawing a rectangle.
110+
*/
111+
@Output() rectangleComplete = new EventEmitter<Rectangle>();
112+
113+
private eventSubscriptions: Subscription[] = [];
114+
115+
private drawingManager: any;
116+
117+
constructor(private _zone: NgZone) {
118+
}
119+
120+
setMap(map: GoogleMap) {
121+
if (!google.maps.drawing && isDevMode()) {
122+
console.error('Cannot use drawing manager if drawing library is not ' +
123+
'loaded. To fix, add libraries: [\'drawing\'] to the ' +
124+
'lazyMapsAPILoaderConfig you passed to AgmCoreModule.forRoot');
125+
return;
126+
}
127+
if (map && !this.drawingManager) {
128+
this.drawingManager = new google.maps.drawing.DrawingManager({
129+
map,
130+
circleOptions: this.circleOptions,
131+
markerOptions: this.markerOptions,
132+
polygonOptions: this.polygonOptions,
133+
polylineOptions: this.polylineOptions,
134+
rectangeOptions: this.rectangeOptions,
135+
drawingControl: this.drawingControl,
136+
drawingControlOptions: this.drawingControlOptions,
137+
drawingMode: this.drawingMode,
138+
});
139+
this.initEvents(this.drawingManager);
140+
} else if (!map && this.drawingManager) {
141+
this.drawingManager.setMap(null);
142+
}
143+
// else do nothing
144+
}
145+
146+
initEvents(drawingManager: any) {
147+
this.eventSubscriptions.push(
148+
this.createMvcObservable<Circle>('circlecomplete', drawingManager)
149+
.subscribe(circle => this._zone.run(() => this.circleComplete.next(circle)))
150+
);
151+
this.eventSubscriptions.push(
152+
this.createMvcObservable<Marker>('markercomplete', drawingManager)
153+
.subscribe(marker => this._zone.run(() => this.markerComplete.next(marker)))
154+
);
155+
this.eventSubscriptions.push(
156+
this.createMvcObservable<Polygon>('polygoncomplete', drawingManager)
157+
.subscribe(polygon => this._zone.run(() => this.polygonComplete.next(polygon)))
158+
);
159+
this.eventSubscriptions.push(
160+
this.createMvcObservable<Polyline>('polylinecomplete', drawingManager)
161+
.subscribe(polyline => this._zone.run(() => this.polylineComplete.next(polyline)))
162+
);
163+
this.eventSubscriptions.push(
164+
this.createMvcObservable<OverlayCompleteEvent>('overlaycomplete', drawingManager)
165+
.subscribe(overlayevent => this._zone.run(() => this.overlayComplete.next(overlayevent)))
166+
);
167+
this.eventSubscriptions.push(
168+
this.createMvcObservable<Rectangle>('rectanglecomplete', drawingManager)
169+
.subscribe(rectangle => this._zone.run(() => this.rectangleComplete.next(rectangle)))
170+
);
171+
}
172+
173+
createMvcObservable<E>(eventName: string, mvcObject: MVCObject): Observable<E> {
174+
return fromEventPattern(
175+
handler => mvcObject.addListener(eventName,
176+
(event?: E) => handler.apply(null, [event])),
177+
(_handler: Function, evListener: MapsEventListener) => evListener.remove()
178+
);
179+
}
180+
181+
ngOnChanges(changes: SimpleChanges): void {
182+
if (!this.drawingManager) {
183+
return;
184+
}
185+
186+
const options = Object.entries(changes)
187+
.map(([prop, change]) => [prop, change.currentValue])
188+
.reduce((obj: any, [propName, propValue]) => {
189+
obj[propName] = propValue;
190+
return obj;
191+
}, {});
192+
this.drawingManager.setOptions(options);
193+
}
194+
195+
ngOnDestroy(): void {
196+
this.eventSubscriptions.forEach(subscription => subscription.unsubscribe());
197+
}
198+
199+
}

‎packages/drawing/drawing.module.ts

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { AgmCoreModule } from '@agm/core';
2+
import { NgModule } from '@angular/core';
3+
import { AgmDrawingManager } from './directives/drawing-manager';
4+
import { AgmDrawingManagerTrigger } from './directives/drawing-manager-trigger';
5+
6+
@NgModule({
7+
imports: [AgmCoreModule],
8+
declarations: [AgmDrawingManager, AgmDrawingManagerTrigger],
9+
exports: [AgmDrawingManager, AgmDrawingManagerTrigger],
10+
})
11+
export class AgmDrawingModule {
12+
}
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { Circle, ControlPosition, Marker, Polygon, Polyline, Rectangle } from '@agm/core/services/google-maps-types';
2+
3+
export enum OverlayType {
4+
CIRCLE = 'circle',
5+
MARKER = 'marker',
6+
POLYGONE = 'polygon',
7+
POLYLINE = 'polyline',
8+
RECTANGE = 'rectangle',
9+
}
10+
11+
export interface DrawingControlOptions {
12+
drawingModes?: OverlayType[];
13+
position?: ControlPosition;
14+
}
15+
16+
export interface OverlayCompleteEvent {
17+
overlay: Marker | Polygon | Polyline | Rectangle | Circle;
18+
type: OverlayType;
19+
}

‎packages/drawing/index.ts

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export { AgmDrawingManager } from './directives/drawing-manager';
2+
export { AgmDrawingManagerTrigger } from './directives/drawing-manager-trigger';
3+
export { AgmDrawingModule } from './drawing.module';
4+
export * from './google-drawing-types';

‎packages/drawing/package.json

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"$schema": "../../node_modules/ng-packagr/package.schema.json",
3+
"name": "@agm/drawing",
4+
"description": "Angular Google Maps (AGM) extension for google maps drawing library",
5+
"keywords": [
6+
"angular-google-maps",
7+
"angular",
8+
"google-maps",
9+
"agm",
10+
"map-drawing"
11+
],
12+
"peerDependencies": {
13+
"@angular/core": "^7.0.0 || ^8.0.0",
14+
"@agm/core": "^1.0.0"
15+
},
16+
"ngPackage": {
17+
"lib": {
18+
"entryFile": "./index.ts",
19+
"umdId": "ngmaps.drawing",
20+
"umdModuleIds": {
21+
"@agm/core": "ngmaps.core"
22+
}
23+
},
24+
"dest": "../../dist/@agm/drawing"
25+
}
26+
}
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"compilerOptions": {
3+
"module": "es2015",
4+
"target": "es5",
5+
"noImplicitAny": true,
6+
"experimentalDecorators": true,
7+
"emitDecoratorMetadata": true,
8+
"outDir": ".tmp/esm",
9+
"baseUrl": ".",
10+
"sourceMap": true,
11+
"removeComments": false,
12+
"moduleResolution": "node",
13+
"declaration": true,
14+
"lib": [
15+
"es2015",
16+
"dom"
17+
],
18+
"types": [
19+
"jasmine"
20+
],
21+
"paths": {
22+
"@agm/*": ["../packages/*"]
23+
}
24+
}
25+
}

‎scripts/packages.js

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const packages = [
33
'core',
44
'snazzy-info-window',
55
'js-marker-clusterer',
6+
'drawing'
67
];
78

89
module.exports = packages;

0 commit comments

Comments
 (0)
Please sign in to comment.