Skip to content

Commit

Permalink
Zoom to encode image
Browse files Browse the repository at this point in the history
  • Loading branch information
Rub21 committed Jul 14, 2023
1 parent d7eeb82 commit eec73db
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/components/EncodeItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ export const EncodeItem = ({ encodeItem }) => {
const zoomTo = (encodeItem) => {
if (!map) return;
const { bbox, zoom } = encodeItem;
map.getView().fit(bbox);
map.getView().setZoom(zoom);
map.getView().fit(bbox, { padding: [5, 5, 5, 5] });
// Set as active encode image items
dispatchActiveEncodeImageItem({
type: "SET_ACTIVE_ENCODE_IMAGE",
Expand Down
1 change: 0 additions & 1 deletion src/components/map/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import {
} from "./layers";
import { MainContext } from "../../contexts/MainContext";
import { ProjectLayer } from "./ProjectLayer";
import { SpinerLoader } from "./../SpinerLoader";
import { MagicWand } from "./MagicWand";

export function MapWrapper({ children }) {
Expand Down
7 changes: 2 additions & 5 deletions src/components/map/layers.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,7 @@ export const encodeMapViews = new VectorLayer({
style: new Style({
stroke: new Stroke({
width: 3,
color: [46, 249, 35, 1],
}),
fill: new Fill({
color: [46, 249, 35, 0],
color: [255, 191, 11, 1],
}),
}),
zIndex: 7,
Expand All @@ -122,7 +119,7 @@ export const encodeMapViewHighlighted = new VectorLayer({
style: new Style({
stroke: new Stroke({
width: 3,
color: [59, 130, 246, 1],
color: [46, 249, 35, 1],
}),
}),
zIndex: 8,
Expand Down
1 change: 0 additions & 1 deletion src/utils/utils.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as turf from "@turf/turf";
import { geojsonAPI } from "./../config";

/**
* Download file
Expand Down

0 comments on commit eec73db

Please sign in to comment.