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.
23 lines
632 B
23 lines
632 B
export var computeArea=function(val,reat){
|
|
var longitude={
|
|
min: Math.min(...val.map(v=>v.longitude)),
|
|
max: Math.max(...val.map(v=>v.longitude)),
|
|
}
|
|
var latitude={
|
|
min: Math.min(...val.map(v=>v.latitude)),
|
|
max: Math.max(...val.map(v=>v.latitude)),
|
|
}
|
|
longitude.len=longitude.max-longitude.min
|
|
latitude.len=latitude.max-latitude.min
|
|
return {
|
|
longitude,
|
|
latitude,
|
|
center: {
|
|
longitude: longitude.min+longitude.len/2,
|
|
latitude: latitude.min+latitude.len/2,
|
|
}
|
|
}
|
|
}
|
|
export const code=function(date=''){
|
|
return `${new Date(date).format('yyyyMMdd', new Date().format('yyyyMMdd'))}${new Date().format('hhmmss')}`
|
|
}
|