Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create index.d.ts #106

Closed
wants to merge 26 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
node_modules
.DS_Store
dist/.Rhistory
package-lock.json
36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,39 @@
## 1.0.6

Updates this fork with [PR #118](https://github.com/Leaflet/Leaflet.fullscreen/pull/118) from the origin:

Rework Legacy PNG Icons with Font Awesome SVG

NOTE - this release includes the following breaking change :

`dist/Leaflet.fullscreen.js` is removed and `src/Leaflet.fullscreen.js` added. Use `dist/Leaflet..fullscreen.min.js` in your builds.

## 1.0.5

* Add `role="button"` to the control, and lowercase "fullscreen" in the `title`
attribute to align with Leaflet's core controls. (#2)

NOTE - this release includes a breaking change to correct a type in index.d.ts:

WAS

isfullscreen

NOW

isFullscreen

## 1.0.4

* reinstated backward compatibility with `fullscreenOptions`

## 1.0.3

* included index.d.ts (#106)
* changed the icon to SVG (#102 and #103)
* remove fullscreen listener (#100)


## 1.0.2

* Invalidate map size on fullscreen toggle (#61)
Expand Down
16 changes: 9 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
# See the README for installation instructions.
UGLIFY = node_modules/.bin/uglifyjs
SASS = node_modules/.bin/sass

all: \
$(shell npm install) \
dist/Leaflet.fullscreen.min.js \
.PHONY: all
all: dist/Leaflet.fullscreen.min.js dist/Leaflet.fullscreen.min.css

.PHONY: clean
clean:
rm -f dist/Leaflet.fullscreen.min.js
rm -f dist/Leaflet.fullscreen.min.js dist/Leaflet.fullscreen.min.css

dist/Leaflet.fullscreen.min.js: dist/Leaflet.fullscreen.js
$(UGLIFY) dist/Leaflet.fullscreen.js > dist/Leaflet.fullscreen.min.js
dist/Leaflet.fullscreen.min.js:
$(UGLIFY) src/Leaflet.fullscreen.js > dist/Leaflet.fullscreen.min.js

.PHONY: clean
dist/Leaflet.fullscreen.min.css:
$(SASS) src/Leaflet.fullscreen.scss dist/Leaflet.fullscreen.min.css
60 changes: 43 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
## Leaflet.fullscreen
A HTML5 fullscreen plugin for Leaflet.

> Reason for the @runette fork : The root repo is not being actively managed. This fork starts with version 1.0.3
>
> changes :

>* Rework Legacy PNG Icons with Font Awesome SVG #118
>* Remove onFullscreenchange and replace with enterFullscreen event in README (#108)
>* included index.d.ts (#106)
>* changed the icon to SVG (#102 and #103)
>* remove fullscreen listener (#100)
>* Accessibility Fix (#2)
>* Fix Typo in index.d.ts (#3)
>

### Usage

To provide a button for toggling fullscreen on and off:
Expand All @@ -25,15 +38,11 @@ The plugin also adds several methods to `L.Map` which are always available, even
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 () {
// `enterFullscreen` Event that's fired when entering fullscreen.
map.on('enterFullscreen', function () {
if (map.isFullscreen()) {
console.log('entered fullscreen');
} else {
console.log('exited fullscreen');
}
});
```

### Localization

Expand All @@ -42,28 +51,45 @@ To change fullscreen control text:
``` js
map.addControl(new L.Control.Fullscreen({
title: {
'false': 'View Fullscreen',
'true': 'Exit Fullscreen'
'false': 'View fullscreen',
'true': 'Exit fullscreen'
}
}));
```

### Including via CDN
### Including via NPM

```sh
npm install @runette/leaflet-fullscreen
```

### Type definitions

Leaflet.fullscreen is [available through the Mapbox Plugin CDN](https://www.mapbox.com/mapbox.js/plugins/#leaflet-fullscreen) - just copy this include:
This version includes a `index.d.ts` with Typescript type definitions for :

```html
<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' />
```typescript
interface FullscreenOptions extends ControlOptions {}
```
and extensions to the following with the additional properties and methods
```typescript
interface Map {}

### Building
namespace control {}

npm install && make
namespace Control {}
```

__ProTip__ You may want to install `watch` so you can run `watch make`
without needing to execute make on every change.
npm install
npm run test
npm run uglifyjs
npm run sass

### Supported Leaflet Versions

Leaflet 1.0 and later is supported. Earlier versions may work, but are not tested.

### License

ISC

SVG icons from [Font Awesome v5.15.4](https://github.com/FortAwesome/Font-Awesome/releases/tag/5.15.4): [Creative Commons Attribution 4.0](https://fontawesome.com/license/free)
4 changes: 2 additions & 2 deletions component.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "Leaflet.fullscreen",
"repo": "mapbox/Leaflet.fullscreen",
"repo": "runette/Leaflet.fullscreen",
"description": "a fullscreen control for Leaflet",
"version": "0.0.0",
"version": "1.0.3",
"keywords": [],
"dependencies": {},
"development": {},
Expand Down
1 change: 1 addition & 0 deletions compress-solid.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions dist/Leaflet.fullscreen.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/Leaflet.fullscreen.min.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/Leaflet.fullscreen.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file removed dist/fullscreen.png
Binary file not shown.
Binary file removed dist/[email protected]
Binary file not shown.
11 changes: 2 additions & 9 deletions dist/leaflet.fullscreen.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.leaflet-control-fullscreen a {
background:#fff url(fullscreen.png) no-repeat 0 0;
background:#fff no-repeat 0 0;
background-image: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg version='1.1' viewBox='0 0 26 52' width='26' height='52' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg display='none'%3E%3Crect width='26' height='52' color='%23000000' display='inline' fill='%23f2f2f2'/%3E%3Crect y='26' width='26' height='26' color='%23000000' display='inline' fill='%23e6e6e6'/%3E%3C/g%3E%3Cg transform='translate(0 -1000.4)'%3E%3Cuse transform='translate(0,26)' width='100%25' height='100%25' xlink:href='%23rect15634'/%3E%3Cuse transform='translate(0,26)' width='100%25' height='100%25' xlink:href='%23path15639'/%3E%3Cuse transform='translate(0,26)' width='100%25' height='100%25' xlink:href='%23path16061'/%3E%3Cuse transform='translate(0,26)' width='100%25' height='100%25' xlink:href='%23path16059'/%3E%3Cpath id='rect15634' transform='translate(0 1000.4)' d='m5 15v6h6v-2h-4v-4z' color='%23000000' fill='%23404040'/%3E%3Cpath id='path15639' transform='translate(0 1000.4)' d='m21 15v6h-6v-2h4v-4z' color='%23000000' fill='%23404040'/%3E%3Cpath d='m10 1037.4v4l1 1h4l1-1v-4l-1-1h-4z' color='%23000000' fill='%23404040'/%3E%3Cpath id='path16059' d='m5 1011.4v-6h6v2h-4v4z' color='%23000000' fill='%23404040'/%3E%3Cpath id='path16061' d='m21 1011.4v-6h-6v2h4v4z' color='%23000000' fill='%23404040'/%3E%3C/g%3E%3C/svg%3E%0A");
background-size:26px 52px;
}
.leaflet-touch .leaflet-control-fullscreen a {
Expand Down Expand Up @@ -30,11 +31,3 @@
left:0!important;
z-index:99999;
}

@media
(-webkit-min-device-pixel-ratio:2),
(min-resolution:192dpi) {
.leaflet-control-fullscreen a {
background-image:url([email protected]);
}
}
1 change: 1 addition & 0 deletions expand-solid.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading