maps.js icon indicating copy to clipboard operation
maps.js copied to clipboard

네이버맵에서 점지도에 관한 문의입니다.

Open happyboi opened this issue 8 years ago • 6 comments

    var mapSize = map.length;
    var trffQty = null;
	var data = [];
		for (var i = 0; i < mapSize; i++) {
			var coord = naverMapJs.getWgsCoords( map[i].POSX, map[i].POSY );
			var coords = new naver.maps.LatLng(coord.y, coord.x);
			var qty = null;
			
			var _trffQty = map[i].TRFF_QTY;
			
			if(_trffQty > 80){
				trffQty = 12;
			}else{
				if(_trffQty > 11){
					trffQty = 10;
				}else if(_trffQty >= 9 && _trffQty <= 10 ){
					trffQty = 8;
				}else if(_trffQty >= 7 && _trffQty <= 8 ){
					trffQty = 6;
				}else if(_trffQty >= 5 && _trffQty <= 6 ){
					trffQty = 4;
				}else if(_trffQty >= 3 && _trffQty <= 4 ){
					trffQty = 2;
				}else if(_trffQty >= 1 && _trffQty <= 2 ){
					trffQty = 1;
				}else if(_trffQty >= 0 && _trffQty <= 1 ){
					trffQty = 0.5;
				}else{
					trffQty = 0.5;
				}
			}
				data.push(new naver.maps.visualization.WeightedLocation(coords.y, coords.x, trffQty*0.1));		
	}	
	var dotMap = new naver.maps.visualization.DotMap({
		map:naverMap,
		data : data,
		radius: 30
	});

제가 원하는 크기로 위의 코드 방식으로 줄 경우 맵상에서 보여주는 종류가 갯수 제한이 있는건가요? if(trffQty > 11) << 이 부분에서 11이 있는데 이 조건을 타지 않고 else 를 갈 경우는 점지도가 잘 나옵니다. 그러나 if(trffQty >= 11) 이런식으로 if문을 변경했을 경우 11도 포함 되기 때문에 else를 타지 않고 맵상에서 보여지는 것은 trffQty의 12, 10, 8, 6 정도 되는거 같습니다. 왜 이러한지 이유를 못찾아서 문의 합니다.

happyboi avatar Jun 12 '17 00:06 happyboi

@happyboi 님, 혹시 저희쪽에서 접근해 확인할 수 있는 URL이 있나요? 그렇지 않다면 저희쪽에서 재현할 수 있게 > 11 일 때와 >= 11 일 때의 데이터 셋(DotMap 옵션에 넣는 data)을 올려주시면 좋겠습니다.

thetaiz avatar Jun 12 '17 01:06 thetaiz

