From a1a17a624a792784bc52e5fc87c3df76c65c55a5 Mon Sep 17 00:00:00 2001 From: Ephraim Khantsis Date: Tue, 5 Nov 2019 16:30:23 +0200 Subject: [PATCH] feat: support google maps drawing library (#1749) Add Drawing library to support DrawingManager --- README.md | 3 +- docs/content/api-docs/index.md | 10 +- docs/content/guides/drawing/drawing.md | 63 ++++++ package.json | 13 +- packages/core/directives/marker.ts | 4 +- packages/core/index.ts | 3 - packages/core/map-types.ts | 24 +++ packages/drawing/LICENSE | 1 + packages/drawing/README.md | 52 +++++ .../directives/drawing-manager-trigger.ts | 26 +++ .../drawing/directives/drawing-manager.ts | 199 ++++++++++++++++++ packages/drawing/drawing.module.ts | 12 ++ packages/drawing/google-drawing-types.ts | 19 ++ packages/drawing/index.ts | 4 + packages/drawing/package.json | 26 +++ packages/drawing/tsconfig.compodoc.json | 25 +++ scripts/packages.js | 1 + 17 files changed, 470 insertions(+), 15 deletions(-) create mode 100644 docs/content/guides/drawing/drawing.md create mode 100644 packages/drawing/LICENSE create mode 100644 packages/drawing/README.md create mode 100644 packages/drawing/directives/drawing-manager-trigger.ts create mode 100644 packages/drawing/directives/drawing-manager.ts create mode 100644 packages/drawing/drawing.module.ts create mode 100644 packages/drawing/google-drawing-types.ts create mode 100644 packages/drawing/index.ts create mode 100644 packages/drawing/package.json create mode 100644 packages/drawing/tsconfig.compodoc.json diff --git a/README.md b/README.md index 4f9b0b1a0..416a4b6fd 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ This project is a mono repo and hosts multiple packages: | @agm/core | [![@agm/core](https://img.shields.io/npm/dm/@agm/core.svg)](https://www.npmjs.com/package/@agm/core) | | @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) | | @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) | +| @agm/drawing | [![@agm/drawing](https://img.shields.io/npm/dm/@agm/drawing.svg)](https://www.npmjs.com/package/@agm/drawing) | --- @@ -34,7 +35,7 @@ If you just want to play with AGM and don't want to set up a full project, you c ## Installation -`AGM` gets shipped via the Node Package Manager. So make sure that you have [NodeJS](https://nodejs.org) installed. +`AGM` gets shipped via the Node Package Manager. So make sure that you have [NodeJS](https://nodejs.org) installed. You can install the package with the following command: ```shell diff --git a/docs/content/api-docs/index.md b/docs/content/api-docs/index.md index 1377a14df..ea81b004c 100644 --- a/docs/content/api-docs/index.md +++ b/docs/content/api-docs/index.md @@ -6,9 +6,11 @@ title = "API Docs for Angular Google Maps" **Here you find the API docs for the @agm Packages:** -* [@agm/core](https://angular-maps.com/api-docs/agm-core/modules/AgmCoreModule.html) +* [@agm/core](https://angular-maps.com/api-docs/agm-core/modules/AgmCoreModule.html) Provides Angular integration solutions for the official Google Maps Core API v3 -* [@agm/snazzy-info-window](https://angular-maps.com/api-docs/agm-snazzy-info-window/modules/AgmSnazzyInfoWindowModule.html) +* [@agm/snazzy-info-window](https://angular-maps.com/api-docs/agm-snazzy-info-window/modules/AgmSnazzyInfoWindowModule.html) Styled Info Windows with [Snazzy Info Window](https://github.com/atmist/snazzy-info-window) -* [@agm/js-marker-clusterer](https://angular-maps.com/api-docs/js-marker-clusterer/modules/AgmJsMarkerClustererModule.html) - Clustered markers with [googlemaps/js-marker-clusterer](https://github.com/googlemaps/js-marker-clusterer) \ No newline at end of file +* [@agm/js-marker-clusterer](https://angular-maps.com/api-docs/js-marker-clusterer/modules/AgmJsMarkerClustererModule.html) + Clustered markers with [googlemaps/js-marker-clusterer](https://github.com/googlemaps/js-marker-clusterer) +* [@agm/drawing](https://angular-maps.com/api-docs/drawing/modules/AgmDrawingModule.html) + Drawing on the map with diff --git a/docs/content/guides/drawing/drawing.md b/docs/content/guides/drawing/drawing.md new file mode 100644 index 000000000..4d5c0117c --- /dev/null +++ b/docs/content/guides/drawing/drawing.md @@ -0,0 +1,63 @@ ++++ +date = "2017-08-31T13:51:15-05:00" +draft = false +title = "google.maps.drawing.DrawingManager in AGM" ++++ + +Angular Google Maps provides a package that allows users to draw new shapes on the map, integrating google.maps.drawing.DrawingManager + +## Install the needed packages +First make sure that you install the following NPM packages: + +```bash +npm install @agm/core @agm/drawing +``` + +## Loading the modules + +Update your root component (e.g. src/app/app.module.ts) and import the following modules: + +```typescript +import { AgmCoreModule } from '@agm/core'; +import { AgmDrawingModule } from '@agm/drawing'; + +@NgModule({ + declarations: [ + AppComponent + ], + imports: [ + BrowserModule, + AgmCoreModule.forRoot({ + apiKey: ['YOUR_API_KEY_HERE'] + }), + AgmDrawingModule + ], + providers: [], + bootstrap: [AppComponent] +}) +export class AppModule { } +``` + +## Using the directive + +When you import the `AgmDrawingManager`, you can use the `agm-drawing-manager` directive in your +template. Agm-drawing-manager takes form of an html elements outside the `agm-map` component, where +it is configured with properties. It is connected to the map via `agmDrawingManager` trigger +directive, similar to MatAutocomplete from angular/components library. + +```html + + + +``` + +### Customizing drawn figures + +If you want to control how the figures the user draws will look like, specifically colors, +line thickness, opacity, et cetera, you can provide CircleOptions or PolylineOptions +to the drawing manager, similar how you would do in vanilla javascript with Google Maps javascript. + +### Ignored properties + +These \*Options interfaces are originally made for the developer displaying the shapes, so they have +properties useless to us such as `map` and `center`. These properties are ignored. diff --git a/package.json b/package.json index 721321f05..800e37dc3 100644 --- a/package.json +++ b/package.json @@ -20,16 +20,18 @@ "packages": [ "packages/core", "packages/js-marker-clusterer", - "packages/snazzy-info-window" + "packages/snazzy-info-window", + "packages/drawing-manager" ], "scripts": { "clean": "rimraf dist node_modules/@agm 'packages/**/*.ngfactory.ts' && mkdirp dist", "prebuild": "yarn clean", "build": "yarn lint && yarn build:all", - "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", + "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", "build:core": "ng-packagr -p packages/core/package.json", "build:js-marker-clusterer": "ng-packagr -p packages/js-marker-clusterer/package.json", "build:snazzy-info-window": "ng-packagr -p packages/snazzy-info-window/package.json", + "build:drawing": "ng-packagr -p packages/drawing/package.json", "lint": "tslint --project tsconfig.json -c tslint.json 'packages/**/*.ts'", "packagejson": "node ./scripts/update-package-json.js", "clang:format": "clang-format --glob=packages/**/*.ts -i", @@ -39,10 +41,11 @@ "docs:clean": "rimraf docs/public", "docs:hugo": "cd docs && hugo", "docs:injectga": "node scripts/inject-google-analytics.js", - "docs": "yarn docs:hugo && yarn apidocs:core && yarn apidocs:snazzy && yarn apidocs:jsmarkerclusterer", + "docs": "yarn docs:hugo && yarn apidocs:core && yarn apidocs:snazzy && yarn apidocs:jsmarkerclusterer && yarn apidocs:drawing", "apidocs:core": "compodoc -p packages/core/tsconfig.compodoc.json --name @agm/core --output docs/public/api-docs/agm-core/ --hideGenerator --disableCoverage", "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", - "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" + "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", + "apidocs:drawing": "compodoc -p packages/drawing/tsconfig.compodoc.json --name @agm/drawing --output docs/public/api-docs/drawing/ --hideGenerator --disableCoverage" }, "author": "Sebastian Holstein ", "license": "MIT", @@ -97,4 +100,4 @@ "dependencies": { "yarn": "^1.17.3" } -} \ No newline at end of file +} diff --git a/packages/core/directives/marker.ts b/packages/core/directives/marker.ts index 9eb400566..4e716a357 100644 --- a/packages/core/directives/marker.ts +++ b/packages/core/directives/marker.ts @@ -1,6 +1,6 @@ import { AfterContentInit, ContentChildren, Directive, EventEmitter, forwardRef, Input, OnChanges, OnDestroy, Output, QueryList, SimpleChange } from '@angular/core'; import { Observable, ReplaySubject, Subscription } from 'rxjs'; -import { MarkerLabel, MouseEvent } from '../map-types'; +import { MouseEvent } from '../map-types'; import { FitBoundsAccessor, FitBoundsDetails } from '../services/fit-bounds'; import * as mapTypes from '../services/google-maps-types'; import { MarkerManager } from '../services/managers/marker-manager'; @@ -61,7 +61,7 @@ export class AgmMarker implements OnDestroy, OnChanges, AfterContentInit, FitBou /** * The label (a single uppercase character) for the marker. */ - @Input() label: string | MarkerLabel; + @Input() label: string | mapTypes.MarkerLabel; /** * If true, the marker can be dragged. Default value is false. diff --git a/packages/core/index.ts b/packages/core/index.ts index c07322e27..b8fc4edbb 100644 --- a/packages/core/index.ts +++ b/packages/core/index.ts @@ -3,9 +3,6 @@ export * from './directives'; export * from './services'; export * from './map-types'; -// Google Maps types -export { LatLngBounds, LatLng, LatLngLiteral, MapTypeStyle, Padding, PolyMouseEvent } from './services/google-maps-types'; - // core module // we explicitly export the module here to prevent this Ionic 2 bug: // http://stevemichelotti.com/integrate-angular-2-google-maps-into-ionic-2/ diff --git a/packages/core/map-types.ts b/packages/core/map-types.ts index 76e3393a0..217fd6373 100644 --- a/packages/core/map-types.ts +++ b/packages/core/map-types.ts @@ -18,6 +18,30 @@ export { GeocoderRequest, GeocoderResult, GeocoderStatus, + MapTypeStyle, + Padding, + ControlPosition, + OverviewMapControlOptions, + PanControlOptions, + RotateControlOptions, + MapTypeControlOptions, + MapTypeId, + ScaleControlOptions, + ScaleControlStyle, + StreetViewControlOptions, + ZoomControlOptions, + ZoomControlStyle, + FullscreenControlOptions, + CircleOptions, + Circle, + Polyline, + PolylineOptions, + Polygon, + PolygonOptions, + Rectangle, + RectangleOptions, + Marker, + MarkerOptions, } from './services/google-maps-types'; /** diff --git a/packages/drawing/LICENSE b/packages/drawing/LICENSE new file mode 100644 index 000000000..30cff7403 --- /dev/null +++ b/packages/drawing/LICENSE @@ -0,0 +1 @@ +../../LICENSE \ No newline at end of file diff --git a/packages/drawing/README.md b/packages/drawing/README.md new file mode 100644 index 000000000..4af992136 --- /dev/null +++ b/packages/drawing/README.md @@ -0,0 +1,52 @@ +# Map Drawing for AGM + +----- + +this package adds drawing support to [AGM][agm]. + +## Installation + +```sh +npm install @agm/drawing +# or +yarn add @agm/drawing +``` + +## Usage + +1. Import the module + +```typescript +import { BrowserModule } from '@angular/platform-browser'; +import { NgModule } from '@angular/core'; +import { AppComponent } from './app.component +// add these imports +import { AgmCoreModule } from '@agm/core'; +import { AgmDrawingModule } from '@agm/drawing +@NgModule({ + declarations: [ + AppComponent + ], + imports: [ + BrowserModule, + AgmCoreModule.forRoot({ + apiKey: ['YOUR_API_KEY_HERE'] + }), + AgmDrawingModule + ], + providers: [], + bootstrap: [AppComponent] +}) +export class AppModule { } +``` +2. use it in your template + +```html + + + +``` + + +[drawing-manager]: https://developers.google.com/maps/documentation/javascript/reference/#drawing +[agm]: https://angular-maps.com/ diff --git a/packages/drawing/directives/drawing-manager-trigger.ts b/packages/drawing/directives/drawing-manager-trigger.ts new file mode 100644 index 000000000..fb9a89f5c --- /dev/null +++ b/packages/drawing/directives/drawing-manager-trigger.ts @@ -0,0 +1,26 @@ +import { AgmMap } from '@agm/core'; +import { AfterViewInit, Directive, Host, Input, OnDestroy } from '@angular/core'; +import { first } from 'rxjs/operators'; +import { AgmDrawingManager } from './drawing-manager'; + +@Directive({ + selector: 'agm-map[agmDrawingManager]', + exportAs: 'matDrawingManagerTrigger', +}) +export class AgmDrawingManagerTrigger implements AfterViewInit, OnDestroy{ + + /** The drawing manager to be attached to this trigger. */ + // tslint:disable-next-line: no-input-rename + @Input('agmDrawingManager') drawingManager: AgmDrawingManager; + + constructor(@Host() private _agmMap: AgmMap) { + } + + ngAfterViewInit(): void { + this._agmMap.mapReady.pipe(first()).subscribe(map => this.drawingManager.setMap(map)); + } + + ngOnDestroy() { + this._agmMap.mapReady.pipe(first()).subscribe(() => this.drawingManager.setMap(null)); + } +} diff --git a/packages/drawing/directives/drawing-manager.ts b/packages/drawing/directives/drawing-manager.ts new file mode 100644 index 000000000..844f8ecbd --- /dev/null +++ b/packages/drawing/directives/drawing-manager.ts @@ -0,0 +1,199 @@ +import { Circle, CircleOptions, GoogleMap, MapsEventListener, Marker, MarkerOptions, MVCObject, Polygon, PolygonOptions, Polyline, PolylineOptions, Rectangle, RectangleOptions } from '@agm/core/services/google-maps-types'; +import { Directive, EventEmitter, Input, isDevMode, NgZone, OnChanges, OnDestroy, Output, SimpleChanges } from '@angular/core'; +import { fromEventPattern, Observable, Subscription } from 'rxjs'; +import { DrawingControlOptions, OverlayCompleteEvent, OverlayType } from '../google-drawing-types'; + +declare var google: any; + +@Directive({ + selector: 'agm-drawing-manager', + exportAs: 'agmDrawingManager', +}) +export class AgmDrawingManager implements OnChanges, OnDestroy{ + + /** + * The enabled/disabled state of the drawing control. Defaults to `true`. + * + * @type {boolean} + */ + @Input() drawingControl: boolean; + + /** + * The DrawingManager's drawing mode, which defines the type of overlay to be + * added on the map. A drawing mode of null means that the user can interact + * with the map as normal, and clicks do not draw anything. + */ + @Input() drawingMode: OverlayType | null; + + /** + * The display options for the drawing control. + * + * @type {DrawingControlOptions} + */ + @Input() drawingControlOptions: DrawingControlOptions; + + /** + * Options to apply to any new circles created with this DrawingManager. + * The `center` and `radius` properties are ignored, and the `map` property of a + * new circle is always set to the DrawingManager's map. + * + * @type {CircleOptions} + */ + @Input() circleOptions: CircleOptions; + + /** + * Options to apply to any new markers created with this DrawingManager. + * The `position` property is ignored, and the `map` property of a new marker + * is always set to the DrawingManager's map. + * + * @type {MarkerOptions} + */ + @Input() markerOptions: MarkerOptions; + + /** + * Options to apply to any new polygons created with this DrawingManager. + * The `paths` property is ignored, and the map property of a new polygon is + * always set to the DrawingManager's map. + * + * @type {PolygonOptions} + */ + @Input() polygonOptions: PolygonOptions; + + /** + * Options to apply to any new polylines created with this DrawingManager. + * The `path` property is ignored, and the map property of a new polyline is + * always set to the DrawingManager's map. + * + * @type {PolylineOptions} + * @memberof AgmDrawingManager + */ + @Input() polylineOptions: PolylineOptions; + + /** + * Options to apply to any new rectangles created with this DrawingManager. + * The `bounds` property is ignored, and the map property of a new rectangle + * is always set to the DrawingManager's map. + * + * @type {RectangleOptions} + * @memberof AgmDrawingManager + */ + @Input() rectangeOptions: RectangleOptions; + + /** + * This event is fired when the user has finished drawing a circle. + */ + @Output() circleComplete = new EventEmitter(); + + /** + * This event is fired when the user has finished drawing a marker. + */ + @Output() markerComplete = new EventEmitter(); + + /** + * This event is fired when the user has finished drawing an overlay of any + * type. + */ + @Output() overlayComplete = new EventEmitter(); + + /** + * This event is fired when the user has finished drawing a polygon. + */ + @Output() polygonComplete = new EventEmitter(); + + /** + * This event is fired when the user has finished drawing a polyline. + */ + @Output() polylineComplete = new EventEmitter(); + + /** + * This event is fired when the user has finished drawing a rectangle. + */ + @Output() rectangleComplete = new EventEmitter(); + + private eventSubscriptions: Subscription[] = []; + + private drawingManager: any; + + constructor(private _zone: NgZone) { + } + + setMap(map: GoogleMap) { + if (!google.maps.drawing && isDevMode()) { + console.error('Cannot use drawing manager if drawing library is not ' + + 'loaded. To fix, add libraries: [\'drawing\'] to the ' + + 'lazyMapsAPILoaderConfig you passed to AgmCoreModule.forRoot'); + return; + } + if (map && !this.drawingManager) { + this.drawingManager = new google.maps.drawing.DrawingManager({ + map, + circleOptions: this.circleOptions, + markerOptions: this.markerOptions, + polygonOptions: this.polygonOptions, + polylineOptions: this.polylineOptions, + rectangeOptions: this.rectangeOptions, + drawingControl: this.drawingControl, + drawingControlOptions: this.drawingControlOptions, + drawingMode: this.drawingMode, + }); + this.initEvents(this.drawingManager); + } else if (!map && this.drawingManager) { + this.drawingManager.setMap(null); + } + // else do nothing + } + + initEvents(drawingManager: any) { + this.eventSubscriptions.push( + this.createMvcObservable('circlecomplete', drawingManager) + .subscribe(circle => this._zone.run(() => this.circleComplete.next(circle))) + ); + this.eventSubscriptions.push( + this.createMvcObservable('markercomplete', drawingManager) + .subscribe(marker => this._zone.run(() => this.markerComplete.next(marker))) + ); + this.eventSubscriptions.push( + this.createMvcObservable('polygoncomplete', drawingManager) + .subscribe(polygon => this._zone.run(() => this.polygonComplete.next(polygon))) + ); + this.eventSubscriptions.push( + this.createMvcObservable('polylinecomplete', drawingManager) + .subscribe(polyline => this._zone.run(() => this.polylineComplete.next(polyline))) + ); + this.eventSubscriptions.push( + this.createMvcObservable('overlaycomplete', drawingManager) + .subscribe(overlayevent => this._zone.run(() => this.overlayComplete.next(overlayevent))) + ); + this.eventSubscriptions.push( + this.createMvcObservable('rectanglecomplete', drawingManager) + .subscribe(rectangle => this._zone.run(() => this.rectangleComplete.next(rectangle))) + ); + } + + createMvcObservable(eventName: string, mvcObject: MVCObject): Observable { + return fromEventPattern( + handler => mvcObject.addListener(eventName, + (event?: E) => handler.apply(null, [event])), + (_handler: Function, evListener: MapsEventListener) => evListener.remove() + ); + } + + ngOnChanges(changes: SimpleChanges): void { + if (!this.drawingManager) { + return; + } + + const options = Object.entries(changes) + .map(([prop, change]) => [prop, change.currentValue]) + .reduce((obj: any, [propName, propValue]) => { + obj[propName] = propValue; + return obj; + }, {}); + this.drawingManager.setOptions(options); + } + + ngOnDestroy(): void { + this.eventSubscriptions.forEach(subscription => subscription.unsubscribe()); + } + +} diff --git a/packages/drawing/drawing.module.ts b/packages/drawing/drawing.module.ts new file mode 100644 index 000000000..7ed93f963 --- /dev/null +++ b/packages/drawing/drawing.module.ts @@ -0,0 +1,12 @@ +import { AgmCoreModule } from '@agm/core'; +import { NgModule } from '@angular/core'; +import { AgmDrawingManager } from './directives/drawing-manager'; +import { AgmDrawingManagerTrigger } from './directives/drawing-manager-trigger'; + +@NgModule({ + imports: [AgmCoreModule], + declarations: [AgmDrawingManager, AgmDrawingManagerTrigger], + exports: [AgmDrawingManager, AgmDrawingManagerTrigger], +}) +export class AgmDrawingModule { +} diff --git a/packages/drawing/google-drawing-types.ts b/packages/drawing/google-drawing-types.ts new file mode 100644 index 000000000..3b019acdb --- /dev/null +++ b/packages/drawing/google-drawing-types.ts @@ -0,0 +1,19 @@ +import { Circle, ControlPosition, Marker, Polygon, Polyline, Rectangle } from '@agm/core/services/google-maps-types'; + +export enum OverlayType { + CIRCLE = 'circle', + MARKER = 'marker', + POLYGONE = 'polygon', + POLYLINE = 'polyline', + RECTANGE = 'rectangle', +} + +export interface DrawingControlOptions { + drawingModes?: OverlayType[]; + position?: ControlPosition; +} + +export interface OverlayCompleteEvent { + overlay: Marker | Polygon | Polyline | Rectangle | Circle; + type: OverlayType; +} diff --git a/packages/drawing/index.ts b/packages/drawing/index.ts new file mode 100644 index 000000000..5bb526d69 --- /dev/null +++ b/packages/drawing/index.ts @@ -0,0 +1,4 @@ +export { AgmDrawingManager } from './directives/drawing-manager'; +export { AgmDrawingManagerTrigger } from './directives/drawing-manager-trigger'; +export { AgmDrawingModule } from './drawing.module'; +export * from './google-drawing-types'; diff --git a/packages/drawing/package.json b/packages/drawing/package.json new file mode 100644 index 000000000..60ba2eec0 --- /dev/null +++ b/packages/drawing/package.json @@ -0,0 +1,26 @@ +{ + "$schema": "../../node_modules/ng-packagr/package.schema.json", + "name": "@agm/drawing", + "description": "Angular Google Maps (AGM) extension for google maps drawing library", + "keywords": [ + "angular-google-maps", + "angular", + "google-maps", + "agm", + "map-drawing" + ], + "peerDependencies": { + "@angular/core": "^7.0.0 || ^8.0.0", + "@agm/core": "^1.0.0" + }, + "ngPackage": { + "lib": { + "entryFile": "./index.ts", + "umdId": "ngmaps.drawing", + "umdModuleIds": { + "@agm/core": "ngmaps.core" + } + }, + "dest": "../../dist/@agm/drawing" + } +} diff --git a/packages/drawing/tsconfig.compodoc.json b/packages/drawing/tsconfig.compodoc.json new file mode 100644 index 000000000..7b0185c06 --- /dev/null +++ b/packages/drawing/tsconfig.compodoc.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "es2015", + "target": "es5", + "noImplicitAny": true, + "experimentalDecorators": true, + "emitDecoratorMetadata": true, + "outDir": ".tmp/esm", + "baseUrl": ".", + "sourceMap": true, + "removeComments": false, + "moduleResolution": "node", + "declaration": true, + "lib": [ + "es2015", + "dom" + ], + "types": [ + "jasmine" + ], + "paths": { + "@agm/*": ["../packages/*"] + } + } +} diff --git a/scripts/packages.js b/scripts/packages.js index 1bc4a296c..957606d7f 100644 --- a/scripts/packages.js +++ b/scripts/packages.js @@ -3,6 +3,7 @@ const packages = [ 'core', 'snazzy-info-window', 'js-marker-clusterer', + 'drawing' ]; module.exports = packages;