내 응용 프로그램에서 Google지도를 사용하고 있으며 lat/lon 값으로 채워진 데이터베이스가있는 웹 서버가 있습니다. 나는 그들을지도에 표시하고 싶지만, 또한 그들이 서로의 특정 픽셀 거리 내에 있다면 함께 모으고 싶다.위도/경도를 픽셀로 변환하고 뒤로
clusters[];
while(count(points)) {
cluster[];
point = points.pop();
boundingbox = pixelsToBB(point, pixeldistance, zoomlevel);
query = "select * from database where lat > boundingbox.minlat
and lat < boundingbox.maxlat and lng > boundingbox.minlng
and lng < boundingbox.maxlng";
for (result in executedquery) {
cluster[] += result;
points.remove(result);
}
clusters[] += cluster;
}
pixelsToBB(point, distance, zoomlevel) {
center = convertXY(point, zoomlevel);
maxlng = convertToLng(center.X, distance, zoomlevel);
minlng = convertToLng(center.X, -distance, zoomlevel);
minlat = convertToLat(center.Y, -distance, zoomlevel);
maxlat = convertToLat(center.Y, distance, zoomlevel);
return boundingbox(maxlng, maxlat, minlng, minlat);
}
내 pixelsToBB 기능 필요가 개의 zoomLevel로 무엇을 할 것입니다 :
나는 데이터베이스에서 내 모든 포인트를 검색하면 내가 그림,이 (의사) 같은 것을 할 수 있어야한다? 또는 내 convertToXY, convertToLng 및 convertToLat은 무엇을해야합니까? 나는 이것에 대해 올바른 생각을하고 있는가, 아니면 그것을 할 수있는 더 좋은 방법이 있습니까? 무엇을 검색해야할지 모르겠다. 미안하기 전에 질문을 받았다면.