현재 마커를 클러스터하려면 MarkerClustererPlus을 사용하고 있습니다. (다른 제안은 환영합니다.) 그리고 나는 대륙이 아닌 대륙이나 국가라고 말할 수있는 방법이 있는지 궁금합니다. 감사합니다.국가별로 Google지도 아이콘을 클러스터링 할 수있는 방법이 있습니까?
4
A
답변
3
이 메시지는 Marker Manager이며, 실제로 현재 사용중인 라이브러리와 동일한 서버에 있습니다. 여기에 예제를 제공 할 필요가 없다고 생각합니다. 모두 right here입니다.
3
은 지역에 따라 클러스터링이 코드 .. 마커에서 온 않는
var keys = [];
var markerCluster = [];
var markers = new Object();
var map;
function initialize(){
var mapProp = {
center:center,
zoom:5,
mapTypeId:google.maps.MapTypeId.ROADMAP
};
map=new google.maps.Map(document.getElementById("googleMap")
,mapProp);
//styling cluster image..
var clusterStyles = [
{
opt_textColor: 'black',
url: 'images/cluster.png',
height: 56,
width: 55
},
{
opt_textColor: 'black',
url: 'images/cluster2.png',
height: 53,
width: 52
}
];
//cluster marker options..
var mcOptions = {
// gridSize: 16,
styles: clusterStyles,
maxZoom: 15
};
function initialize(){
var mapProp = {
center:center,
zoom:5,
mapTypeId:google.maps.MapTypeId.ROADMAP
};
map=new google.maps.Map(document.getElementById("googleMap")
,mapProp);
//styling cluster image..
var clusterStyles = [
{
opt_textColor: 'black',
url: 'images/cluster.png',
height: 56,
width: 55
},
{
opt_textColor: 'black',
url: 'images/cluster2.png',
height: 53,
width: 52
}
];
//cluster marker options..
var mcOptions = {
// gridSize: 16,
styles: clusterStyles,
maxZoom: 15
};
//fetching lat long from data base
<?php echo "addmarker(lat,lng); ?>"
for(var k in markers) keys.push(k);
for(var i = 0; i < keys.length; i++)
{
markerCluster[i] = new MarkerClusterer(map, markers[keys[i]],mcOptions);
}
}
function addmarker(lat, lng)
{
var provnce;
var mycenter = new google.maps.LatLng(lat,lng);
var marker = new google.maps.Marker({
position:mycenter,
title:infoName,
id: count++
// animation:google.maps.Animation.BOUNCE
});
//clustering markers based on region..
$.ajax({ url:'https://maps.googleapis.com/maps/api/geocode/json? latlng='+lat+','+lng+'&sensor=true',
async: false,
success: function(data){
// console.log(data.results[0]);
// return;
for (var i=0; i<data.results[0].address_components.length; i++)
{
if (data.results[0].address_components[i].types[0] == "administrative_area_level_1") {
//this is the object for province
provnce = data.results[0].address_components[i]['long_name'];
}
}
provnce = provnce.split(" ",1);
if(markers.hasOwnProperty(provnce))
{
markers[provnce].push(marker);
}
else
{
markers[provnce] = new Array();
markers[provnce].push(marker);
}
// console.log(markers);
}
});
}
관련 문제
- 1. 어떻게하면 Google지도 아이콘을 전환 할 수 있습니까?
- 2. Google지도 지역 기반 클러스터링
- 3. Google지도 - 서버 측 클러스터링
- 4. Google지도 V3에 다른 마커를 동적으로 삽입 할 수있는 방법이 있습니까?
- 5. Google지도 마커 클러스터링 - markerclusterPlus
- 6. Google지도 아이콘을 드래그 할 수 있습니다.
- 7. 수집 할 수있는 방법이 있습니까?
- 8. Google지도 아이콘을 확장하면 업데이트시 원활하게 애니메이션을 적용 할 수 있습니까?
- 9. Google지도 - 아이콘을 만들어 사라지게합니다.
- 10. Google지도 : 도시에 StreetView가 아닌 자세한지도가 있는지 확인할 수있는 방법이 있습니까?
- 11. SearchRecentSuggestionsProvider에 대한 아이콘을 지정하는 방법이 있습니까?
- 12. 마커 클러스터링 - 퓨전 테이블 레이어 - Google지도 v3
- 13. 델파이의 기본 EXE 아이콘을 변경하는 방법이 있습니까?
- 14. 배열을 사용하여 Google지도 아이콘을 플로팅
- 15. Google지도 아이콘을 카테고리별로 켜기/끄기
- 16. Google지도 : 축소하지 않고 아이콘을 추가하는 방법
- 17. Mediafire 링크를 다운로드 할 수있는 방법이 있습니까?
- 18. DataGrid에서 CheckBox를 표시 할 수있는 방법이 있습니까
- 19. JavaScript로 마우스를 구별 할 수있는 방법이 있습니까?
- 20. XDocument에 서명 할 수있는 방법이 있습니까?
- 21. 쿼리 작성기없이 제거 할 수있는 방법이 있습니까
- 22. 변수를 var_dump 할 수있는 방법이 있습니까?
- 23. PDF를 가로로 스크롤 할 수있는 방법이 있습니까?
- 24. PictureBox에 반투명하게 페인트 할 수있는 방법이 있습니까?
- 25. TriggerAction 클래스에서 상속 할 수있는 방법이 있습니까?
- 26. 아이폰에 데이터베이스를 공유 할 수있는 방법이 있습니까?
- 27. TinyScheme에서 입출력을 라우팅 할 수있는 방법이 있습니까?
- 28. 결과 쿼리를 메모리에로드 할 수있는 방법이 있습니까?
- 29. 일반 methodInfo를 호출 할 수있는 방법이 있습니까?
- 30. iDevice 사용자를 식별 할 수있는 방법이 있습니까?
를 시도? 데이터베이스에서 온 경우 서버 측에서 원하는 모든 매개 변수에 따라 클러스터링 (그룹화)하는 것이 매우 간단해야합니다. – Marcelo
가능한 중복 http://stackoverflow.com/questions/12592079/google-maps-api-v3-utilize-markercluster-ba--have-the-clusters-themselves-be – geocodezip