@impargo/react-here-maps
Advanced tools
Comparing version 2.3.0 to 2.4.0
@@ -70,2 +70,16 @@ "use strict"; | ||
}; | ||
var zoomOnMarkersGroup = function (markersGroup, animate) { | ||
if (animate === void 0) { animate = true; } | ||
var DISTANCE_FACTOR = 0.1; | ||
var BEARING_TOP_LEFT = 315; | ||
var BEARING_BOTTOM_RIGHT = 135; | ||
var boundingBox = markersGroup.getBoundingBox(); | ||
var topLeft = boundingBox.getTopLeft(); | ||
var bottomRight = boundingBox.getBottomRight(); | ||
var distance = topLeft.distance(bottomRight) * DISTANCE_FACTOR; | ||
var viewBounds = H.geo.Rect.fromPoints(topLeft.walk(BEARING_TOP_LEFT, distance), bottomRight.walk(BEARING_BOTTOM_RIGHT, distance)); | ||
if (viewBounds) { | ||
map.getViewModel().setLookAtData({ bounds: viewBounds }, animate); | ||
} | ||
}; | ||
var zoomOnMarkers = function (animate, group) { | ||
@@ -78,6 +92,3 @@ if (animate === void 0) { animate = true; } | ||
} | ||
var viewBounds = markersGroupsRef.current[group].getBoundingBox(); | ||
if (viewBounds) { | ||
map.getViewModel().setLookAtData({ bounds: viewBounds }, animate); | ||
} | ||
zoomOnMarkersGroup(markersGroupsRef.current[group], animate); | ||
} | ||
@@ -89,6 +100,3 @@ }; | ||
markersSet.map(function (m) { return markersGroupSet.addObject(m); }); | ||
var viewBounds = markersGroupSet.getBoundingBox(); | ||
if (viewBounds) { | ||
map.getViewModel().setLookAtData({ bounds: viewBounds }, animate); | ||
} | ||
zoomOnMarkersGroup(markersGroupSet, animate); | ||
}; | ||
@@ -95,0 +103,0 @@ var addToMarkerGroup = function (marker, group) { |
{ | ||
"name": "@impargo/react-here-maps", | ||
"version": "2.3.0", | ||
"version": "2.4.0", | ||
"description": "React.js HERE Maps component", | ||
@@ -5,0 +5,0 @@ "main": "dist/main.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
84964
1397