Skip to content

Commit

Permalink
Merge pull request #1041 from Vizzuality/drawing-tool
Browse files Browse the repository at this point in the history
drawn polygon styles
  • Loading branch information
mluena authored Jan 17, 2024
2 parents 99fef4a + d6a9680 commit d75e7ec
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 31 deletions.
24 changes: 9 additions & 15 deletions src/components/map/drawing-tool/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const DRAWING_STYLES: Layer[] = [
},
paint: {
'line-color': '#00857F',
'line-width': 2,
'line-width': 3,
},
},
// polygon fill
Expand All @@ -27,16 +27,6 @@ const DRAWING_STYLES: Layer[] = [
'fill-opacity': 0.1,
},
},
// polygon mid points
{
id: 'gl-draw-polygon-midpoint',
type: 'circle',
filter: ['all', ['==', '$type', 'Point'], ['==', 'meta', 'midpoint']],
paint: {
'circle-radius': 3,
'circle-color': '#fbb03b',
},
},
// polygon outline stroke
// This doesn't style the first edge of the polygon, which uses the line stroke styling instead
{
Expand All @@ -49,7 +39,7 @@ const DRAWING_STYLES: Layer[] = [
},
paint: {
'line-color': '#00857F',
'line-width': 2,
'line-width': 3,
},
},
// vertex point halos
Expand All @@ -59,7 +49,9 @@ const DRAWING_STYLES: Layer[] = [
filter: ['all', ['==', 'meta', 'vertex'], ['==', '$type', 'Point'], ['!=', 'mode', 'static']],
paint: {
'circle-radius': 5,
'circle-color': '#FFF',
'circle-color': 'white',
'circle-stroke-width': 0.5,
'circle-stroke-color': 'hsla(0, 0%, 0%, 0.15)',
},
},
// vertex points
Expand All @@ -68,8 +60,10 @@ const DRAWING_STYLES: Layer[] = [
type: 'circle',
filter: ['all', ['==', 'meta', 'vertex'], ['==', '$type', 'Point'], ['!=', 'mode', 'static']],
paint: {
'circle-radius': 3,
'circle-color': '#00857F',
'circle-radius': 5,
'circle-color': 'white',
'circle-stroke-width': 0.5,
'circle-stroke-color': 'hsla(0, 0%, 0%, 0.15)',
},
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,7 @@ type CardBasemapContextualProps = {
hasDropdown?: boolean;
};

const CardBasemapContextual = ({
id,
mosaic_id,
type,
name,
description,
hasDropdown,
}: CardBasemapContextualProps) => {
const CardBasemapContextual = ({ id, type, name, description }: CardBasemapContextualProps) => {
const [basemapStored, setBasemap] = useRecoilState(basemapAtom);
const [basemapContextualSelected, setBasemapContextual] = useRecoilState(basemapContextualAtom);

Expand Down Expand Up @@ -118,11 +111,6 @@ const CardBasemapContextual = ({
{description && <p>{description}</p>}
</div>
</div>
{/* {isActive && hasDropdown && (
<div className="pb-4">
<DateSelect mosaic_id={mosaic_id} id={id} />
</div>
)} */}
</div>
);
};
Expand Down
2 changes: 0 additions & 2 deletions src/containers/datasets/locations/hooks.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { useRouter } from 'next/router';

import { useQuery, UseQueryOptions, useQueryClient } from '@tanstack/react-query';

import API from 'services/api';
Expand Down
1 change: 0 additions & 1 deletion src/containers/widgets/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import { WIDGETS } from 'containers/datasets';
import Helper from 'containers/guide/helper';
import AppTools from 'containers/navigation';
import WidgetWrapper from 'containers/widget';
import NoData from 'containers/widgets/no-data';

import { Dialog, DialogContent, DialogTrigger, DialogClose } from 'components/dialog';
import { breakpoints } from 'styles/styles.config';
Expand Down

0 comments on commit d75e7ec

Please sign in to comment.