<commit_before># Leaflet.TileLayer.Fallback

Plugin for Leaflet. Replaces missing Tiles (404 error) by scaled lower zoom Tiles.

[Leaflet](http://leafletjs.com/) is the leading open-source JavaScript library
for mobile-friendly interactive maps.

Latest TileLayer.Fallback release (for Leaflet 1.x): [`v1.0.1`](https://github.com/ghybs/Leaflet.TileLayer.Fallback/releases/tag/v1.0.1)



## Requirements

- Leaflet 1.x
- For Leaflet 0.7, use the [`v0.1.1` release](https://github.com/ghybs/Leaflet.TileLayer.Fallback/releases/tag/v0.1.1) or the [`leaflet-0.7` branch](https://github.com/ghybs/Leaflet.TileLayer.Fallback/tree/leaflet-0.7)



## Demo
[TileLayer.Fallback demonstration page](https://ghybs.github.io/Leaflet.TileLayer.Fallback/examples/tileLayerFallback-demo.html)



## Usage instructions

### Quick Guide

**HTML:**

```html
<!-- add TileLayer.Fallback script after Leaflet -->
<script src="leaflet.tilelayer.fallback.js"></script>
```

**JavaScript:**

```javascript
var myTileLayer = L.tileLayer.fallback(url, options);
```

Now missing tiles will be automatically replaced by scaled up tiles from lower zoom levels.


### Installing the plugin

#### Local copy
1. Download the "<a href="https://github.com/ghybs/Leaflet.TileLayer.Fallback/releases/download/v1.0.1/leaflet.tilelayer.fallback.js" download="leaflet.tilelayer.fallback.js">`leaflet.tilelayer.fallback.js`</a>" file from [`v1.0.1` release](https://github.com/ghybs/Leaflet.TileLayer.Fallback/releases/tag/v1.0.1).
2. Place the file alongside your page.
3. Add the `script` tag (see [Quick Guide > HTML](#quick-guide)) to your page after Leaflet script.

#### CDN
You can alternatively use the free [RawGit](https://rawgit.com/) CDN service, but keep in mind that there are [no uptime or support guarantees](https://github.com/rgrove/rawgit/wiki/Frequently-Asked-Questions#i-need-guaranteed-100-uptime-should-i-use-cdnrawgitcom).

```html
<!-- After Leaflet script -->
<script src="https://cdn.rawgit.com/ghybs/Leaflet.TileLayer.Fallback/v1.0.1-gh/dist/leaflet.tilelayer.fallback.js"></script>
```



### Creation

Simply use the `L.tileLayer.fallback` factory instead of your regular `L.tileLayer`:

```javascript
var myTileLayer = L.tileLayer.fallback(url, options);

myTileLayer.addTo(map);
```<commit_msg>README changed CDN link to v1.0.1-gh2 tag<commit_after># Leaflet.TileLayer.Fallback

Plugin for Leaflet. Replaces missing Tiles (404 error) by scaled lower zoom Tiles.

[Leaflet](http://leafletjs.com/) is the leading open-source JavaScript library
for mobile-friendly interactive maps.

Latest TileLayer.Fallback release (for Leaflet 1.x): [`v1.0.1`](https://github.com/ghybs/Leaflet.TileLayer.Fallback/releases/tag/v1.0.1)



## Requirements

- Leaflet 1.x
- For Leaflet 0.7, use the [`v0.1.1` release](https://github.com/ghybs/Leaflet.TileLayer.Fallback/releases/tag/v0.1.1) or the [`leaflet-0.7` branch](https://github.com/ghybs/Leaflet.TileLayer.Fallback/tree/leaflet-0.7)



## Demo
[TileLayer.Fallback demonstration page](https://ghybs.github.io/Leaflet.TileLayer.Fallback/examples/tileLayerFallback-demo.html)



## Usage instructions

### Quick Guide

**HTML:**

```html
<!-- add TileLayer.Fallback script after Leaflet -->
<script src="leaflet.tilelayer.fallback.js"></script>
```

**JavaScript:**

```javascript
var myTileLayer = L.tileLayer.fallback(url, options);
```

Now missing tiles will be automatically replaced by scaled up tiles from lower zoom levels.


### Installing the plugin

#### Local copy
1. Download the "<a href="https://github.com/ghybs/Leaflet.TileLayer.Fallback/releases/download/v1.0.1/leaflet.tilelayer.fallback.js" download="leaflet.tilelayer.fallback.js">`leaflet.tilelayer.fallback.js`</a>" file from [`v1.0.1` release](https://github.com/ghybs/Leaflet.TileLayer.Fallback/releases/tag/v1.0.1).
2. Place the file alongside your page.
3. Add the `script` tag (see [Quick Guide > HTML](#quick-guide)) to your page after Leaflet script.

#### CDN
You can alternatively use the free [RawGit](https://rawgit.com/) CDN service, but keep in mind that there are [no uptime or support guarantees](https://github.com/rgrove/rawgit/wiki/Frequently-Asked-Questions#i-need-guaranteed-100-uptime-should-i-use-cdnrawgitcom).

```html
<!-- After Leaflet script -->
<script src="https://cdn.rawgit.com/ghybs/Leaflet.TileLayer.Fallback/v1.0.1-gh2/dist/leaflet.tilelayer.fallback.js"></script>
```



### Creation

Simply use the `L.tileLayer.fallback` factory instead of your regular `L.tileLayer`:

```javascript
var myTileLayer = L.tileLayer.fallback(url, options);

myTileLayer.addTo(map);
```
{'fraction_non_alphanumeric': 0.15576797740603954, 'fraction_numerical': 0.018900716923745384, 'mean_word_length': 4.78391959798995, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 21, 'https://': 18, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1608651', 'n_tokens_mistral': 1688, 'n_tokens_neox': 1561, 'n_words': 340}