|
|
@ -49,32 +49,32 @@ function getImage(name, situation) { |
|
|
|
} |
|
|
|
|
|
|
|
if (name == "rain") { |
|
|
|
if (situation == "sem chuva") { |
|
|
|
if (situation == "SEM CHUVA") { |
|
|
|
return custom_assets_pin.rainLevel[0]; |
|
|
|
} else if (situation == "chuva fraca") { |
|
|
|
} else if (situation == "CHUVA FRACA") { |
|
|
|
return custom_assets_pin.rainLevel[1]; |
|
|
|
} else if (situation == "chuva moderada") { |
|
|
|
} else if (situation == "CHUVA MODERADA") { |
|
|
|
return custom_assets_pin.rainLevel[2]; |
|
|
|
} else if (situation == "chuva forte") { |
|
|
|
} else if (situation == "CHUVA FORTE") { |
|
|
|
return custom_assets_pin.rainLevel[3]; |
|
|
|
} |
|
|
|
return custom_assets_pin.rainLevel[3]; |
|
|
|
} |
|
|
|
|
|
|
|
if (name == "riverFlood") { |
|
|
|
if (situation == "baixo") { |
|
|
|
if (situation == "BAIXO") { |
|
|
|
return custom_assets_pin.riverLevel[0]; |
|
|
|
} else if (situation == "normal") { |
|
|
|
} else if (situation == "NORMAL") { |
|
|
|
return custom_assets_pin.riverLevel[1]; |
|
|
|
} else if (situation == "alto") { |
|
|
|
} else if (situation == "ALTO") { |
|
|
|
return custom_assets_pin.riverLevel[2]; |
|
|
|
} else if (situation == "inundar") { |
|
|
|
} else if (situation == "INUNDAR") { |
|
|
|
return custom_assets_pin.riverLevel[3]; |
|
|
|
} |
|
|
|
return custom_assets_pin.riverLevel[0]; |
|
|
|
} |
|
|
|
if (name == "floodZones") { |
|
|
|
if (situation == "transitavel") { |
|
|
|
if (situation == "TRANSITAVEL") { |
|
|
|
return custom_assets_pin.floodZones.passable; |
|
|
|
} else { |
|
|
|
return custom_assets_pin.floodZones.not_passable; |
|
|
@ -126,28 +126,41 @@ function buildPolygonsObject(response, name) { |
|
|
|
var r = JSON.parse(response); |
|
|
|
var coordinate = []; |
|
|
|
var formsanswersgeom = r.formsanswersgeom; |
|
|
|
const arrayCoordinates = JSON.parse(formsanswersgeom)["coordinates"][0]; |
|
|
|
var n = Object.keys(arrayCoordinates).length; |
|
|
|
if (JSON.parse(formsanswersgeom).type == "Polygon") { |
|
|
|
const arrayCoordinates = JSON.parse(formsanswersgeom)["coordinates"][0]; |
|
|
|
var n = Object.keys(arrayCoordinates).length; |
|
|
|
|
|
|
|
for (let i = 0; i < n; i++) { |
|
|
|
var lat = arrayCoordinates[i][1]; |
|
|
|
var lon = arrayCoordinates[i][0]; |
|
|
|
coordinate.push([lat, lon]); |
|
|
|
for (let i = 0; i < n; i++) { |
|
|
|
var lat = arrayCoordinates[i][1]; |
|
|
|
var lon = arrayCoordinates[i][0]; |
|
|
|
coordinate.push([lat, lon]); |
|
|
|
} |
|
|
|
return { |
|
|
|
ID: r.formsanswersid, |
|
|
|
name: name, |
|
|
|
title: "Titulo", //response.fieldsanswerssituation
|
|
|
|
address: "Endereço", //response.fieldsanswerseventaddress,
|
|
|
|
coordinate: coordinate, |
|
|
|
date: "data" + " | " + "hora", //response.fieldsanswerseventdate + " | " + response.fieldsanswerseventtime,
|
|
|
|
description: "comentário", //response.fielsanswercomment,
|
|
|
|
logo: custom_assets.pluviometer, |
|
|
|
pictures: null, |
|
|
|
image: "", //getMarkerImage(answer.name),
|
|
|
|
}; |
|
|
|
} else { |
|
|
|
return { |
|
|
|
ID: r.formsanswersid, |
|
|
|
name: name, |
|
|
|
title: "Titulo", //response.fieldsanswerssituation
|
|
|
|
address: "Endereço", //response.fieldsanswerseventaddress,
|
|
|
|
coordinate: [null, null], |
|
|
|
date: "data" + " | " + "hora", //response.fieldsanswerseventdate + " | " + response.fieldsanswerseventtime,
|
|
|
|
description: "comentário", //response.fielsanswercomment,
|
|
|
|
logo: custom_assets.pluviometer, |
|
|
|
pictures: null, |
|
|
|
image: "", //getMarkerImage(answer.name),
|
|
|
|
};; |
|
|
|
} |
|
|
|
var polygonObject = { |
|
|
|
ID: r.formsanswersid, |
|
|
|
name: name, |
|
|
|
title: "Titulo", //response.fieldsanswerssituation
|
|
|
|
address: "Endereço", //response.fieldsanswerseventaddress,
|
|
|
|
coordinate: coordinate, |
|
|
|
date: "data" + " | " + "hora", //response.fieldsanswerseventdate + " | " + response.fieldsanswerseventtime,
|
|
|
|
description: "comentário", //response.fielsanswercomment,
|
|
|
|
logo: custom_assets.pluviometer, |
|
|
|
pictures: null, |
|
|
|
image: "", //getMarkerImage(answer.name),
|
|
|
|
}; |
|
|
|
|
|
|
|
return polygonObject; |
|
|
|
} |
|
|
|
|
|
|
|
function buildMarkerObject(response, name) { |
|
|
|
xxxxxxxxxx