bbj-screen-widget 2.4.70 → 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.
@@ -20636,8 +20636,14 @@
20636
20636
  _a.sent();
20637
20637
  if (!this.destroyed) {
20638
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
+ }
20639
20645
  _this.map = new T.Map(_this.container.nativeElement, {
20640
- center: _this.createLngLat(_this.centerLng, _this.centerLat),
20646
+ center: _this.createLngLat(_this.centerLng || 120.7, _this.centerLat || 28),
20641
20647
  zoom: _this.zoom,
20642
20648
  });
20643
20649
  // this.mapTypeChange(this.mapTypeValue);
@@ -20684,7 +20690,7 @@
20684
20690
  });
20685
20691
  _this.map.addEventListener('click', function (event) {
20686
20692
  console.log(event);
20687
- _this.mapClick.emit(_this.transferCoordinate(event.latlng));
20693
+ _this.mapClick.emit(_this.transferCoordinate(event.lnglat));
20688
20694
  });
20689
20695
  _this.map.addEventListener('zoomend', function (event) {
20690
20696
  _this.zoomChange.emit(_this.map.getZoom());
@@ -20701,9 +20707,10 @@
20701
20707
  };
20702
20708
  TiandituComponent.prototype.ngOnChanges = function (changes) {
20703
20709
  if (changes.data && this.data[0]) {
20704
- this.centerLng = +this.data[0].lng;
20705
- this.centerLat = +this.data[0].lat;
20706
- 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
+ }
20707
20714
  }
20708
20715
  };
20709
20716
  TiandituComponent.prototype.ngOnDestroy = function () {
@@ -20723,6 +20730,9 @@
20723
20730
  };
20724
20731
  TiandituComponent.prototype.transferCoordinate = function (latlng) {
20725
20732
  var _a, _b;
20733
+ if (!latlng) {
20734
+ return {};
20735
+ }
20726
20736
  var lng = latlng.lng, lat = latlng.lat;
20727
20737
  if (this.coordinateType === 'BD-09') {
20728
20738
  _a = __read(i1.wgs84tobd09(lng, lat), 2), lng = _a[0], lat = _a[1];