@reltio/components 1.4.1866 → 1.4.1867

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.
@@ -43,10 +43,11 @@ exports.getDrawingMode = getDrawingMode;
43
43
  var fitMapBoundsForMarkers = function (markers, map, overlay) {
44
44
  var bounds = new window.google.maps.LatLngBounds();
45
45
  markers.forEach(function (marker) { return bounds.extend(marker.point); });
46
- if (markers.length === 1) {
47
- var center = bounds.getCenter();
48
- bounds.extend(new window.google.maps.LatLng(center.lat() + constants_1.MAP_MINIMUM_SCALE_RADIUS, center.lng() + constants_1.MAP_MINIMUM_SCALE_RADIUS));
49
- bounds.extend(new window.google.maps.LatLng(center.lat() - constants_1.MAP_MINIMUM_SCALE_RADIUS, center.lng() - constants_1.MAP_MINIMUM_SCALE_RADIUS));
46
+ var needAlignZoomLevel = markers.length === 1;
47
+ if (needAlignZoomLevel) {
48
+ var markerPoint = markers[0].point;
49
+ bounds.extend(new window.google.maps.LatLng(markerPoint.lat + constants_1.MAP_MINIMUM_SCALE_RADIUS, markerPoint.lng + constants_1.MAP_MINIMUM_SCALE_RADIUS));
50
+ bounds.extend(new window.google.maps.LatLng(markerPoint.lat - constants_1.MAP_MINIMUM_SCALE_RADIUS, markerPoint.lng - constants_1.MAP_MINIMUM_SCALE_RADIUS));
50
51
  }
51
52
  map.fitBounds(bounds);
52
53
  if (overlay) {
@@ -1,7 +1,5 @@
1
- export declare const MAP_DRAWING_MODES: {
2
- CIRCLE: string;
3
- POLYGON: string;
4
- };
1
+ import { DrawingMode } from '../components/ReltioMap/types';
2
+ export declare const MAP_DRAWING_MODES: Record<string, DrawingMode>;
5
3
  export declare const DEFAULT_OVERLAY_OPTIONS: {
6
4
  fillColor: string;
7
5
  fillOpacity: number;
@@ -38,10 +38,11 @@ export var getDrawingMode = function (drawingMode) {
38
38
  export var fitMapBoundsForMarkers = function (markers, map, overlay) {
39
39
  var bounds = new window.google.maps.LatLngBounds();
40
40
  markers.forEach(function (marker) { return bounds.extend(marker.point); });
41
- if (markers.length === 1) {
42
- var center = bounds.getCenter();
43
- bounds.extend(new window.google.maps.LatLng(center.lat() + MAP_MINIMUM_SCALE_RADIUS, center.lng() + MAP_MINIMUM_SCALE_RADIUS));
44
- bounds.extend(new window.google.maps.LatLng(center.lat() - MAP_MINIMUM_SCALE_RADIUS, center.lng() - MAP_MINIMUM_SCALE_RADIUS));
41
+ var needAlignZoomLevel = markers.length === 1;
42
+ if (needAlignZoomLevel) {
43
+ var markerPoint = markers[0].point;
44
+ bounds.extend(new window.google.maps.LatLng(markerPoint.lat + MAP_MINIMUM_SCALE_RADIUS, markerPoint.lng + MAP_MINIMUM_SCALE_RADIUS));
45
+ bounds.extend(new window.google.maps.LatLng(markerPoint.lat - MAP_MINIMUM_SCALE_RADIUS, markerPoint.lng - MAP_MINIMUM_SCALE_RADIUS));
45
46
  }
46
47
  map.fitBounds(bounds);
47
48
  if (overlay) {
@@ -1,7 +1,5 @@
1
- export declare const MAP_DRAWING_MODES: {
2
- CIRCLE: string;
3
- POLYGON: string;
4
- };
1
+ import { DrawingMode } from '../components/ReltioMap/types';
2
+ export declare const MAP_DRAWING_MODES: Record<string, DrawingMode>;
5
3
  export declare const DEFAULT_OVERLAY_OPTIONS: {
6
4
  fillColor: string;
7
5
  fillOpacity: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reltio/components",
3
- "version": "1.4.1866",
3
+ "version": "1.4.1867",
4
4
  "license": "SEE LICENSE IN LICENSE FILE",
5
5
  "main": "./cjs/index.js",
6
6
  "module": "./esm/index.js",