From 0176f57bcb4a9e72204528a878f2512227d8ed36 Mon Sep 17 00:00:00 2001 From: Matthias Claes Date: Fri, 25 Jan 2019 11:01:06 +0100 Subject: [PATCH 1/9] Added optional parameter to the aui-leaflet-locate-control to specify the zoomlevel The parameter is optional and if no value is given it will take the value that was previously used as the default value --- packages/map/examples/src/map/pages/demo/demo.page.html | 2 +- packages/map/lib/src/leaflet/classes/leaflet-map.ts | 4 ++-- .../leaflet-locate-control.component.html | 2 +- .../leaflet-locate-control.component.ts | 5 ++++- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/map/examples/src/map/pages/demo/demo.page.html b/packages/map/examples/src/map/pages/demo/demo.page.html index 4285e5529..0cc7c3e79 100644 --- a/packages/map/examples/src/map/pages/demo/demo.page.html +++ b/packages/map/examples/src/map/pages/demo/demo.page.html @@ -25,7 +25,7 @@

Map

- +
diff --git a/packages/map/lib/src/leaflet/classes/leaflet-map.ts b/packages/map/lib/src/leaflet/classes/leaflet-map.ts index ce54b0670..a5cea24dd 100644 --- a/packages/map/lib/src/leaflet/classes/leaflet-map.ts +++ b/packages/map/lib/src/leaflet/classes/leaflet-map.ts @@ -119,13 +119,13 @@ export class LeafletMap { } // CENTERING - locate() { + locate(zoomlevel: number = 19) { if (!this.locating && this.initialized) { this.locating = true; this.map.locate(); this.map.on('locationfound', (e: any) => { this.locating = false; - this.map.setView(e.latlng, 19); + this.map.setView(e.latlng, zoomlevel); this.map.off('locationfound'); }); } diff --git a/packages/map/lib/src/leaflet/components/controls/leaflet-locate-control/leaflet-locate-control.component.html b/packages/map/lib/src/leaflet/components/controls/leaflet-locate-control/leaflet-locate-control.component.html index 565be50ef..1d1eb85a9 100644 --- a/packages/map/lib/src/leaflet/components/controls/leaflet-locate-control/leaflet-locate-control.component.html +++ b/packages/map/lib/src/leaflet/components/controls/leaflet-locate-control/leaflet-locate-control.component.html @@ -1 +1 @@ - + diff --git a/packages/map/lib/src/leaflet/components/controls/leaflet-locate-control/leaflet-locate-control.component.ts b/packages/map/lib/src/leaflet/components/controls/leaflet-locate-control/leaflet-locate-control.component.ts index cb8555627..27de786c8 100644 --- a/packages/map/lib/src/leaflet/components/controls/leaflet-locate-control/leaflet-locate-control.component.ts +++ b/packages/map/lib/src/leaflet/components/controls/leaflet-locate-control/leaflet-locate-control.component.ts @@ -1,11 +1,14 @@ -import { Component } from '@angular/core'; +import { Component, Input } from '@angular/core'; import { LeafletMap } from '../../../classes/leaflet-map'; + @Component({ selector: 'aui-leaflet-locate-control', templateUrl: './leaflet-locate-control.component.html', }) export class LeafletLocateControlComponent { map: LeafletMap; + + @Input() zoomlevel = 19; } From 27934645e54259613176da88cc037ec9366500fe Mon Sep 17 00:00:00 2001 From: Matthias Claes Date: Fri, 25 Jan 2019 11:25:17 +0100 Subject: [PATCH 2/9] Added changes to the README file --- packages/map/lib/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/map/lib/README.md b/packages/map/lib/README.md index dc4970891..8bc825866 100644 --- a/packages/map/lib/README.md +++ b/packages/map/lib/README.md @@ -67,7 +67,7 @@ public ngOnInit(): void {
- +
@@ -89,7 +89,7 @@ public ngOnInit(): void { - `zoomIn()`: Zoom in - `zoomOut()`: Zoom out - `toggleFullscreen()`: Toggle fullscreen -- `locate()`: Start zooming to current location +- `locate(zoomlevel)`: Start zooming to current location with the given zoomlevel - `setView(center, zoom)`: Zoom to the given center and zoom values. - `addMarker(position, options)`: Adds a marker to the given position. (see leaflet docs) - `addHTMLMarker`: Adds an HTML marker to the given position. From 134d18ef80323499eb5a44017572e9586cbad125 Mon Sep 17 00:00:00 2001 From: Matthias Claes Date: Fri, 25 Jan 2019 11:31:41 +0100 Subject: [PATCH 3/9] Updated changelog to reflect changes --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5481d6761..f81815fe2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ## Unreleased - `documentation` fixed the `utils/window` example +- `map` added possibility for users to specify zoomlevel when zooming to their current position on the `aui-leaflet-locate-control`. ### 2018-12-11 From ab6bc51fdf9f2d625fd190e50129005c85a5cd45 Mon Sep 17 00:00:00 2001 From: Matthias Claes Date: Thu, 31 Jan 2019 10:06:14 +0100 Subject: [PATCH 4/9] Changes based on pull request comments --- CHANGELOG.md | 2 +- packages/map/examples/src/map/pages/demo/demo.page.html | 2 +- packages/map/examples/src/map/pages/demo/demo.page.ts | 2 +- packages/map/lib/README.md | 2 +- packages/map/lib/src/leaflet/classes/leaflet-map.spec.ts | 4 ++-- packages/map/lib/src/leaflet/classes/leaflet-map.ts | 4 ++-- .../leaflet-locate-control.component.html | 2 +- .../leaflet-locate-control.component.ts | 4 +--- 8 files changed, 10 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f81815fe2..51bf31ddb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ## Unreleased - `documentation` fixed the `utils/window` example -- `map` added possibility for users to specify zoomlevel when zooming to their current position on the `aui-leaflet-locate-control`. +- `map` added possibility to set the zoom level of the `aui-leaflet-locate-control`. ### 2018-12-11 diff --git a/packages/map/examples/src/map/pages/demo/demo.page.html b/packages/map/examples/src/map/pages/demo/demo.page.html index 0cc7c3e79..cc66a9b34 100644 --- a/packages/map/examples/src/map/pages/demo/demo.page.html +++ b/packages/map/examples/src/map/pages/demo/demo.page.html @@ -25,7 +25,7 @@

Map

- +
diff --git a/packages/map/examples/src/map/pages/demo/demo.page.ts b/packages/map/examples/src/map/pages/demo/demo.page.ts index 0d08c6e1b..a4026e282 100644 --- a/packages/map/examples/src/map/pages/demo/demo.page.ts +++ b/packages/map/examples/src/map/pages/demo/demo.page.ts @@ -47,7 +47,7 @@ public ngOnInit(): void {
- +
diff --git a/packages/map/lib/README.md b/packages/map/lib/README.md index 8bc825866..038b1365e 100644 --- a/packages/map/lib/README.md +++ b/packages/map/lib/README.md @@ -89,7 +89,7 @@ public ngOnInit(): void { - `zoomIn()`: Zoom in - `zoomOut()`: Zoom out - `toggleFullscreen()`: Toggle fullscreen -- `locate(zoomlevel)`: Start zooming to current location with the given zoomlevel +- `locate(zoomLevel)`: Start zooming to current location with an optional zoom level - `setView(center, zoom)`: Zoom to the given center and zoom values. - `addMarker(position, options)`: Adds a marker to the given position. (see leaflet docs) - `addHTMLMarker`: Adds an HTML marker to the given position. diff --git a/packages/map/lib/src/leaflet/classes/leaflet-map.spec.ts b/packages/map/lib/src/leaflet/classes/leaflet-map.spec.ts index 7d4fd34f2..61d50cdf5 100644 --- a/packages/map/lib/src/leaflet/classes/leaflet-map.spec.ts +++ b/packages/map/lib/src/leaflet/classes/leaflet-map.spec.ts @@ -222,12 +222,12 @@ describe('The leaflet map', () => { }); it('should find the current location', () => { - map.locate(); + map.locate(16); expect(locateSpy).toHaveBeenCalled(); }); it('should zoom to the current location', () => { - map.locate(); + map.locate(16); expect(setViewSpy).toHaveBeenCalledWith(options.center, 19); }); }); diff --git a/packages/map/lib/src/leaflet/classes/leaflet-map.ts b/packages/map/lib/src/leaflet/classes/leaflet-map.ts index a5cea24dd..9730725d2 100644 --- a/packages/map/lib/src/leaflet/classes/leaflet-map.ts +++ b/packages/map/lib/src/leaflet/classes/leaflet-map.ts @@ -119,13 +119,13 @@ export class LeafletMap { } // CENTERING - locate(zoomlevel: number = 19) { + locate(zoomLevel: number) { if (!this.locating && this.initialized) { this.locating = true; this.map.locate(); this.map.on('locationfound', (e: any) => { this.locating = false; - this.map.setView(e.latlng, zoomlevel); + this.map.setView(e.latlng, zoomLevel); this.map.off('locationfound'); }); } diff --git a/packages/map/lib/src/leaflet/components/controls/leaflet-locate-control/leaflet-locate-control.component.html b/packages/map/lib/src/leaflet/components/controls/leaflet-locate-control/leaflet-locate-control.component.html index 1d1eb85a9..953129535 100644 --- a/packages/map/lib/src/leaflet/components/controls/leaflet-locate-control/leaflet-locate-control.component.html +++ b/packages/map/lib/src/leaflet/components/controls/leaflet-locate-control/leaflet-locate-control.component.html @@ -1 +1 @@ - + diff --git a/packages/map/lib/src/leaflet/components/controls/leaflet-locate-control/leaflet-locate-control.component.ts b/packages/map/lib/src/leaflet/components/controls/leaflet-locate-control/leaflet-locate-control.component.ts index 27de786c8..9b8f55550 100644 --- a/packages/map/lib/src/leaflet/components/controls/leaflet-locate-control/leaflet-locate-control.component.ts +++ b/packages/map/lib/src/leaflet/components/controls/leaflet-locate-control/leaflet-locate-control.component.ts @@ -1,8 +1,6 @@ import { Component, Input } from '@angular/core'; - import { LeafletMap } from '../../../classes/leaflet-map'; - @Component({ selector: 'aui-leaflet-locate-control', templateUrl: './leaflet-locate-control.component.html', @@ -10,5 +8,5 @@ import { LeafletMap } from '../../../classes/leaflet-map'; export class LeafletLocateControlComponent { map: LeafletMap; - @Input() zoomlevel = 19; + @Input() public zoomLevel = 19; } From c777649cbf04b44fd02c8d9ed77517b700ddfd31 Mon Sep 17 00:00:00 2001 From: Matthias Claes Date: Mon, 4 Feb 2019 17:19:12 +0100 Subject: [PATCH 5/9] Changes to Readme and Changelog --- CHANGELOG.md | 6 +----- packages/map/lib/README.md | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 668d45943..c460b087c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,18 +6,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ## Unreleased -<<<<<<< HEAD -- `documentation` fixed the `utils/window` example -- `map` added possibility to set the zoom level of the `aui-leaflet-locate-control`. -======= - `documentation` Fixed the `utils/window` example. - `code-snippet` Fixed an issue where the `code-snippet` was constantly looking for `pre` tags. - `calendar` Fixed a faulty unit test. +- `map` added possibility to set the zoom level of the `aui-leaflet-locate-control`. ### 2019-01-08 - `documentation` added info in the code-snippet documentation about how to use highlight.js ->>>>>>> 6b93176a9f8a29c7dd42f64eac4fc8cdf7a10369 ### 2018-12-11 diff --git a/packages/map/lib/README.md b/packages/map/lib/README.md index 038b1365e..622711b23 100644 --- a/packages/map/lib/README.md +++ b/packages/map/lib/README.md @@ -67,7 +67,7 @@ public ngOnInit(): void {
- +
From 16d0f791eb34665aa66a1833c89a07039d940c95 Mon Sep 17 00:00:00 2001 From: Matthias Claes Date: Mon, 4 Feb 2019 17:22:57 +0100 Subject: [PATCH 6/9] Set leaflet map to public and moved it --- .../leaflet-locate-control.component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/map/lib/src/leaflet/components/controls/leaflet-locate-control/leaflet-locate-control.component.ts b/packages/map/lib/src/leaflet/components/controls/leaflet-locate-control/leaflet-locate-control.component.ts index 9b8f55550..d0a07e7b2 100644 --- a/packages/map/lib/src/leaflet/components/controls/leaflet-locate-control/leaflet-locate-control.component.ts +++ b/packages/map/lib/src/leaflet/components/controls/leaflet-locate-control/leaflet-locate-control.component.ts @@ -6,7 +6,7 @@ import { LeafletMap } from '../../../classes/leaflet-map'; templateUrl: './leaflet-locate-control.component.html', }) export class LeafletLocateControlComponent { - map: LeafletMap; - @Input() public zoomLevel = 19; + + public map: LeafletMap; } From e19c4e48e7f15cc269b82a3dbf54d7cf69e7d14e Mon Sep 17 00:00:00 2001 From: Matthias Claes Date: Tue, 5 Feb 2019 13:47:26 +0100 Subject: [PATCH 7/9] Fixed merge conflict in CHANGELOG --- CHANGELOG.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c460b087c..c59a7a70b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,26 +6,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ## Unreleased -- `documentation` Fixed the `utils/window` example. -- `code-snippet` Fixed an issue where the `code-snippet` was constantly looking for `pre` tags. -- `calendar` Fixed a faulty unit test. +- `calendar` Fixed an issue where the calendar doesn't jump to a predefined date. - `map` added possibility to set the zoom level of the `aui-leaflet-locate-control`. -### 2019-01-08 - -- `documentation` added info in the code-snippet documentation about how to use highlight.js - -### 2018-12-11 - -- `documentation` Fixed some issue with the documentation. +## [1.1.0] - 2019-02-05 -### 2018-11-28 +### Added +- `core` Tested all components for Angular 7 compatibility. Note: ACPaaS UI is now fully compatible with Angular 6 and 7. +- `layout/modal` Added documentation. +- `code-snippet` Added documentation about how to use highlight.js. +### Changed - `core` Build components independent of examples. -- `core` Fix AOT / Prod builds. ### Fixed +- `analytics` Fixed incorrect documentation. +- `calendar` Fixed a faulty unit test. - `core` Fixed an issue where an unwanted 404 was shown when the styleguide was reloaded on GitHub pages. +- `documentation` Fixed AOT build. +- `form/autocomplete` Fixed an issue where Google Chrome would interfere with its own autocomplete feature. ## [1.0.5] - 2018-11-13 @@ -106,7 +105,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/). Initial release. -[Unreleased]: https://github.com/digipolisantwerp/acpaas-ui_angular/compare/v1.0.5...HEAD +[Unreleased]: https://github.com/digipolisantwerp/acpaas-ui_angular/compare/v1.1.0...HEAD +[1.1.0]: https://github.com/digipolisantwerp/acpaas-ui_angular/compare/v1.0.5...v1.1.0 [1.0.5]: https://github.com/digipolisantwerp/acpaas-ui_angular/compare/v1.0.4...v1.0.5 [1.0.4]: https://github.com/digipolisantwerp/acpaas-ui_angular/compare/v1.0.3...v1.0.4 [1.0.3]: https://github.com/digipolisantwerp/acpaas-ui_angular/compare/v1.0.2...v1.0.3 From 4fcbe6d3f4678d61f1f1e142ea0ef4b52871a9dd Mon Sep 17 00:00:00 2001 From: Matthias Claes Date: Tue, 5 Feb 2019 13:55:15 +0100 Subject: [PATCH 8/9] Fixed unittests --- packages/map/lib/src/leaflet/classes/leaflet-map.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/map/lib/src/leaflet/classes/leaflet-map.spec.ts b/packages/map/lib/src/leaflet/classes/leaflet-map.spec.ts index 61d50cdf5..1ae4ca70c 100644 --- a/packages/map/lib/src/leaflet/classes/leaflet-map.spec.ts +++ b/packages/map/lib/src/leaflet/classes/leaflet-map.spec.ts @@ -228,7 +228,7 @@ describe('The leaflet map', () => { it('should zoom to the current location', () => { map.locate(16); - expect(setViewSpy).toHaveBeenCalledWith(options.center, 19); + expect(setViewSpy).toHaveBeenCalledWith(options.center, 16); }); }); From 6588ca7d5297346e1cc520e8a895d1484dd11155 Mon Sep 17 00:00:00 2001 From: Matthias Claes Date: Thu, 7 Feb 2019 11:37:32 +0100 Subject: [PATCH 9/9] Added part to readme with extra info about Zoom Level --- packages/map/lib/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/map/lib/README.md b/packages/map/lib/README.md index 622711b23..927614cf0 100644 --- a/packages/map/lib/README.md +++ b/packages/map/lib/README.md @@ -33,6 +33,7 @@ Visit our [documentation site](https://acpaas-ui.digipolis.be/) for full how-to | ----------- | ------ | -------------------------- | | `@Input() leafletMap: LeafletMap;` | `-` | An instance of the [Leaflet Map class](https://leafletjs.com/reference-1.3.0.html#map-example). | | `@Input() hasSidebar: boolean;` | `false` | Define if the map has a sidebar. | +| `@Input() zoomLevel: number;` | `19` | Define how far to zoom in [Leaflet Zoom Level](https://leafletjs.com/examples/zoom-levels/) Check the [Leaflet API reference](https://leafletjs.com/reference-1.3.0.html) for Leaflet specific API's.