You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
753 B
26 lines
753 B
import { Layer } from "react-map-gl";
|
|
import { getPointSymbolLayer } from "./layers-config";
|
|
import { useLayersVisibility } from "../../stores/useLayersVisibility";
|
|
import { LAYER_IDS } from "./constants";
|
|
|
|
export const PVZ = ({id, categoryId}) => {
|
|
const { isVisible } = useLayersVisibility();
|
|
const filter = ["==", ["get", "group_id"], id]
|
|
|
|
return (
|
|
<>
|
|
<Layer
|
|
{...getPointSymbolLayer(String(id))}
|
|
id={LAYER_IDS.pvz + id}
|
|
source={"pvz"}
|
|
source-layer={"public.service_post_and_pvz"}
|
|
layout={{
|
|
...getPointSymbolLayer(String(id)).layout,
|
|
visibility: isVisible[LAYER_IDS.pvz_category + categoryId] ? "visible" : "none",
|
|
}}
|
|
filter={filter}
|
|
/>
|
|
</>
|
|
);
|
|
};
|