(lat:36.2802524,lng:127.4645506,weight:0.1),(lat:36.3402749,lng:127.4066477,weight:0.1), (lat:36.3425735,lng:127.4087955,weight:0.1),(lat:36.336609,lng:127.4157852,weight:0.1), (lat:36.3334145,lng:127.4197233,weight:0.1),(lat:36.3302803,lng:127.4199056,weight:0.1), (lat:36.3168968,lng:127.3908431,weight:0.1),(lat:36.3235505,lng:127.4007976,weight:0.1), (lat:36.3207389,lng:127.4057315,weight:0.1),(lat:36.3240127,lng:127.4102149,weight:0.1), (lat:36.3262501,lng:127.426992,weight:0.1),(lat:36.3190385,lng:127.431801,weight:0.1), (lat:36.2868737,lng:127.3784555,weight:0.1),(lat:36.3492265,lng:127.3902408,weight:0.1), (lat:36.3513854,lng:127.3903983,weight:0.1),(lat:36.3558415,lng:127.3898423,weight:0.2), (lat:36.3577781,lng:127.3898687,weight:0.1),(lat:36.3487495,lng:127.3954692,weight:0.1), (lat:36.358841,lng:127.4319789,weight:0.1),(lat:36.3471431,lng:127.4319638,weight:0.1), (lat:36.3538164,lng:127.4384845,weight:0.2),(lat:36.3454425,lng:127.4454968,weight:0.1), (lat:36.3309252,lng:127.4325101,weight:0.1),(lat:36.3290001,lng:127.4341205,weight:0.1), (lat:36.3331065,lng:127.4263882,weight:0.1),(lat:36.3404394,lng:127.4358948,weight:0.1), (lat:36.3363111,lng:127.4469434,weight:0.1),(lat:36.3219298,lng:127.4380081,weight:0.1), (lat:36.3264132,lng:127.4444278,weight:0.1),(lat:36.3356136,lng:127.4234944,weight:0.1), (lat:36.3510898,lng:127.4424171,weight:0.1),(lat:36.323259,lng:127.3852561,weight:0.1), (lat:36.3594398,lng:127.3899011,weight:0.2),(lat:36.3487691,lng:127.4510913,weight:0.1), (lat:36.4075662,lng:127.3750422,weight:0.1),(lat:36.3856038,lng:127.3539789,weight:0.1), (lat:36.39024,lng:127.4052302,weight:0.8),(lat:36.3801992,lng:127.4071209,weight:1), (lat:36.3748877,lng:127.379898,weight:0.1),(lat:36.3745249,lng:127.3933909,weight:0.6000000000000001), (lat:36.3649953,lng:127.3902945,weight:0.8),(lat:36.3644423,lng:127.3935113,weight:0.4), (lat:36.3706593,lng:127.379792,weight:0.1),(lat:36.41903,lng:127.3851212,weight:0.1), (lat:36.4509052,lng:127.4290604,weight:0.1),(lat:36.3777325,lng:127.4110066,weight:1.2000000000000002), (lat:36.367298,lng:127.4005766,weight:0.1),(lat:36.36759,lng:127.419501,weight:0.05), (lat:36.3729484,lng:127.4198876,weight:0.6000000000000001),(lat:36.3729941,lng:127.4246549,weight:0.6000000000000001),(lat:36.3664029,lng:127.4229962,weight:0.1),(lat:36.374723,lng:127.4281102,weight:0.4), (lat:36.3708179,lng:127.4286503,weight:0.4),(lat:36.3670671,lng:127.4297456,weight:0.1), (lat:36.3616982,lng:127.4317642,weight:0.2),(lat:36.3571486,lng:127.4047681,weight:0.1), (lat:36.3529348,lng:127.409661,weight:0.1),(lat:36.3482152,lng:127.41557,weight:0.2), (lat:36.3505083,lng:127.4190562,weight:0.2),(lat:36.3585129,lng:127.4203359,weight:0.4), (lat:36.358935,lng:127.4487471,weight:0.1),(lat:36.3579136,lng:127.4457321,weight:0.1), (lat:36.3558361,lng:127.4451078,weight:0.1),(lat:36.3546089,lng:127.4549011,weight:0.1), (lat:36.4012709,lng:127.4228982,weight:0.1),(lat:36.3678806,lng:127.4340052,weight:0.1), (lat:36.362056,lng:127.4355484,weight:0.1),(lat:36.3389154,lng:127.4007399,weight:0.1)

url 접근 할수가 있는 방향이 없어서 data에 들어가는 내용입니다. 위의 데이타는 11이 포함되지 않아 else 부분을 타는 데이타 내용입니다.

happyboi avatar Jun 13 '17 05:06 happyboi

@happyboi 님, 해당 데이터를 이용해 그리면 대략 아래와 같이 값이 설정됩니다. 점지도 경우 가중치를 1 ~ {반지름}로 정규화하고, 해당 값을 점지도를 표현하는 점의 반지름으로 사용합니다. 따라서 1 픽셀로 정의되는 경우 확대해서 보지 않으면 보이지 않게 됩니다.

