본문 바로가기

Programming/JavaScript52

[javascript] Leaflet.PolylineDecorator [javascript] Leaflet.PolylineDecorator Github : https://github.com/bbecquet/Leaflet.PolylineDecorator leaflet 위에서 선을 꾸밀 수 있는 라이브러리 입니다. 사용법 L.polylineDecorator(latlngs, options).addTo(map); latlngs에는 L.Polyline, L.Polygon, L.LatLng 배열이 들어갈 수 있음. options에는 패턴(patterns)에 대한 정의가 들어감 Pattern 정의 offset : 패턴의 처음 심볼을 얼마나 떨어뜨려서 표현할지 정의 (기본값: 0) endOffset : 마지막 심볼을 얼마나 떨어뜨려서 표현할지 정의 (기본값: 0) repeat : 어느정.. 2017. 3. 9.
[javascript] ActiveX 콜백 함수 동적 생성 [javascript] ActiveX 콜백 함수 동적 생성 Internet Explorer 에서는 script 태그를 사용하여 콜백 함수를 받는다. 정적으로 생성된 ActiveX 대해서는 위의 방법으로 사용이 가능하다.동적으로 생성된 ActiveX 객체에 대해서 처리해주는 script 요소를 동적으로 생성해 주어야 한다. var handler = document.createElement("script"); handler.setAttribute("for", "target_id"); handler.event = "callback_func(code)"; handler.appendChild(document.createTextNode("event_notify(code);")); document.body.appen.. 2017. 3. 9.
[leaflet] 줌 컨트롤 변경 - 추가 및 기존 컨트롤 안보이게 처리 [leaflet] 줌 컨트롤 변경 - 추가 및 기존 컨트롤 안보이게 처리 줌 컨트롤 제거 http://stackoverflow.com/questions/16537326/leafletjs-how-to-remove-the-zoom-control var map = new L.Map('map', { zoomControl:false }); // 지도 생성 map = L.map(mapid, { maxBounds : bounds, // 화면 최대 영역을 설정한다. center : center, zoom : zoom, zoomControl:false }); 맵 생성시에, zoomControl:false 를 추가한다. 줌인, 줌아웃 처리 function getValidZoom(zoom){ var maxZoom = 19;.. 2017. 2. 28.
[bower] 윈도우에서 .bowerrc 생성 방법 [bower] 윈도우에서 .bowerrc 생성 방법 echo 명령어를 사용하여 생성 > echo "" > .bowerrc 이후 생성된 .bowerrc파일을 수정하면 됩니다. { "directory": "components" } ren 명령으로 파일명 변경 bowerrc 또는 다른 파일명을 가진 임의의 파일을 생성합니다. > ren bowerrc .bowerrc ren 명령어로 파일명을 .bowerrc 로 변경합니다. 참고 http://stackoverflow.com/questions/20202202/how-do-i-name-the-bowerrc-file https://gist.github.com/facultymatt/5482781 2016. 11. 12.
jQuery.uploadfile ajax-file-upload-filename 영역 수정 jQuery.uploadfile ajax-file-upload-filename 영역 수정 드래그 & 드랍이 되는 jQuery plugin을 찾다가 jQuery.uploadfile 을 사용하게 되었습니다.파일명 + 용량 표시가 영역을 벗어나는 문제가 발생합니다. 작은 공간에서 사용하려 하였기에 문제가 되었습니다.해당 영역을 살펴보면, 주어진 텍스트 보다 더 긴 영역을 차지하고 있음을 알 수 있습니다.레이아웃을 살펴보면 300 X 20 임을 확인할 수 있습니다.넓이가 300px으로 설정된 것을 확인 할 수 있습니다.uploadfile.css 파일에서 300px 로 설정된 것을 확인 할 수 있습니다. .ajax-file-upload-filename { width: 300px; height: auto; marg.. 2016. 10. 28.
[Leaflet] Leaflet 클릭 함수에 파라미터 전달하기 [Leaflet] Leaflet 클릭 함수에 파라미터 전달하기 출처: https://github.com/Leaflet/Leaflet/issues/2286 function fnOnClick(data) { debugger; } L.marker([ data.st_y, data.st_x ]).on('click', L.bind(fnOnClick, null, data)); L.marker([ data.st_y, data.st_x ]).on(‘click’, fnOnClick);대신에L.bind(fnOnClick, null, data) 를 사용하여 파라미터를 전달한다. 2016. 8. 22.