Skip to content

Commit

Permalink
Fix layers type and layer id
Browse files Browse the repository at this point in the history
  • Loading branch information
ManuelStardust committed Jan 13, 2025
1 parent 856495d commit 59eedba
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import BackendAPI from "utils/backendAPI";
import Lines from "pages/search/shared_components/charts/Lines";
import { wrapperMessage } from "pages/search/types/charts";
import { TimelinePAConnectivityController } from "pages/search/drawer/landscape/connectivity/TimelinePAConnectivityController";
import { shapeLayer } from "pages/search/types/layers";

const getLabel = {
prot: "Protegida",
Expand All @@ -33,7 +34,7 @@ interface timelinePAConnState {
texts: {
paConnTimeline: textsObject;
};
layers: Array<any>;
layers: Array<shapeLayer>;
}
class TimelinePAConnectivity extends React.Component<
Props,
Expand Down Expand Up @@ -103,18 +104,18 @@ class TimelinePAConnectivity extends React.Component<
setLoadingLayer(true, false);

const newActiveLayer = {
id: "TimelinePAConn",
id: "timelinePAConn",
name: "Conectividad de áreas protegidas",
};

Promise.all([
this.TimelinePACController.getGeofence(),
this.TimelinePACController.getLayer(),
])
.then(([geofenceLayer, TimelinePAConn]) => {
.then(([geofenceLayer, timelinePAConn]) => {
if (this.mounted) {
this.setState(
() => ({ layers: [geofenceLayer, TimelinePAConn] }),
() => ({ layers: [geofenceLayer, timelinePAConn] }),
() => setLoadingLayer(false, false)
);
setShapeLayers(this.state.layers);
Expand Down

0 comments on commit 59eedba

Please sign in to comment.