문제
내가 값의 목록을 각각 위도 경도.내가 찾을 만드 반투명 히트맵 이미지바일 기기에서 Google Maps.내가 알고있는 서버의 측면 및 플래시 기반의 솔루션 이미지만,나를 구축하려면 이에서 javascript 를 사용하는 캔버스에 태그가 있습니다.
그러나 나는 찾을 수 없는 것에 대한 간략한 설명 알고리즘을 사용하여 좌표 값으로 히트 맵.할 수 있는 사람을 제공하거나 링크하는 하나?
감사합니다.
올바른 솔루션이 없습니다
다른 팁
The basic idea would be to create a grid and project every lat,lng coord to that grid. I would use a 2D array of ints.
The psuedo-code would be:
for each coord
cell = coord projected to grid
increment cell value
end
for 0 to # of passes
for each row
for each col
if grid[row,col] > 0 then
grid[row,col] += 1
increment_adjacent_cells(row, col)
end
end
end
end
So, the idea is that the higher the int value, the hotter that cell is. increment_adjacent_cells should increment the values in all 8 adjacent cells.
가를 해결하기 위해 노력하고 이에서 javascript 캔버스 요소를 사용하여,여기에 내재한 결과:
를 해결 gaussian 필터와 컬러를 매핑하지 않기 때문에,좋은 결과를 제공니다.
Look at this project if you are looking for something that looks more like 'tv weather maps':
A faster way of building a heatmap could be to use a queue:
Pseudocode:
Add an element to queue (first in heatmap(x,y, val))
While (!queue.isEmpty())
{
elem = queue.pop()
queue.push(elem.x + 1, elem.y, val-1)
queue.push(elem.x - 1, elem.y, val-1)
queue.push(elem.x, elem.y + 1, val-1)
queue.push(elem.x, elem.y - 1, val-1)
}
This saves on tons of iterations!