전단지 용 HTML5 전체 화면 플러그인.
전체 화면을 켜고 끄는 버튼을 제공하려면 :
// Create a new map with a fullscreen button:
var map = new L . Map ( 'map' , {
fullscreenControl : true ,
// OR
fullscreenControl : {
pseudoFullscreen : false // if true, fullscreen to page width and height
}
} ) ;
// or, add to an existing map:
map . addControl ( new L . Control . Fullscreen ( ) ) ;
플러그인은 전체 화면 버튼을 사용하지 않도록 선택하더라도 항상 사용할 수있는 L.Map
에 몇 가지 방법을 추가합니다.
map . isFullscreen ( ) // Is the map fullscreen?
map . toggleFullscreen ( ) // Either go fullscreen, or cancel the existing fullscreen.
// `fullscreenchange` Event that's fired when entering or exiting fullscreen.
map . on ( 'fullscreenchange' , function ( ) {
if ( map . isFullscreen ( ) ) {
console . log ( 'entered fullscreen' ) ;
} else {
console . log ( 'exited fullscreen' ) ;
}
} ) ;
전체 화면 제어 텍스트 변경 :
map . addControl ( new L . Control . Fullscreen ( {
title : {
'false' : 'View Fullscreen' ,
'true' : 'Exit Fullscreen'
}
} ) ) ;
Leaflet.fullscreen은 Mapbox 플러그인 CDN을 통해 사용할 수 있습니다.
< script src =' https://api.mapbox.com/mapbox.js/plugins/leaflet-fullscreen/v1.0.1/Leaflet.fullscreen.min.js ' > </ script >
< link href =' https://api.mapbox.com/mapbox.js/plugins/leaflet-fullscreen/v1.0.1/leaflet.fullscreen.css ' rel =' stylesheet ' />
npm install && make
시계 를 설치할 수 있도록 watch
설치할 수 있도록 모든 변경 사항을 실행할 필요없이 watch make
실행할 수 있습니다.
전단지 1.0 이상이 지원됩니다. 이전 버전은 작동 할 수 있지만 테스트되지는 않습니다.