bbj-screen-widget 2.4.69 → 2.4.71

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.
@@ -20618,7 +20618,9 @@
20618
20618
  TiandituComponent.prototype.ngOnInit = function () {
20619
20619
  return __awaiter(this, void 0, void 0, function () {
20620
20620
  return __generator(this, function (_a) {
20621
- i1.scaleAdapter(this.scale$, this.destroy$, this.zone, this.elementRef.nativeElement, this.widgetRef);
20621
+ if (this.scale$) {
20622
+ i1.scaleAdapter(this.scale$, this.destroy$, this.zone, this.elementRef.nativeElement, this.widgetRef);
20623
+ }
20622
20624
  this.initMap();
20623
20625
  return [2 /*return*/];
20624
20626
  });
@@ -20634,8 +20636,14 @@
20634
20636
  _a.sent();
20635
20637
  if (!this.destroyed) {
20636
20638
  this.zone.runOutsideAngular(function () {
20639
+ var options = {
20640
+ zoom: _this.zoom,
20641
+ };
20642
+ if (_this.centerLng && _this.centerLat) {
20643
+ options.center = _this.createLngLat(_this.centerLng, _this.centerLat);
20644
+ }
20637
20645
  _this.map = new T.Map(_this.container.nativeElement, {
20638
- center: _this.createLngLat(_this.centerLng, _this.centerLat),
20646
+ center: _this.createLngLat(_this.centerLng || 120.7, _this.centerLat || 28),
20639
20647
  zoom: _this.zoom,
20640
20648
  });
20641
20649
  // this.mapTypeChange(this.mapTypeValue);
@@ -20682,7 +20690,7 @@
20682
20690
  });
20683
20691
  _this.map.addEventListener('click', function (event) {
20684
20692
  console.log(event);
20685
- _this.mapClick.emit(_this.transferCoordinate(event.latlng));
20693
+ _this.mapClick.emit(_this.transferCoordinate(event.lnglat));
20686
20694
  });
20687
20695
  _this.map.addEventListener('zoomend', function (event) {
20688
20696
  _this.zoomChange.emit(_this.map.getZoom());
@@ -20699,9 +20707,10 @@
20699
20707
  };
20700
20708
  TiandituComponent.prototype.ngOnChanges = function (changes) {
20701
20709
  if (changes.data && this.data[0]) {
20702
- this.centerLng = +this.data[0].lng;
20703
- this.centerLat = +this.data[0].lat;
20704
- this.setCenter(this.centerLng, this.centerLat);
20710
+ var _a = this.data[0], lng = _a.lng, lat = _a.lat;
20711
+ if (lng && lat) {
20712
+ this.setCenter(+lng, +lat);
20713
+ }
20705
20714
  }
20706
20715
  };
20707
20716
  TiandituComponent.prototype.ngOnDestroy = function () {
@@ -20721,6 +20730,9 @@
20721
20730
  };
20722
20731
  TiandituComponent.prototype.transferCoordinate = function (latlng) {
20723
20732
  var _a, _b;
20733
+ if (!latlng) {
20734
+ return {};
20735
+ }
20724
20736
  var lng = latlng.lng, lat = latlng.lat;
20725
20737
  if (this.coordinateType === 'BD-09') {
20726
20738
  _a = __read(i1.wgs84tobd09(lng, lat), 2), lng = _a[0], lat = _a[1];