Min Weight: 0.05 Max Weight: 1.2000000000000002 Input Weight: 0.1 Normalized: 0.043478260869565216 Weighted Radius: 1.391304347826087
Min Weight: 0.05 Max Weight: 1.2000000000000002 Input Weight: 0.2 Normalized: 0.13043478260869565 Weighted Radius: 2.1739130434782608
Min Weight: 0.05 Max Weight: 1.2000000000000002 Input Weight: 0.1 Normalized: 0.043478260869565216 Weighted Radius: 1.391304347826087
Min Weight: 0.05 Max Weight: 1.2000000000000002 Input Weight: 0.2 Normalized: 0.13043478260869565 Weighted Radius: 2.1739130434782608
Min Weight: 0.05 Max Weight: 1.2000000000000002 Input Weight: 0.1 Normalized: 0.043478260869565216 Weighted Radius: 1.391304347826087
Min Weight: 0.05 Max Weight: 1.2000000000000002 Input Weight: 0.2 Normalized: 0.13043478260869565 Weighted Radius: 2.1739130434782608
Min Weight: 0.05 Max Weight: 1.2000000000000002 Input Weight: 0.1 Normalized: 0.043478260869565216 Weighted Radius: 1.391304347826087
Min Weight: 0.05 Max Weight: 1.2000000000000002 Input Weight: 0.2 Normalized: 0.13043478260869565 Weighted Radius: 2.1739130434782608
Min Weight: 0.05 Max Weight: 1.2000000000000002 Input Weight: 0.1 Normalized: 0.043478260869565216 Weighted Radius: 1.391304347826087
Min Weight: 0.05 Max Weight: 1.2000000000000002 Input Weight: 0.4 Normalized: 0.30434782608695654 Weighted Radius: 3.739130434782609
Min Weight: 0.05 Max Weight: 1.2000000000000002 Input Weight: 0.1 Normalized: 0.043478260869565216 Weighted Radius: 1.391304347826087
Min Weight: 0.05 Max Weight: 1.2000000000000002 Input Weight: 0.2 Normalized: 0.13043478260869565 Weighted Radius: 2.1739130434782608
Min Weight: 0.05 Max Weight: 1.2000000000000002 Input Weight: 0.1 Normalized: 0.043478260869565216 Weighted Radius: 1.391304347826087
Min Weight: 0.05 Max Weight: 1.2000000000000002 Input Weight: 1 Normalized: 0.826086956521739 Weighted Radius: 8.434782608695652
Min Weight: 0.05 Max Weight: 1.2000000000000002 Input Weight: 0.4 Normalized: 0.30434782608695654 Weighted Radius: 3.739130434782609
Min Weight: 0.05 Max Weight: 1.2000000000000002 Input Weight: 0.8 Normalized: 0.6521739130434782 Weighted Radius: 6.869565217391304
Min Weight: 0.05 Max Weight: 1.2000000000000002 Input Weight: 0.6000000000000001 Normalized: 0.47826086956521735 Weighted Radius: 5.304347826086956
Min Weight: 0.05 Max Weight: 1.2000000000000002 Input Weight: 0.1 Normalized: 0.043478260869565216 Weighted Radius: 1.391304347826087
Min Weight: 0.05 Max Weight: 1.2000000000000002 Input Weight: 0.05 Normalized: 0 Weighted Radius: 1
Min Weight: 0.05 Max Weight: 1.2000000000000002 Input Weight: 0.1 Normalized: 0.043478260869565216 Weighted Radius: 1.391304347826087
Min Weight: 0.05 Max Weight: 1.2000000000000002 Input Weight: 0.6000000000000001 Normalized: 0.47826086956521735 Weighted Radius: 5.304347826086956
Min Weight: 0.05 Max Weight: 1.2000000000000002 Input Weight: 1.2000000000000002 Normalized: 1 Weighted Radius: 10
Min Weight: 0.05 Max Weight: 1.2000000000000002 Input Weight: 0.6 Normalized: 0.4782608695652173 Weighted Radius: 5.304347826086955
Min Weight: 0.05 Max Weight: 1.2000000000000002 Input Weight: 0.2 Normalized: 0.13043478260869565 Weighted Radius: 2.1739130434782608
Min Weight: 0.05 Max Weight: 1.2000000000000002 Input Weight: 0.4 Normalized: 0.30434782608695654 Weighted Radius: 3.739130434782609
Min Weight: 0.05 Max Weight: 1.2000000000000002 Input Weight: 0.1 Normalized: 0.043478260869565216 Weighted Radius: 1.391304347826087
Min Weight: 0.05 Max Weight: 1.2000000000000002 Input Weight: 0.4 Normalized: 0.30434782608695654 Weighted Radius: 3.739130434782609
Min Weight: 0.05 Max Weight: 1.2000000000000002 Input Weight: 0.1 Normalized: 0.043478260869565216 Weighted Radius: 1.391304347826087
Min Weight: 0.05 Max Weight: 1.2000000000000002 Input Weight: 0.8 Normalized: 0.6521739130434782 Weighted Radius: 6.869565217391304
Min Weight: 0.05 Max Weight: 1.2000000000000002 Input Weight: 0.1 Normalized: 0.043478260869565216 Weighted Radius: 1.391304347826087
Min Weight: 0.05 Max Weight: 1.2000000000000002 Input Weight: 0.2 Normalized: 0.13043478260869565 Weighted Radius: 2.1739130434782608
Min Weight: 0.05 Max Weight: 1.2000000000000002 Input Weight: 0.1 Normalized: 0.043478260869565216 Weighted Radius: 1.391304347826087
Min Weight: 0.05 Max Weight: 1.2000000000000002 Input Weight: 0.2 Normalized: 0.13043478260869565 Weighted Radius: 2.1739130434782608
Min Weight: 0.05 Max Weight: 1.2000000000000002 Input Weight: 0.1 Normalized: 0.043478260869565216 Weighted Radius: 1.391304347826087
Min Weight: 0.05 Max Weight: 1.2000000000000002 Input Weight: 0.2 Normalized: 0.13043478260869565 Weighted Radius: 2.1739130434782608
Min Weight: 0.05 Max Weight: 1.2000000000000002 Input Weight: 0.1 Normalized: 0.043478260869565216 Weighted Radius: 1.391304347826087
Min Weight: 0.05 Max Weight: 1.2000000000000002 Input Weight: 0.2 Normalized: 0.13043478260869565 Weighted Radius: 2.1739130434782608
Min Weight: 0.05 Max Weight: 1.2000000000000002 Input Weight: 0.1 Normalized: 0.043478260869565216 Weighted Radius: 1.391304347826087
Min Weight: 0.05 Max Weight: 1.2000000000000002 Input Weight: 1 Normalized: 0.826086956521739 Weighted Radius: 8.434782608695652
Min Weight: 0.05 Max Weight: 1.2000000000000002 Input Weight: 0.4 Normalized: 0.30434782608695654 Weighted Radius: 3.739130434782609
Min Weight: 0.05 Max Weight: 1.2000000000000002 Input Weight: 0.8 Normalized: 0.6521739130434782 Weighted Radius: 6.869565217391304
Min Weight: 0.05 Max Weight: 1.2000000000000002 Input Weight: 0.6000000000000001 Normalized: 0.47826086956521735 Weighted Radius: 5.304347826086956
Min Weight: 0.05 Max Weight: 1.2000000000000002 Input Weight: 0.1 Normalized: 0.043478260869565216 Weighted Radius: 1.391304347826087
Min Weight: 0.05 Max Weight: 1.2000000000000002 Input Weight: 1.2000000000000002 Normalized: 1 Weighted Radius: 10
Min Weight: 0.05 Max Weight: 1.2000000000000002 Input Weight: 0.8 Normalized: 0.6521739130434782 Weighted Radius: 6.869565217391304
Min Weight: 0.05 Max Weight: 1.2000000000000002 Input Weight: 0.1 Normalized: 0.043478260869565216 Weighted Radius: 1.391304347826087

