diff --git a/icon-fullscreen.svg b/icon-fullscreen.svg
new file mode 100644
index 0000000..a3a2332
--- /dev/null
+++ b/icon-fullscreen.svg
@@ -0,0 +1 @@
+
diff --git a/package.json b/package.json
index 0582e95..bcb64e6 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "react-leaflet-fullscreen",
- "version": "4.1.0",
+ "version": "4.2.0",
"description": "Fullscreen control for react-leaflet",
"main": "dist.js",
"scripts": {
@@ -18,9 +18,10 @@
"author": "Vitaly Kravtsov (https://krvital.pro/)",
"license": "MIT",
"peerDependencies": {
- "react-leaflet": "^4.x"
+ "react-leaflet": "^5.x"
},
"dependencies": {
- "leaflet.fullscreen": "2.4.0"
+ "leaflet.fullscreen": "4.0.0",
+ "screenfull": "6.0.2"
}
-}
\ No newline at end of file
+}
diff --git a/styles.css b/styles.css
index ce501b0..01d4029 100644
--- a/styles.css
+++ b/styles.css
@@ -1,7 +1,34 @@
-.fullscreen-icon { background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAQAAAADQ4RFAAAAUklEQVR4AWOgGhgF/8HwPIrYeYgoIU0OKGIOxGm6jyJ2n5Cm8wwOQEUGKGIGQBEHoAwB0AA0FwEbSAgOBBwWmggHBOVBTjhyKU9GhBMslcAoAABPu2Hh6JIyeQAAAABJRU5ErkJggg==); }
-.leaflet-retina .fullscreen-icon { background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAQAAABvcdNgAAAAnklEQVR4Ae2WVQEDMRAFn4RIi8OVtBIiIQ7KzO3dlN+8z4MJbEDGGPPXTA+SukQevTlKlCq6RFFSor7RXFR1qkehawTRo9uqIOaoPyTqQ0Wporh76GJdFg+zqbS4odm8s6nAkVQ1Tc+kqQqkano5pKpdFTVhTG8EwyKLwPLmF+xHbkH8psofEx918PFHOX85+YbrFn+B5K/Ef4wxxswAnU97CHDaZQMAAAAASUVORK5CYII=); background-size: 26px 26px; }
-.leaflet-container:-webkit-full-screen { width: 100% !important; height: 100% !important; z-index: 99999; }
-.leaflet-container:-ms-fullscreen { width: 100% !important; height: 100% !important; z-index: 99999; }
-.leaflet-container:full-screen { width: 100% !important; height: 100% !important; z-index: 99999; }
-.leaflet-container:fullscreen { width: 100% !important; height: 100% !important; z-index: 99999; }
-.leaflet-pseudo-fullscreen { position: fixed !important; width: 100% !important; height: 100% !important; top: 0px !important; left: 0px !important; z-index: 99999; }
\ No newline at end of file
+.leaflet-fullscreen-icon {
+ background-image: url('icon-fullscreen.svg');
+ background-size: 26px 52px;
+}
+
+.leaflet-fullscreen-icon.leaflet-fullscreen-on {
+ background-position: 0 -26px;
+}
+
+.leaflet-touch .leaflet-fullscreen-icon {
+ background-position: 2px 2px;
+}
+
+.leaflet-touch .leaflet-fullscreen-icon.leaflet-fullscreen-on {
+ background-position: 2px -24px;
+}
+
+/* Safari still needs this vendor-prefix: https://caniuse.com/mdn-css_selectors_fullscreen */
+/* stylelint-disable-next-line selector-no-vendor-prefix */
+.leaflet-container:-webkit-full-screen,
+.leaflet-container:fullscreen {
+ width: 100% !important;
+ height: 100% !important;
+ z-index: 99999;
+}
+
+.leaflet-pseudo-fullscreen {
+ position: fixed !important;
+ width: 100% !important;
+ height: 100% !important;
+ top: 0 !important;
+ left: 0 !important;
+ z-index: 99999;
+}