@progress/kendo-charts 1.24.0 → 1.24.1-dev.202207281230

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,2 +1,5 @@
1
1
  export var SHOW_TOOLTIP = 'showTooltip';
2
2
  export var HIDE_TOOLTIP = 'hideTooltip';
3
+ export var CENTER_CHANGE = 'centerChange';
4
+ export var ZOOM_CHANGE = 'zoomChange';
5
+ export var INIT = 'init';
@@ -79,6 +79,8 @@ import {
79
79
 
80
80
  import MapService from './../services/map-service';
81
81
 
82
+ import { CENTER_CHANGE, INIT, ZOOM_CHANGE } from './constants';
83
+
82
84
  var math = Math,
83
85
  min = math.min,
84
86
  pow = math.pow,
@@ -173,6 +175,7 @@ var Map = (function (Observable) {
173
175
 
174
176
  this.initObserver(context);
175
177
  this.initServices(context);
178
+ this._notifyObserver(INIT);
176
179
 
177
180
  this._initOptions(options);
178
181
  this._setEvents(options);
@@ -293,6 +296,8 @@ var Map = (function (Observable) {
293
296
 
294
297
  if (options.zoom !== zoomLevel) {
295
298
  options.zoom = zoomLevel;
299
+ this.widgetService.notify(ZOOM_CHANGE, { zoom: options.zoom });
300
+
296
301
  this._reset();
297
302
  }
298
303
  result = this;
@@ -307,8 +312,14 @@ var Map = (function (Observable) {
307
312
  var result;
308
313
 
309
314
  if (center$1) {
310
- this.options.center = Location.create(center$1).toArray();
311
- this._reset();
315
+ var current = Location.create(center$1);
316
+ var previous = Location.create(this.options.center);
317
+ if (!current.equals(previous)) {
318
+ this.options.center = current.toArray();
319
+ this.widgetService.notify(CENTER_CHANGE, { center: this.options.center });
320
+ this._reset();
321
+ }
322
+
312
323
  result = this;
313
324
  } else {
314
325
  result = Location.create(this.options.center);
@@ -440,6 +451,7 @@ var Map = (function (Observable) {
440
451
  topLeft.x += size.width / 2;
441
452
  topLeft.y += size.height / 2;
442
453
  this.options.center = this.layerToLocation(topLeft, zoom).toArray();
454
+ this.widgetService.notify(CENTER_CHANGE, { center: this.options.center });
443
455
 
444
456
  return this;
445
457
  };
@@ -1,2 +1,5 @@
1
1
  export const SHOW_TOOLTIP = 'showTooltip';
2
2
  export const HIDE_TOOLTIP = 'hideTooltip';
3
+ export const CENTER_CHANGE = 'centerChange';
4
+ export const ZOOM_CHANGE = 'zoomChange';
5
+ export const INIT = 'init';
@@ -79,6 +79,8 @@ import {
79
79
 
80
80
  import MapService from './../services/map-service';
81
81
 
82
+ import { CENTER_CHANGE, INIT, ZOOM_CHANGE } from './constants';
83
+
82
84
  let math = Math,
83
85
  min = math.min,
84
86
  pow = math.pow,
@@ -159,6 +161,7 @@ class Map extends Observable {
159
161
 
160
162
  this.initObserver(context);
161
163
  this.initServices(context);
164
+ this._notifyObserver(INIT);
162
165
 
163
166
  this._initOptions(options);
164
167
  this._setEvents(options);
@@ -271,6 +274,8 @@ class Map extends Observable {
271
274
 
272
275
  if (options.zoom !== zoomLevel) {
273
276
  options.zoom = zoomLevel;
277
+ this.widgetService.notify(ZOOM_CHANGE, { zoom: options.zoom });
278
+
274
279
  this._reset();
275
280
  }
276
281
  result = this;
@@ -285,8 +290,14 @@ class Map extends Observable {
285
290
  let result;
286
291
 
287
292
  if (center) {
288
- this.options.center = Location.create(center).toArray();
289
- this._reset();
293
+ const current = Location.create(center);
294
+ const previous = Location.create(this.options.center);
295
+ if (!current.equals(previous)) {
296
+ this.options.center = current.toArray();
297
+ this.widgetService.notify(CENTER_CHANGE, { center: this.options.center });
298
+ this._reset();
299
+ }
300
+
290
301
  result = this;
291
302
  } else {
292
303
  result = Location.create(this.options.center);
@@ -416,6 +427,7 @@ class Map extends Observable {
416
427
  topLeft.x += size.width / 2;
417
428
  topLeft.y += size.height / 2;
418
429
  this.options.center = this.layerToLocation(topLeft, zoom).toArray();
430
+ this.widgetService.notify(CENTER_CHANGE, { center: this.options.center });
419
431
 
420
432
  return this;
421
433
  }