아래 첫 번째 이미지는 해당 위치에 파란색의 원을 함께 그린 것입니다. 그리고 두 번째 이미지는 확대해서 본 것입니다. 파란색 원 안에 붉은 색 점을 볼 수 있습니다.

dotmap___visualization

dotmap___visualization2

thetaiz avatar Jun 14 '17 01:06 thetaiz

@happyboi 님, 보이지 않는 것에 대해서는 개선을 검토해 보겠습니다.

thetaiz avatar Jun 14 '17 01:06 thetaiz

https://jsfiddle.net/happyboi/zzvy1axf/3/ 임의로 하나 만들었는데 여기에서도 점지도가 한개가 보이지가 않습니다. 이 부분도 너무 작아서 보이지 않는건지 궁금합니다.

https://jsfiddle.net/happyboi/wL9eg6vy/ 가중 수치를 똑같이 줬을 경우에는 8개 모양이 동일하게 표시가 됩니다. 가중 수치를 다를경우에 한개가 안나오는 경우를 알고 싶습니다.

happyboi avatar Jun 14 '17 06:06 happyboi

@happyboi 넵, 1 ~ 반지름으로 잡히기 때문에 가장 낮은 가중치의 값이 1로 설정되고 있습니다. 이 부분은 앞서 이야기드린 것과 같이 개선을 검토하고 있습니다.

thetaiz avatar Jun 15 '17 01:06 thetaiz