@guajiritos/map 0.0.10 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,50 +1,49 @@
1
1
  import * as i0 from '@angular/core';
2
- import { EventEmitter, forwardRef, Component, Input, Output } from '@angular/core';
3
- import { NgIf } from '@angular/common';
2
+ import { signal, EventEmitter, forwardRef, Component, Input, Output } from '@angular/core';
3
+ import { NgIf, TitleCasePipe } from '@angular/common';
4
4
  import * as L from 'leaflet';
5
- import { layerGroup, icon, Marker, LatLng } from 'leaflet';
5
+ import { layerGroup, icon } from 'leaflet';
6
6
  import * as i1 from '@angular/material/input';
7
7
  import { MatInputModule } from '@angular/material/input';
8
8
  import * as i3 from '@angular/forms';
9
9
  import { UntypedFormGroup, UntypedFormControl, Validators, NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms';
10
- import { Subject, takeUntil } from 'rxjs';
11
10
  import * as i4 from '@angular/material/icon';
12
11
  import { MatIconModule } from '@angular/material/icon';
12
+ import { Subject, takeUntil } from 'rxjs';
13
+ import * as i5 from '@ngx-translate/core';
14
+ import { TranslateModule } from '@ngx-translate/core';
13
15
  import * as i2 from '@angular/material/form-field';
14
16
 
15
17
  const DEFAULT_MAP_OPTION = {
18
+ id: 'map',
16
19
  center: [23.130257185291036, -82.35626220703126],
17
20
  draggable: true,
18
- zoom: 8,
21
+ zoom: 15,
19
22
  updateWithClick: false,
20
23
  updateWithDoubleClick: false,
21
- zoomControl: false,
24
+ zoomControl: true,
22
25
  borderRadius: '8px',
23
- scrollWheelZoom: false
26
+ scrollWheelZoom: false,
27
+ addMarker: false,
28
+ scrollable: false
24
29
  };
30
+
25
31
  class GuajiritosMap {
26
32
  constructor() {
27
- this._map = null;
28
33
  this._layerGroup = new L.LayerGroup();
29
- this._markersList = [];
34
+ this.mapMarkers = signal([]);
35
+ this.options = signal(DEFAULT_MAP_OPTION);
36
+ this.circle = signal(null);
30
37
  this.form = new UntypedFormGroup({
31
38
  latitude: new UntypedFormControl({ value: null, disabled: false }, [Validators.required]),
32
39
  longitude: new UntypedFormControl({ value: null, disabled: false }, [Validators.required])
33
40
  });
34
- this.latLabel = '';
35
- this.latPlaceholder = '';
36
- this.lngLabel = '';
37
- this.lngPlaceholder = '';
38
- this.latError = '';
39
- this.lngError = '';
40
41
  this.appearance = 'outline';
41
42
  this.color = 'accent';
43
+ this.floatLabel = 'auto';
44
+ this.subscriptSizing = 'dynamic';
42
45
  this.readonly = false;
43
- this.hidden = false;
44
- /**
45
- * Default map options
46
- */
47
- this.options = {};
46
+ this.hiddenForm = false;
48
47
  /**
49
48
  * Default marker icon
50
49
  */
@@ -57,50 +56,95 @@ class GuajiritosMap {
57
56
  * Se lanza cada vez que cambia un marcador
58
57
  */
59
58
  this.markerDragend = new EventEmitter();
59
+ /**
60
+ * Se lanza cada vez que se añade un marcador
61
+ */
62
+ this.markerAdded = new EventEmitter();
60
63
  }
61
64
  static { this._observableSubject$ = new Subject(); }
65
+ /**
66
+ * Default map options
67
+ */
68
+ set optionsMap(options) {
69
+ if (options) {
70
+ this.options.set({
71
+ ...this.options(),
72
+ ...options
73
+ });
74
+ }
75
+ }
76
+ ;
77
+ /**
78
+ * Add a circle on the map
79
+ */
80
+ set circleConfig(circle) {
81
+ if (circle) {
82
+ this.circle.set(circle);
83
+ if (this.map) {
84
+ this.addCircle(this.circle()?.center, this.circle()?.radius);
85
+ }
86
+ }
87
+ }
62
88
  /**
63
89
  * List of markers
64
90
  * @param markers - Markers array
65
91
  */
66
92
  set markers(markers) {
67
- if (markers && markers.length > 0) {
68
- this._markersList = markers;
69
- setTimeout(() => {
70
- this._layerGroup?.clearLayers();
71
- markers.forEach((m) => {
72
- this._addMarker(m);
73
- });
74
- this.changeCenter(this._createMarker(markers[0]));
75
- }, 100);
93
+ if (markers?.length) {
94
+ this.mapMarkers.set(markers);
95
+ this.form.patchValue({
96
+ latitude: this.mapMarkers()?.[0]?.lat,
97
+ longitude: this.mapMarkers()?.[0]?.lng
98
+ });
99
+ if (this.map && this._layerGroup) {
100
+ this.drawMarkers();
101
+ }
76
102
  }
77
103
  }
78
104
  /**
79
- * Form initialization
80
- * @param data - Initial data
105
+ * Draws the markers.
81
106
  */
82
- _initForm(data) {
83
- this.form.patchValue({
84
- latitude: data?.latitude,
85
- longitude: data?.longitude,
86
- });
107
+ drawMarkers() {
108
+ if (this.mapMarkers()?.length) {
109
+ this._layerGroup.clearLayers();
110
+ this.mapMarkers().forEach((m) => {
111
+ this.addMarker(m);
112
+ });
113
+ }
87
114
  }
88
115
  /**
89
116
  * Main properties of the map
90
117
  * @private
91
118
  */
92
- _initMap() {
93
- this._map = L.map('map', {
94
- center: this.options?.center ?? DEFAULT_MAP_OPTION.center,
95
- dragging: this.options?.draggable ?? DEFAULT_MAP_OPTION.draggable,
96
- zoom: this.options?.zoom ?? DEFAULT_MAP_OPTION.zoom,
97
- zoomControl: this.options?.zoomControl || DEFAULT_MAP_OPTION.zoomControl,
98
- scrollWheelZoom: this.options?.scrollWheelZoom || DEFAULT_MAP_OPTION.scrollWheelZoom,
119
+ initMap() {
120
+ this.map = L.map(this.options().id, {
121
+ center: this.options()?.center ?? DEFAULT_MAP_OPTION.center,
122
+ dragging: this.options()?.draggable ?? DEFAULT_MAP_OPTION.draggable,
123
+ zoom: this.options()?.zoom ?? DEFAULT_MAP_OPTION.zoom,
124
+ zoomControl: this.options()?.zoomControl || DEFAULT_MAP_OPTION.zoomControl,
125
+ scrollWheelZoom: this.options()?.scrollWheelZoom || DEFAULT_MAP_OPTION.scrollWheelZoom,
99
126
  maxZoom: 18,
100
- minZoom: 3,
127
+ minZoom: 3
101
128
  });
102
- this._layerGroup = layerGroup().addTo(this._map);
103
- L.tileLayer('http://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png').addTo(this._map);
129
+ this._layerGroup = layerGroup().addTo(this.map);
130
+ L.tileLayer('http://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png').addTo(this.map);
131
+ this.drawMarkers();
132
+ this.changeCenter(new L.LatLng(this.mapMarkers()?.[0]?.lat, this.mapMarkers()?.[0]?.lng));
133
+ if (this.circle()) {
134
+ this.addCircle(this.circle()?.center, this.circle()?.radius);
135
+ }
136
+ if (this.options()?.addMarker) {
137
+ let that = this;
138
+ this.map.on('click', function (e) {
139
+ const newMarker = {
140
+ lat: e.latlng.lat,
141
+ lng: e.latlng.lng,
142
+ draggable: that.options()?.draggable ?? DEFAULT_MAP_OPTION.draggable
143
+ };
144
+ that.addMarker(newMarker);
145
+ that.markerAdded.emit(newMarker);
146
+ });
147
+ }
104
148
  }
105
149
  /**
106
150
  * Add marker to map
@@ -108,17 +152,18 @@ class GuajiritosMap {
108
152
  * @param radius - radius of the circle in meters
109
153
  * @private
110
154
  */
111
- _addCircle(center, radius) {
112
- if (this._map && center) {
113
- L.circleMarker([center?.lat, center?.lng], { radius }).addTo(this._map);
155
+ addCircle(center, radius) {
156
+ if (this.map && center) {
157
+ this.drawMarkers();
158
+ L.circleMarker([center?.lat, center?.lng], { radius }).addTo(this.map);
114
159
  }
115
160
  }
116
161
  /**
117
162
  * Add marker to map
118
163
  * @param marker - Point of the map
119
164
  */
120
- _addMarker(marker) {
121
- if (this._map && marker) {
165
+ addMarker(marker) {
166
+ if (this.map && marker) {
122
167
  const markerAdd = L.marker({
123
168
  lat: marker?.lat,
124
169
  lng: marker?.lng
@@ -131,86 +176,47 @@ class GuajiritosMap {
131
176
  iconUrl: this.icon?.iconUrl
132
177
  })).addTo(this._layerGroup);
133
178
  markerAdd.on('dragend', () => {
134
- this.changeCenter(markerAdd);
179
+ this.changeCenter(markerAdd.getLatLng());
135
180
  this.markerDragend.emit(markerAdd.getLatLng());
136
181
  });
137
182
  }
138
183
  }
139
- /**
140
- * Add a marker on the map
141
- * @param marker - Point of the map
142
- * @private
143
- */
144
- _createMarker(marker) {
145
- const markerCreate = new Marker(new LatLng(marker?.lat, marker?.lng), {
146
- draggable: marker?.draggable ?? true,
147
- autoPan: true
148
- }).setIcon(icon({
149
- iconSize: this.icon?.iconSize,
150
- iconAnchor: this.icon?.iconAnchor,
151
- iconUrl: this.icon?.iconUrl
152
- }));
153
- markerCreate.on('dragend', () => {
154
- this.changeCenter(markerCreate);
155
- this.markerDragend.emit(markerCreate.getLatLng());
156
- });
157
- return markerCreate;
158
- }
159
- /**
160
- * Get latitude and longitude values if maker map is only one
161
- * @private
162
- */
163
- _getLatLng() {
164
- if (this._markersList?.length === 1) {
165
- this.form.patchValue({
166
- latitude: this._markersList?.[0]?.lat,
167
- longitude: this._markersList?.[0]?.lng
168
- });
169
- }
170
- }
171
- _latLngChangeCenter(marker) {
172
- this._map?.setView({
173
- lat: marker?.latitude,
174
- lng: marker?.longitude
175
- });
176
- this._markersList[0].lat = parseFloat(marker?.latitude);
177
- this._markersList[0].lng = parseFloat(marker?.longitude);
178
- this._layerGroup?.clearLayers();
179
- const markerAdd = L.marker({
180
- lat: this._markersList?.[0]?.lat,
181
- lng: this._markersList?.[0]?.lng,
182
- }, {
183
- draggable: marker?.draggable ?? true,
184
- autoPan: true
185
- }).addTo(this._layerGroup);
186
- markerAdd.on('dragend', () => {
187
- this.changeCenter(markerAdd);
188
- this.markerDragend.emit(markerAdd.getLatLng());
189
- });
190
- }
191
- /**
192
- * Make visible/hide latitude and longitude inputs
193
- * @public
194
- */
195
- hideLatLng() {
196
- return this._markersList?.length === 1;
197
- }
198
184
  /**
199
185
  * Put the map center on marker position
200
186
  * @param marker - Point of the map
201
187
  * @public
202
188
  */
203
189
  changeCenter(marker) {
204
- this._map?.setView(marker?.getLatLng());
190
+ this.map?.setView(marker);
205
191
  }
192
+ /**
193
+ * Propagates the change to other components.
194
+ *
195
+ * @param {any} _ - an arbitrary parameter.
196
+ */
206
197
  propagateChange(_) {
207
198
  }
208
199
  ;
200
+ /**
201
+ * Sets the callback function to be called when the value
202
+ * of the control changes.
203
+ *
204
+ * @param {any} fn - The callback function to be called
205
+ * when the value of the control changes.
206
+ */
209
207
  registerOnChange(fn) {
210
208
  this.propagateChange = fn;
211
209
  }
210
+ /**
211
+ * Registers a callback function to be called when the form control is "touched".
212
+ */
212
213
  registerOnTouched() {
213
214
  }
215
+ /**
216
+ * Sets the disabled state of the form.
217
+ *
218
+ * @param {boolean} isDisabled - Specifies whether the form should be disabled or not.
219
+ */
214
220
  setDisabledState(isDisabled) {
215
221
  if (isDisabled) {
216
222
  this.form.disable();
@@ -219,72 +225,75 @@ class GuajiritosMap {
219
225
  this.form.enable();
220
226
  }
221
227
  }
222
- writeValue(form) {
223
- if (form) {
224
- this._initForm(form);
228
+ /**
229
+ * Writes a value to the form.
230
+ *
231
+ * @param {any} data - The data to be written.
232
+ */
233
+ writeValue(data) {
234
+ if (data) {
235
+ this.form.patchValue({
236
+ latitude: data?.latitude,
237
+ longitude: data?.longitude
238
+ });
225
239
  }
226
240
  }
241
+ /**
242
+ * Initializes the component and sets up a listener for changes in the form value.
243
+ */
227
244
  ngOnInit() {
228
- this._getLatLng();
229
245
  this.form.valueChanges
230
246
  .pipe(takeUntil(GuajiritosMap._observableSubject$.asObservable()))
231
247
  .subscribe(() => {
232
248
  this.propagateChange(this.form.value);
233
- this._latLngChangeCenter(this.form.value);
234
249
  });
235
250
  }
251
+ /**
252
+ * Initializes the map after the view has been initialized.
253
+ */
236
254
  ngAfterViewInit() {
237
- this._initMap();
238
- if (this.circle) {
239
- this._addCircle(this.circle?.center, this.circle?.radius);
240
- }
255
+ this.initMap();
241
256
  }
242
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: GuajiritosMap, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
243
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.8", type: GuajiritosMap, isStandalone: true, selector: "guajiritos-map", inputs: { latLabel: "latLabel", latPlaceholder: "latPlaceholder", lngLabel: "lngLabel", lngPlaceholder: "lngPlaceholder", latError: "latError", lngError: "lngError", appearance: "appearance", color: "color", readonly: "readonly", hidden: "hidden", options: "options", circle: "circle", icon: "icon", markers: "markers" }, outputs: { markerDragend: "markerDragend" }, providers: [
257
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GuajiritosMap, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
258
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: GuajiritosMap, isStandalone: true, selector: "guajiritos-map", inputs: { appearance: "appearance", color: "color", floatLabel: "floatLabel", subscriptSizing: "subscriptSizing", readonly: "readonly", hiddenForm: "hiddenForm", optionsMap: "optionsMap", circleConfig: "circleConfig", icon: "icon", markers: "markers" }, outputs: { markerDragend: "markerDragend", markerAdded: "markerAdded" }, providers: [
244
259
  {
245
260
  provide: NG_VALUE_ACCESSOR,
246
261
  useExisting: forwardRef(() => GuajiritosMap),
247
262
  multi: true
248
263
  }
249
- ], ngImport: i0, template: "<div class=\"map-container\">\n <div class=\"latLngInput\" [formGroup]=\"form\" *ngIf=\"hideLatLng() && !hidden\">\n <mat-form-field [appearance]=\"appearance\" [color]=\"color\" class='w-100'>\n <mat-label>{{latLabel}}</mat-label>\n <mat-icon matSuffix class=\"material-icons-outlined\" [color]=\"color\">place</mat-icon>\n <input matInput [placeholder]=\"latPlaceholder\" [readonly]=\"readonly\" formControlName=\"latitude\">\n <mat-error *ngIf=\"form.controls['latitude'].hasError('required')\">{{latError}}</mat-error>\n </mat-form-field>\n \n <mat-form-field [appearance]=\"appearance\" [color]=\"color\" class='w-100'>\n <mat-label>{{lngLabel}}</mat-label>\n <mat-icon matSuffix class=\"material-icons-outlined\" [color]=\"color\">place</mat-icon>\n <input matInput [placeholder]=\"lngPlaceholder\" [readonly]=\"readonly\" formControlName=\"longitude\">\n <mat-error *ngIf=\"form.controls['longitude'].hasError('required')\">{{lngError}}</mat-error>\n </mat-form-field>\n </div>\n \n <div id=\"map\" class=\"map\"></div>\n</div>\n", styles: [".map-container{display:flex;flex-direction:column;gap:2rem}.latLngInput{display:flex;flex-direction:row;gap:1rem}.map{min-height:400px;max-width:100%}\n"], dependencies: [{ kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] }); }
264
+ ], ngImport: i0, template: "<div class=\"map-container\">\r\n <div class=\"lat-lng-input\" [formGroup]=\"form\" *ngIf=\"mapMarkers()?.length === 1 && !hiddenForm\">\r\n <mat-form-field [appearance]=\"appearance\" [color]=\"color\" [floatLabel]=\"floatLabel\" class='w-100'\r\n [subscriptSizing]=\"subscriptSizing\">\r\n <mat-label>{{ \"latitud\" | translate | titlecase }}</mat-label>\r\n <mat-icon matSuffix class=\"material-icons-outlined\" [color]=\"color\">place</mat-icon>\r\n <input matInput [placeholder]=\"'latitud' | translate\" [readonly]=\"readonly\" formControlName=\"latitude\">\r\n <mat-error>{{ 'Latitud requerida' | translate }}</mat-error>\r\n </mat-form-field>\r\n\r\n <mat-form-field [appearance]=\"appearance\" [color]=\"color\" [floatLabel]=\"floatLabel\" class='w-100'\r\n [subscriptSizing]=\"subscriptSizing\">\r\n <mat-label>{{ \"longitud\" | translate | titlecase }}</mat-label>\r\n <mat-icon matSuffix class=\"material-icons-outlined\" [color]=\"color\">place</mat-icon>\r\n <input matInput [placeholder]=\"'longitud' | translate\" [readonly]=\"readonly\" formControlName=\"longitude\">\r\n <mat-error>{{ 'Longitud requerida' | translate }}</mat-error>\r\n </mat-form-field>\r\n </div>\r\n\r\n <div [id]=\"options().id\" class=\"map\"></div>\r\n</div>\r\n", styles: [".map-container{display:flex;flex-direction:column;gap:2rem}.lat-lng-input{display:flex;flex-direction:row;gap:1rem}.map{min-height:400px;max-width:100%}.w-100{width:100%}\n"], dependencies: [{ kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }, { kind: "pipe", type: TitleCasePipe, name: "titlecase" }] }); }
250
265
  }
251
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: GuajiritosMap, decorators: [{
266
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GuajiritosMap, decorators: [{
252
267
  type: Component,
253
268
  args: [{ selector: 'guajiritos-map', standalone: true, imports: [
254
269
  MatInputModule,
255
270
  ReactiveFormsModule,
256
271
  NgIf,
257
- MatIconModule
272
+ MatIconModule,
273
+ TranslateModule,
274
+ TitleCasePipe
258
275
  ], providers: [
259
276
  {
260
277
  provide: NG_VALUE_ACCESSOR,
261
278
  useExisting: forwardRef(() => GuajiritosMap),
262
279
  multi: true
263
280
  }
264
- ], template: "<div class=\"map-container\">\n <div class=\"latLngInput\" [formGroup]=\"form\" *ngIf=\"hideLatLng() && !hidden\">\n <mat-form-field [appearance]=\"appearance\" [color]=\"color\" class='w-100'>\n <mat-label>{{latLabel}}</mat-label>\n <mat-icon matSuffix class=\"material-icons-outlined\" [color]=\"color\">place</mat-icon>\n <input matInput [placeholder]=\"latPlaceholder\" [readonly]=\"readonly\" formControlName=\"latitude\">\n <mat-error *ngIf=\"form.controls['latitude'].hasError('required')\">{{latError}}</mat-error>\n </mat-form-field>\n \n <mat-form-field [appearance]=\"appearance\" [color]=\"color\" class='w-100'>\n <mat-label>{{lngLabel}}</mat-label>\n <mat-icon matSuffix class=\"material-icons-outlined\" [color]=\"color\">place</mat-icon>\n <input matInput [placeholder]=\"lngPlaceholder\" [readonly]=\"readonly\" formControlName=\"longitude\">\n <mat-error *ngIf=\"form.controls['longitude'].hasError('required')\">{{lngError}}</mat-error>\n </mat-form-field>\n </div>\n \n <div id=\"map\" class=\"map\"></div>\n</div>\n", styles: [".map-container{display:flex;flex-direction:column;gap:2rem}.latLngInput{display:flex;flex-direction:row;gap:1rem}.map{min-height:400px;max-width:100%}\n"] }]
265
- }], ctorParameters: function () { return []; }, propDecorators: { latLabel: [{
266
- type: Input
267
- }], latPlaceholder: [{
268
- type: Input
269
- }], lngLabel: [{
270
- type: Input
271
- }], lngPlaceholder: [{
281
+ ], template: "<div class=\"map-container\">\r\n <div class=\"lat-lng-input\" [formGroup]=\"form\" *ngIf=\"mapMarkers()?.length === 1 && !hiddenForm\">\r\n <mat-form-field [appearance]=\"appearance\" [color]=\"color\" [floatLabel]=\"floatLabel\" class='w-100'\r\n [subscriptSizing]=\"subscriptSizing\">\r\n <mat-label>{{ \"latitud\" | translate | titlecase }}</mat-label>\r\n <mat-icon matSuffix class=\"material-icons-outlined\" [color]=\"color\">place</mat-icon>\r\n <input matInput [placeholder]=\"'latitud' | translate\" [readonly]=\"readonly\" formControlName=\"latitude\">\r\n <mat-error>{{ 'Latitud requerida' | translate }}</mat-error>\r\n </mat-form-field>\r\n\r\n <mat-form-field [appearance]=\"appearance\" [color]=\"color\" [floatLabel]=\"floatLabel\" class='w-100'\r\n [subscriptSizing]=\"subscriptSizing\">\r\n <mat-label>{{ \"longitud\" | translate | titlecase }}</mat-label>\r\n <mat-icon matSuffix class=\"material-icons-outlined\" [color]=\"color\">place</mat-icon>\r\n <input matInput [placeholder]=\"'longitud' | translate\" [readonly]=\"readonly\" formControlName=\"longitude\">\r\n <mat-error>{{ 'Longitud requerida' | translate }}</mat-error>\r\n </mat-form-field>\r\n </div>\r\n\r\n <div [id]=\"options().id\" class=\"map\"></div>\r\n</div>\r\n", styles: [".map-container{display:flex;flex-direction:column;gap:2rem}.lat-lng-input{display:flex;flex-direction:row;gap:1rem}.map{min-height:400px;max-width:100%}.w-100{width:100%}\n"] }]
282
+ }], propDecorators: { appearance: [{
272
283
  type: Input
273
- }], latError: [{
274
- type: Input
275
- }], lngError: [{
284
+ }], color: [{
276
285
  type: Input
277
- }], appearance: [{
286
+ }], floatLabel: [{
278
287
  type: Input
279
- }], color: [{
288
+ }], subscriptSizing: [{
280
289
  type: Input
281
290
  }], readonly: [{
282
291
  type: Input
283
- }], hidden: [{
292
+ }], hiddenForm: [{
284
293
  type: Input
285
- }], options: [{
294
+ }], optionsMap: [{
286
295
  type: Input
287
- }], circle: [{
296
+ }], circleConfig: [{
288
297
  type: Input
289
298
  }], icon: [{
290
299
  type: Input
@@ -292,6 +301,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.8", ngImpor
292
301
  type: Input
293
302
  }], markerDragend: [{
294
303
  type: Output
304
+ }], markerAdded: [{
305
+ type: Output
295
306
  }] } });
296
307
 
297
308
  /*
@@ -1 +1 @@
1
- {"version":3,"file":"guajiritos-map.mjs","sources":["../../../projects/guajiritos-map/src/lib/map.component.ts","../../../projects/guajiritos-map/src/lib/map.component.html","../../../projects/guajiritos-map/src/public-api.ts","../../../projects/guajiritos-map/src/guajiritos-map.ts"],"sourcesContent":["import {AfterViewInit, Component, EventEmitter, forwardRef, Input, OnInit, Output} from \"@angular/core\";\nimport {NgIf} from \"@angular/common\";\nimport * as L from \"leaflet\";\nimport {icon, LatLng, LatLngExpression, layerGroup, LayerGroup, Map, Marker} from \"leaflet\";\nimport {MatInputModule} from \"@angular/material/input\";\nimport {\n ControlValueAccessor,\n NG_VALUE_ACCESSOR,\n ReactiveFormsModule,\n UntypedFormControl,\n UntypedFormGroup, Validators\n} from \"@angular/forms\";\nimport {MatFormFieldAppearance} from \"@angular/material/form-field\";\nimport {ThemePalette} from \"@angular/material/core\";\nimport {Subject, takeUntil} from \"rxjs\";\nimport {MatIconModule} from \"@angular/material/icon\";\n\n/**\n * Map options interface\n */\nexport interface MapOption {\n center?: [number, number],\n draggable?: boolean,\n updateWithClick?: boolean,\n updateWithDoubleClick?: boolean,\n zoom?: number,\n borderRadius?: string,\n scrollable?: boolean,\n zoomControl?: boolean,\n scrollWheelZoom?: boolean,\n}\n\n/**\n * Marker interface\n */\nexport interface MarkerMap {\n lat: number;\n lng: number;\n draggable?: boolean;\n}\n\n/**\n * Icon interface\n */\nexport interface Icon {\n iconSize: [number, number];\n iconAnchor: [number, number];\n iconUrl: string;\n iconRetinaUrl?: string,\n shadowUrl?: string,\n popupAnchor?: [number, number],\n tooltipAnchor?: [number, number],\n shadowSize?: [number, number],\n}\n\n/**\n * Circle map interface\n */\nexport interface CircleMap {\n center: MarkerMap;\n radius: number;\n}\n\nexport const DEFAULT_MAP_OPTION: MapOption = {\n center: [23.130257185291036, -82.35626220703126],\n draggable: true,\n zoom: 8,\n updateWithClick: false,\n updateWithDoubleClick: false,\n zoomControl: false,\n borderRadius: '8px',\n scrollWheelZoom: false\n};\n\n@Component({\n selector: 'guajiritos-map',\n templateUrl: './map.component.html',\n styleUrls: ['./map.component.scss'],\n standalone: true,\n imports: [\n MatInputModule,\n ReactiveFormsModule,\n NgIf,\n MatIconModule\n ],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => GuajiritosMap),\n multi: true\n }\n ]\n})\nexport class GuajiritosMap implements AfterViewInit, OnInit, ControlValueAccessor {\n constructor() {\n }\n \n private static _observableSubject$: Subject<void> = new Subject();\n private _map: Map | null = null;\n private _layerGroup: LayerGroup = new L.LayerGroup();\n private _markersList: MarkerMap[] = [];\n \n public form: UntypedFormGroup = new UntypedFormGroup({\n latitude: new UntypedFormControl({value: null, disabled: false}, [Validators.required]),\n longitude: new UntypedFormControl({value: null, disabled: false}, [Validators.required])\n });\n \n @Input() latLabel: string = '';\n @Input() latPlaceholder: string = '';\n @Input() lngLabel: string = '';\n @Input() lngPlaceholder: string = '';\n @Input() latError: string = '';\n @Input() lngError: string = '';\n @Input() appearance: MatFormFieldAppearance = 'outline';\n @Input() color: ThemePalette = 'accent';\n @Input() readonly: boolean = false;\n @Input() hidden: boolean = false;\n /**\n * Default map options\n */\n @Input() options: MapOption = {};\n /**\n * Add a circle on the map\n */\n @Input() circle!: CircleMap;\n /**\n * Default marker icon\n */\n @Input() icon: Icon = {\n iconSize: [25, 41],\n iconAnchor: [13, 41],\n iconUrl: 'marker-icon.png'\n };\n \n /**\n * List of markers\n * @param markers - Markers array\n */\n @Input() set markers(markers: MarkerMap[]) {\n if (markers && markers.length > 0) {\n this._markersList = markers;\n setTimeout((): void => {\n this._layerGroup?.clearLayers();\n markers.forEach((m: any): void => {\n this._addMarker(m);\n });\n this.changeCenter(this._createMarker(markers[0]));\n }, 100);\n }\n }\n \n /**\n * Se lanza cada vez que cambia un marcador\n */\n @Output() markerDragend: EventEmitter<LatLng> = new EventEmitter();\n \n /**\n * Form initialization\n * @param data - Initial data\n */\n private _initForm(data: any): void {\n this.form.patchValue({\n latitude: data?.latitude,\n longitude: data?.longitude,\n });\n }\n \n /**\n * Main properties of the map\n * @private\n */\n private _initMap(): void {\n this._map = L.map('map', {\n center: this.options?.center as LatLngExpression ?? DEFAULT_MAP_OPTION.center,\n dragging: this.options?.draggable ?? DEFAULT_MAP_OPTION.draggable,\n zoom: this.options?.zoom ?? DEFAULT_MAP_OPTION.zoom,\n zoomControl: this.options?.zoomControl || DEFAULT_MAP_OPTION.zoomControl,\n scrollWheelZoom: this.options?.scrollWheelZoom || DEFAULT_MAP_OPTION.scrollWheelZoom,\n maxZoom: 18,\n minZoom: 3,\n });\n \n this._layerGroup = layerGroup().addTo(this._map);\n \n L.tileLayer('http://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png').addTo(this._map);\n }\n \n /**\n * Add marker to map\n * @param center - center of the circle\n * @param radius - radius of the circle in meters\n * @private\n */\n private _addCircle(center: MarkerMap, radius: number): void {\n if (this._map && center) {\n L.circleMarker([center?.lat, center?.lng], {radius}).addTo(this._map);\n }\n }\n \n /**\n * Add marker to map\n * @param marker - Point of the map\n */\n private _addMarker(marker: MarkerMap): void {\n if (this._map && marker) {\n const markerAdd = L.marker({\n lat: marker?.lat,\n lng: marker?.lng\n }, {\n draggable: marker?.draggable ?? true,\n autoPan: true\n }).setIcon(\n icon({\n iconSize: this.icon?.iconSize,\n iconAnchor: this.icon?.iconAnchor,\n iconUrl: this.icon?.iconUrl\n })\n ).addTo(this._layerGroup);\n \n markerAdd.on('dragend', (): void => {\n this.changeCenter(markerAdd);\n this.markerDragend.emit(markerAdd.getLatLng());\n });\n }\n }\n \n /**\n * Add a marker on the map\n * @param marker - Point of the map\n * @private\n */\n private _createMarker(marker: MarkerMap): Marker {\n const markerCreate: Marker<LatLng> = new Marker(new LatLng(\n marker?.lat,\n marker?.lng\n ), {\n draggable: marker?.draggable ?? true,\n autoPan: true\n }).setIcon(\n icon({\n iconSize: this.icon?.iconSize,\n iconAnchor: this.icon?.iconAnchor,\n iconUrl: this.icon?.iconUrl\n })\n );\n \n markerCreate.on('dragend', (): void => {\n this.changeCenter(markerCreate);\n this.markerDragend.emit(markerCreate.getLatLng());\n });\n \n return markerCreate;\n }\n \n /**\n * Get latitude and longitude values if maker map is only one\n * @private\n */\n private _getLatLng(): void {\n if (this._markersList?.length === 1) {\n this.form.patchValue({\n latitude: this._markersList?.[0]?.lat,\n longitude: this._markersList?.[0]?.lng\n })\n }\n }\n \n private _latLngChangeCenter(marker: any) {\n this._map?.setView({\n lat: marker?.latitude,\n lng: marker?.longitude\n });\n \n this._markersList[0].lat = parseFloat(marker?.latitude);\n this._markersList[0].lng = parseFloat(marker?.longitude);\n \n this._layerGroup?.clearLayers();\n \n const markerAdd = L.marker({\n lat: this._markersList?.[0]?.lat,\n lng: this._markersList?.[0]?.lng,\n }, {\n draggable: marker?.draggable ?? true,\n autoPan: true\n }).addTo(this._layerGroup);\n \n markerAdd.on('dragend', (): void => {\n this.changeCenter(markerAdd);\n this.markerDragend.emit(markerAdd.getLatLng());\n });\n }\n \n /**\n * Make visible/hide latitude and longitude inputs\n * @public\n */\n public hideLatLng(): boolean {\n return this._markersList?.length === 1;\n }\n \n /**\n * Put the map center on marker position\n * @param marker - Point of the map\n * @public\n */\n public changeCenter(marker: Marker): void {\n this._map?.setView(marker?.getLatLng());\n }\n \n propagateChange(_: any): void {\n };\n \n registerOnChange(fn: any): void {\n this.propagateChange = fn;\n }\n \n registerOnTouched(): void {\n }\n \n setDisabledState(isDisabled: boolean): void {\n if (isDisabled) {\n this.form.disable();\n } else {\n this.form.enable();\n }\n }\n \n writeValue(form: any): void {\n if (form) {\n this._initForm(form);\n }\n }\n \n ngOnInit(): void {\n this._getLatLng();\n \n this.form.valueChanges\n .pipe(takeUntil(GuajiritosMap._observableSubject$.asObservable()))\n .subscribe((): void => {\n this.propagateChange(this.form.value);\n this._latLngChangeCenter(this.form.value);\n })\n }\n \n ngAfterViewInit(): void {\n this._initMap();\n \n if (this.circle) {\n this._addCircle(this.circle?.center, this.circle?.radius);\n }\n }\n}\n","<div class=\"map-container\">\n <div class=\"latLngInput\" [formGroup]=\"form\" *ngIf=\"hideLatLng() && !hidden\">\n <mat-form-field [appearance]=\"appearance\" [color]=\"color\" class='w-100'>\n <mat-label>{{latLabel}}</mat-label>\n <mat-icon matSuffix class=\"material-icons-outlined\" [color]=\"color\">place</mat-icon>\n <input matInput [placeholder]=\"latPlaceholder\" [readonly]=\"readonly\" formControlName=\"latitude\">\n <mat-error *ngIf=\"form.controls['latitude'].hasError('required')\">{{latError}}</mat-error>\n </mat-form-field>\n \n <mat-form-field [appearance]=\"appearance\" [color]=\"color\" class='w-100'>\n <mat-label>{{lngLabel}}</mat-label>\n <mat-icon matSuffix class=\"material-icons-outlined\" [color]=\"color\">place</mat-icon>\n <input matInput [placeholder]=\"lngPlaceholder\" [readonly]=\"readonly\" formControlName=\"longitude\">\n <mat-error *ngIf=\"form.controls['longitude'].hasError('required')\">{{lngError}}</mat-error>\n </mat-form-field>\n </div>\n \n <div id=\"map\" class=\"map\"></div>\n</div>\n","/*\n * Public API Surface of guajiritos-map\n */\n\nexport * from './lib/map.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;AA+Da,MAAA,kBAAkB,GAAc;AAC3C,IAAA,MAAM,EAAE,CAAC,kBAAkB,EAAE,CAAC,iBAAiB,CAAC;AAChD,IAAA,SAAS,EAAE,IAAI;AACf,IAAA,IAAI,EAAE,CAAC;AACP,IAAA,eAAe,EAAE,KAAK;AACtB,IAAA,qBAAqB,EAAE,KAAK;AAC5B,IAAA,WAAW,EAAE,KAAK;AAClB,IAAA,YAAY,EAAE,KAAK;AACnB,IAAA,eAAe,EAAE,KAAK;EACtB;MAqBW,aAAa,CAAA;AACxB,IAAA,WAAA,GAAA;QAIQ,IAAI,CAAA,IAAA,GAAe,IAAI,CAAC;AACxB,QAAA,IAAA,CAAA,WAAW,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;sBAAf,KAAK;gBAIG,MAAM,EAAA,CAAA;sBAAd,KAAK;gBAIG,IAAI,EAAA,CAAA;sBAAZ,KAAK;gBAUO,OAAO,EAAA,CAAA;sBAAnB,KAAK;gBAgBI,aAAa,EAAA,CAAA;sBAAtB,MAAM;;;AE1JT;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"guajiritos-map.mjs","sources":["../../../projects/guajiritos-map/src/interfaces/interfaces.ts","../../../projects/guajiritos-map/src/lib/guajiritos-map.component.ts","../../../projects/guajiritos-map/src/lib/guajiritos-map.component.html","../../../projects/guajiritos-map/src/public-api.ts","../../../projects/guajiritos-map/src/guajiritos-map.ts"],"sourcesContent":["\r\n/**\r\n * Map options interface\r\n */\r\nexport interface MapOption {\r\n id: string;\r\n center?: [number, number];\r\n draggable?: boolean;\r\n updateWithClick?: boolean;\r\n updateWithDoubleClick?: boolean;\r\n zoom?: number;\r\n borderRadius?: string;\r\n scrollable?: boolean;\r\n zoomControl?: boolean;\r\n scrollWheelZoom?: boolean;\r\n addMarker?: boolean;\r\n}\r\n\r\n/**\r\n * Marker interface\r\n */\r\nexport interface MarkerMap {\r\n lat: number;\r\n lng: number;\r\n draggable?: boolean;\r\n}\r\n\r\n/**\r\n * Icon interface\r\n */\r\nexport interface Icon {\r\n iconSize: [number, number];\r\n iconAnchor: [number, number];\r\n iconUrl: string;\r\n iconRetinaUrl?: string,\r\n shadowUrl?: string,\r\n popupAnchor?: [number, number],\r\n tooltipAnchor?: [number, number],\r\n shadowSize?: [number, number],\r\n}\r\n\r\n/**\r\n * Circle map interface\r\n */\r\nexport interface CircleMap {\r\n center: MarkerMap;\r\n radius: number;\r\n}\r\n\r\nexport const DEFAULT_MAP_OPTION: MapOption = {\r\n id: 'map',\r\n center: [23.130257185291036, -82.35626220703126],\r\n draggable: true,\r\n zoom: 15,\r\n updateWithClick: false,\r\n updateWithDoubleClick: false,\r\n zoomControl: true,\r\n borderRadius: '8px',\r\n scrollWheelZoom: false,\r\n addMarker: false,\r\n scrollable: false\r\n};","import {\r\n AfterViewInit,\r\n Component,\r\n EventEmitter,\r\n forwardRef,\r\n Input,\r\n OnInit,\r\n Output,\r\n signal,\r\n WritableSignal\r\n} from '@angular/core';\r\nimport { NgIf, TitleCasePipe } from '@angular/common';\r\nimport * as L from 'leaflet';\r\nimport { icon, LatLng, LatLngExpression, layerGroup, LayerGroup, Map } from 'leaflet';\r\nimport { MatInputModule } from '@angular/material/input';\r\nimport {\r\n ControlValueAccessor,\r\n NG_VALUE_ACCESSOR,\r\n ReactiveFormsModule,\r\n UntypedFormControl,\r\n UntypedFormGroup,\r\n Validators\r\n} from '@angular/forms';\r\nimport { FloatLabelType, MatFormFieldAppearance, SubscriptSizing } from '@angular/material/form-field';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { ThemePalette } from '@angular/material/core';\r\nimport { Subject, takeUntil } from 'rxjs';\r\nimport { TranslateModule } from '@ngx-translate/core';\r\n\r\nimport { CircleMap, DEFAULT_MAP_OPTION, Icon, MapOption, MarkerMap } from '../interfaces/interfaces';\r\n\r\n@Component({\r\n selector: 'guajiritos-map',\r\n templateUrl: './guajiritos-map.component.html',\r\n styleUrls: ['./guajiritos-map.component.scss'],\r\n standalone: true,\r\n imports: [\r\n MatInputModule,\r\n ReactiveFormsModule,\r\n NgIf,\r\n MatIconModule,\r\n TranslateModule,\r\n TitleCasePipe\r\n ],\r\n providers: [\r\n {\r\n provide: NG_VALUE_ACCESSOR,\r\n useExisting: forwardRef(() => GuajiritosMap),\r\n multi: true\r\n }\r\n ]\r\n})\r\nexport class GuajiritosMap implements OnInit, AfterViewInit, ControlValueAccessor {\r\n private static _observableSubject$: Subject<void> = new Subject();\r\n private map: Map;\r\n private _layerGroup: LayerGroup = new L.LayerGroup();\r\n public mapMarkers: WritableSignal<MarkerMap[]> = signal([]);\r\n\r\n public options: WritableSignal<MapOption> = signal(DEFAULT_MAP_OPTION);\r\n public circle: WritableSignal<CircleMap> = signal(null);\r\n\r\n public form: UntypedFormGroup = new UntypedFormGroup({\r\n latitude: new UntypedFormControl({ value: null, disabled: false }, [Validators.required]),\r\n longitude: new UntypedFormControl({ value: null, disabled: false }, [Validators.required])\r\n });\r\n\r\n @Input() appearance: MatFormFieldAppearance = 'outline';\r\n @Input() color: ThemePalette = 'accent';\r\n @Input() floatLabel: FloatLabelType = 'auto';\r\n @Input() subscriptSizing: SubscriptSizing = 'dynamic';\r\n\r\n @Input() readonly: boolean = false;\r\n @Input() hiddenForm: boolean = false;\r\n\r\n /**\r\n * Default map options\r\n */\r\n @Input() set optionsMap(options: Partial<MapOption>) {\r\n if (options) {\r\n this.options.set({\r\n ...this.options(),\r\n ...options\r\n });\r\n }\r\n };\r\n\r\n /**\r\n * Add a circle on the map\r\n */\r\n @Input() set circleConfig(circle: CircleMap) {\r\n if (circle) {\r\n this.circle.set(circle);\r\n\r\n if (this.map) {\r\n this.addCircle(this.circle()?.center, this.circle()?.radius);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Default marker icon\r\n */\r\n @Input() icon: Icon = {\r\n iconSize: [25, 41],\r\n iconAnchor: [13, 41],\r\n iconUrl: 'marker-icon.png'\r\n };\r\n\r\n /**\r\n * List of markers\r\n * @param markers - Markers array\r\n */\r\n @Input() set markers(markers: MarkerMap[]) {\r\n if (markers?.length) {\r\n this.mapMarkers.set(markers);\r\n\r\n this.form.patchValue({\r\n latitude: this.mapMarkers()?.[0]?.lat,\r\n longitude: this.mapMarkers()?.[0]?.lng\r\n });\r\n\r\n if (this.map && this._layerGroup) {\r\n this.drawMarkers();\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Se lanza cada vez que cambia un marcador\r\n */\r\n @Output() markerDragend: EventEmitter<LatLng> = new EventEmitter();\r\n /**\r\n * Se lanza cada vez que se añade un marcador\r\n */\r\n @Output() markerAdded: EventEmitter<MarkerMap> = new EventEmitter();\r\n\r\n /**\r\n * Draws the markers.\r\n */\r\n private drawMarkers(): void {\r\n if (this.mapMarkers()?.length) {\r\n this._layerGroup.clearLayers();\r\n this.mapMarkers().forEach((m: MarkerMap): void => {\r\n this.addMarker(m);\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Main properties of the map\r\n * @private\r\n */\r\n private initMap(): void {\r\n this.map = L.map(this.options().id, {\r\n center: this.options()?.center as LatLngExpression ?? DEFAULT_MAP_OPTION.center,\r\n dragging: this.options()?.draggable ?? DEFAULT_MAP_OPTION.draggable,\r\n zoom: this.options()?.zoom ?? DEFAULT_MAP_OPTION.zoom,\r\n zoomControl: this.options()?.zoomControl || DEFAULT_MAP_OPTION.zoomControl,\r\n scrollWheelZoom: this.options()?.scrollWheelZoom || DEFAULT_MAP_OPTION.scrollWheelZoom,\r\n maxZoom: 18,\r\n minZoom: 3\r\n });\r\n\r\n this._layerGroup = layerGroup().addTo(this.map);\r\n\r\n L.tileLayer('http://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png').addTo(this.map);\r\n\r\n this.drawMarkers();\r\n this.changeCenter(new L.LatLng(this.mapMarkers()?.[0]?.lat, this.mapMarkers()?.[0]?.lng));\r\n\r\n if (this.circle()) {\r\n this.addCircle(this.circle()?.center, this.circle()?.radius);\r\n }\r\n\r\n if (this.options()?.addMarker) {\r\n let that = this;\r\n this.map.on('click', function (e: L.LeafletMouseEvent): void {\r\n const newMarker: MarkerMap = {\r\n lat: e.latlng.lat,\r\n lng: e.latlng.lng,\r\n draggable: that.options()?.draggable ?? DEFAULT_MAP_OPTION.draggable\r\n };\r\n\r\n that.addMarker(newMarker);\r\n\r\n that.markerAdded.emit(newMarker);\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Add marker to map\r\n * @param center - center of the circle\r\n * @param radius - radius of the circle in meters\r\n * @private\r\n */\r\n private addCircle(center: MarkerMap, radius: number): void {\r\n if (this.map && center) {\r\n this.drawMarkers();\r\n L.circleMarker([center?.lat, center?.lng], { radius }).addTo(this.map);\r\n }\r\n }\r\n\r\n /**\r\n * Add marker to map\r\n * @param marker - Point of the map\r\n */\r\n private addMarker(marker: MarkerMap): void {\r\n if (this.map && marker) {\r\n const markerAdd: L.Marker = L.marker({\r\n lat: marker?.lat,\r\n lng: marker?.lng\r\n }, {\r\n draggable: marker?.draggable ?? true,\r\n autoPan: true\r\n }).setIcon(\r\n icon({\r\n iconSize: this.icon?.iconSize,\r\n iconAnchor: this.icon?.iconAnchor,\r\n iconUrl: this.icon?.iconUrl\r\n })\r\n ).addTo(this._layerGroup);\r\n\r\n markerAdd.on('dragend', (): void => {\r\n this.changeCenter(markerAdd.getLatLng());\r\n this.markerDragend.emit(markerAdd.getLatLng());\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Put the map center on marker position\r\n * @param marker - Point of the map\r\n * @public\r\n */\r\n public changeCenter(marker: L.LatLng): void {\r\n this.map?.setView(marker);\r\n }\r\n\r\n /**\r\n * Propagates the change to other components.\r\n *\r\n * @param {any} _ - an arbitrary parameter.\r\n */\r\n propagateChange(_: any): void {\r\n };\r\n\r\n /**\r\n * Sets the callback function to be called when the value\r\n * of the control changes.\r\n *\r\n * @param {any} fn - The callback function to be called\r\n * when the value of the control changes.\r\n */\r\n registerOnChange(fn: any): void {\r\n this.propagateChange = fn;\r\n }\r\n\r\n /**\r\n * Registers a callback function to be called when the form control is \"touched\".\r\n */\r\n registerOnTouched(): void {\r\n }\r\n\r\n /**\r\n * Sets the disabled state of the form.\r\n *\r\n * @param {boolean} isDisabled - Specifies whether the form should be disabled or not.\r\n */\r\n setDisabledState(isDisabled: boolean): void {\r\n if (isDisabled) {\r\n this.form.disable();\r\n } else {\r\n this.form.enable();\r\n }\r\n }\r\n\r\n /**\r\n * Writes a value to the form.\r\n *\r\n * @param {any} data - The data to be written.\r\n */\r\n writeValue(data: any): void {\r\n if (data) {\r\n this.form.patchValue({\r\n latitude: data?.latitude,\r\n longitude: data?.longitude\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Initializes the component and sets up a listener for changes in the form value.\r\n */\r\n ngOnInit(): void {\r\n this.form.valueChanges\r\n .pipe(takeUntil(GuajiritosMap._observableSubject$.asObservable()))\r\n .subscribe((): void => {\r\n this.propagateChange(this.form.value);\r\n });\r\n }\r\n\r\n /**\r\n * Initializes the map after the view has been initialized.\r\n */\r\n ngAfterViewInit(): void {\r\n this.initMap();\r\n }\r\n}\r\n","<div class=\"map-container\">\r\n <div class=\"lat-lng-input\" [formGroup]=\"form\" *ngIf=\"mapMarkers()?.length === 1 && !hiddenForm\">\r\n <mat-form-field [appearance]=\"appearance\" [color]=\"color\" [floatLabel]=\"floatLabel\" class='w-100'\r\n [subscriptSizing]=\"subscriptSizing\">\r\n <mat-label>{{ \"latitud\" | translate | titlecase }}</mat-label>\r\n <mat-icon matSuffix class=\"material-icons-outlined\" [color]=\"color\">place</mat-icon>\r\n <input matInput [placeholder]=\"'latitud' | translate\" [readonly]=\"readonly\" formControlName=\"latitude\">\r\n <mat-error>{{ 'Latitud requerida' | translate }}</mat-error>\r\n </mat-form-field>\r\n\r\n <mat-form-field [appearance]=\"appearance\" [color]=\"color\" [floatLabel]=\"floatLabel\" class='w-100'\r\n [subscriptSizing]=\"subscriptSizing\">\r\n <mat-label>{{ \"longitud\" | translate | titlecase }}</mat-label>\r\n <mat-icon matSuffix class=\"material-icons-outlined\" [color]=\"color\">place</mat-icon>\r\n <input matInput [placeholder]=\"'longitud' | translate\" [readonly]=\"readonly\" formControlName=\"longitude\">\r\n <mat-error>{{ 'Longitud requerida' | translate }}</mat-error>\r\n </mat-form-field>\r\n </div>\r\n\r\n <div [id]=\"options().id\" class=\"map\"></div>\r\n</div>\r\n","/*\r\n * Public API Surface of guajiritos-map\r\n */\r\n\r\nexport * from './interfaces/interfaces';\r\nexport * from './lib/guajiritos-map.component';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAiDa,MAAA,kBAAkB,GAAc;AAC3C,IAAA,EAAE,EAAE,KAAK;AACT,IAAA,MAAM,EAAE,CA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K;gBACG,eAAe,EAAA,CAAA;sBAAvB,KAAK;gBAEG,QAAQ,EAAA,CAAA;sBAAhB,KAAK;gBACG,UAAU,EAAA,CAAA;sBAAlB,KAAK;gBAKO,UAAU,EAAA,CAAA;sBAAtB,KAAK;gBAYO,YAAY,EAAA,CAAA;sBAAxB,KAAK;gBAaG,IAAI,EAAA,CAAA;sBAAZ,KAAK;gBAUO,OAAO,EAAA,CAAA;sBAAnB,KAAK;gBAkBI,aAAa,EAAA,CAAA;sBAAtB,MAAM;gBAIG,WAAW,EAAA,CAAA;sBAApB,MAAM;;;AEtIT;;AAEG;;ACFH;;AAEG;;;;"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Map options interface
3
+ */
4
+ export interface MapOption {
5
+ id: string;
6
+ center?: [number, number];
7
+ draggable?: boolean;
8
+ updateWithClick?: boolean;
9
+ updateWithDoubleClick?: boolean;
10
+ zoom?: number;
11
+ borderRadius?: string;
12
+ scrollable?: boolean;
13
+ zoomControl?: boolean;
14
+ scrollWheelZoom?: boolean;
15
+ addMarker?: boolean;
16
+ }
17
+ /**
18
+ * Marker interface
19
+ */
20
+ export interface MarkerMap {
21
+ lat: number;
22
+ lng: number;
23
+ draggable?: boolean;
24
+ }
25
+ /**
26
+ * Icon interface
27
+ */
28
+ export interface Icon {
29
+ iconSize: [number, number];
30
+ iconAnchor: [number, number];
31
+ iconUrl: string;
32
+ iconRetinaUrl?: string;
33
+ shadowUrl?: string;
34
+ popupAnchor?: [number, number];
35
+ tooltipAnchor?: [number, number];
36
+ shadowSize?: [number, number];
37
+ }
38
+ /**
39
+ * Circle map interface
40
+ */
41
+ export interface CircleMap {
42
+ center: MarkerMap;
43
+ radius: number;
44
+ }
45
+ export declare const DEFAULT_MAP_OPTION: MapOption;