Skip to content

Commit

Permalink
fix: use padding instad of maxZoom for PrevieMap
Browse files Browse the repository at this point in the history
  • Loading branch information
KaiVolland committed Jun 18, 2024
1 parent 034859b commit e572f73
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Component/PreviewMap/PreviewMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/

import React, { useCallback, useEffect, useRef } from 'react';

import OlMap from 'ol/Map';
Expand Down Expand Up @@ -106,7 +105,7 @@ export const PreviewMap: React.FC<PreviewMapProps> = ({
const dataLayer = dataLayerRef.current;
const extent = dataLayer.getSource().getExtent();
if (extent && !isEmpty(extent)) {
map.getView().fit(extent, { maxZoom: 10 });
map.getView().fit(extent, { padding: [20, 20, 20, 20] });
}
};

Expand Down

0 comments on commit e572f73

Please sign in to comment.