Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. L.icon 으로 아이콘을 생성한다. ```javascript var oldCameraIcon = L.icon({ iconUrl: '/img/camera-0.png', iconSize: [30, 30], // size of the icon iconAnchor: [15, 15], // point of the icon which will correspond to marker's location popupAnchor: [0, -10] // point from which the popup should open relative to the iconAnchor }); var newCameraIcon = L.icon({ iconUrl: '/img/camera-1.png', iconSize: [30, 30], // size of the icon iconAnchor: [15, 15], // point of the icon which will correspond to marker's location popupAnchor: [0, -10] // point from which the popup should open relative to the iconAnchor }); ``` 베이스가 되는 코드를 만들고, 아이콘의 경로만 변경한다. ```javascript var baseIcon = L.icon({ iconSize: [30, 30], // size of the icon iconAnchor: [15, 15], // point of the icon which will correspond to marker's location popupAnchor: [0, -10] // point from which the popup should open relative to the iconAnchor }); var oldCameraIcon = baseIcon.options.iconUrl = '/img/camera-0.png'; ``` open/leaflet-marker.txt Last modified: 2024/10/05 06:15by 127.0.0.1