Fix ESLint indent and unused variable in map composables.
This commit is contained in:
@@ -119,15 +119,15 @@ export function useAlprCameras() {
|
|||||||
try {
|
try {
|
||||||
const fetched = missing.length
|
const fetched = missing.length
|
||||||
? await Promise.all(missing.map(async (tile) => {
|
? await Promise.all(missing.map(async (tile) => {
|
||||||
const params = new URLSearchParams({
|
const params = new URLSearchParams({
|
||||||
south: String(tile.south),
|
south: String(tile.south),
|
||||||
west: String(tile.west),
|
west: String(tile.west),
|
||||||
north: String(tile.north),
|
north: String(tile.north),
|
||||||
east: String(tile.east),
|
east: String(tile.east),
|
||||||
})
|
})
|
||||||
const data = await $fetch(`/api/alpr?${params}`).catch(() => null)
|
const data = await $fetch(`/api/alpr?${params}`).catch(() => null)
|
||||||
return [bboxToTileKey(tile), data?.features ?? []]
|
return [bboxToTileKey(tile), data?.features ?? []]
|
||||||
}))
|
}))
|
||||||
: []
|
: []
|
||||||
|
|
||||||
if (id !== requestId.value) return
|
if (id !== requestId.value) return
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ export function useCotStream(boundsRef, layerQueryRef) {
|
|||||||
const subscribedKey = ref('')
|
const subscribedKey = ref('')
|
||||||
const streamBounds = ref(null)
|
const streamBounds = ref(null)
|
||||||
|
|
||||||
const setEntities = record => {
|
const setEntities = (record) => {
|
||||||
entities.value = Object.freeze(record)
|
entities.value = Object.freeze(record)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,8 +66,9 @@ export function useCotStream(boundsRef, layerQueryRef) {
|
|||||||
}))
|
}))
|
||||||
es.addEventListener('remove', e => parseEvent(e, ({ id }) => {
|
es.addEventListener('remove', e => parseEvent(e, ({ id }) => {
|
||||||
if (!id) return
|
if (!id) return
|
||||||
const { [id]: _removed, ...rest } = entities.value
|
setEntities(Object.fromEntries(
|
||||||
setEntities(rest)
|
Object.entries(entities.value).filter(([key]) => key !== String(id)),
|
||||||
|
))
|
||||||
}))
|
}))
|
||||||
es.onerror = () => {
|
es.onerror = () => {
|
||||||
closeStream()
|
closeStream()
|
||||||
|
|||||||
Reference in New Issue
Block a user