Skip to content

Commit f1dba1a

Browse files
committed
Restore zoomies
1 parent e14650e commit f1dba1a

File tree

1 file changed

+13
-28
lines changed

1 file changed

+13
-28
lines changed

packages/base/src/panelview/components/layers.tsx

Lines changed: 13 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -552,21 +552,8 @@ const LayerComponent: React.FC<ILayerProps> = props => {
552552
/**
553553
* Set landmark layer to current map view.
554554
*/
555-
const handleSetLandmarkToCurrentView = () => {
556-
if (!gisModel) {
557-
return;
558-
}
559-
const { zoom, extent } = gisModel.getOptions();
560-
const updatedLayer = {
561-
...layer,
562-
parameters: {
563-
...layer.parameters,
564-
zoom,
565-
extent,
566-
},
567-
};
568-
569-
gisModel.sharedModel.updateLayer(layerId, updatedLayer);
555+
const moveToExtent = () => {
556+
gisModel?.centerOnPosition(layerId);
570557
};
571558

572559
return (
@@ -646,19 +633,17 @@ const LayerComponent: React.FC<ILayerProps> = props => {
646633
</span>
647634
)}
648635

649-
{layer.type === 'LandmarkLayer' && (
650-
<Button
651-
title={'Set landmark to current view'}
652-
onClick={handleSetLandmarkToCurrentView}
653-
minimal
654-
>
655-
<LabIcon.resolveReact
656-
icon={targetWithCenterIcon}
657-
className={LAYER_ICON_CLASS}
658-
tag="span"
659-
/>
660-
</Button>
661-
)}
636+
<Button
637+
title={'Move map to the extent of the layer'}
638+
onClick={moveToExtent}
639+
minimal
640+
>
641+
<LabIcon.resolveReact
642+
icon={targetWithCenterIcon}
643+
className={LAYER_ICON_CLASS}
644+
tag="span"
645+
/>
646+
</Button>
662647
</div>
663648

664649
{/* Show legend only if supported symbology */}

0 commit comments

Comments
 (0)