home / content / repos

repos: 335175637

This data as json

id node_id name full_name private owner html_url description fork created_at updated_at pushed_at homepage size stargazers_count watchers_count language has_issues has_projects has_downloads has_wiki has_pages forks_count archived disabled open_issues_count license topics forks open_issues watchers default_branch permissions temp_clone_token organization network_count subscribers_count readme readme_html allow_forking visibility is_template template_repository web_commit_signoff_required has_discussions
335175637 MDEwOlJlcG9zaXRvcnkzMzUxNzU2Mzc= datasette-tiles simonw/datasette-tiles 0 9599 https://github.com/simonw/datasette-tiles Mapping tile server for Datasette, serving tiles from MBTiles packages 0 2021-02-02T05:11:12Z 2022-03-22T01:52:30Z 2022-03-22T01:52:27Z https://datasette.io/plugins/datasette-tiles 54 4 4 Python 1 1 1 1 0 4 0 0 8   ["datasette", "datasette-io", "datasette-plugin", "mbtiles"] 4 8 4 main {"admin": false, "maintain": false, "push": false, "triage": false, "pull": false}     4 3 # datasette-tiles [![PyPI](https://img.shields.io/pypi/v/datasette-tiles.svg)](https://pypi.org/project/datasette-tiles/) [![Changelog](https://img.shields.io/github/v/release/simonw/datasette-tiles?include_prereleases&label=changelog)](https://github.com/simonw/datasette-tiles/releases) [![Tests](https://github.com/simonw/datasette-tiles/workflows/Test/badge.svg)](https://github.com/simonw/datasette-tiles/actions?query=workflow%3ATest) [![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/simonw/datasette-tiles/blob/main/LICENSE) Datasette plugin for serving MBTiles map tiles ## Installation Install this plugin in the same environment as Datasette. $ datasette install datasette-tiles ## Demo You can try this plugin out at https://datasette-tiles-demo.datasette.io/-/tiles ## Usage This plugin scans all database files connected to Datasette to see if any of them are valid MBTiles databases. It can then serve tiles from those databases at the following URL: /-/tiles/db-name/zoom/x/y.png An example map for each database demonstrating the configured minimum and maximum zoom for that database can be found at `/-/tiles/db-name` - this can also be accessed via the table and database action menus for that database. Visit `/-/tiles` for an index page of attached valid databases. You can install the [datasette-basemap](https://datasette.io/plugins/datasette-basemap) plugin to get a `basemap` default set of tiles, handling zoom levels 0 to 6 using OpenStreetMap. ### Tile coordinate systems There are two tile coordinate systems in common use for online maps. The first is used by OpenStreetMap and Google Maps, the second is from a specification called [Tile Map Service](https://en.wikipedia.org/wiki/Tile_Map_Service), or TMS. Both systems use three components: `z/x/y` - where `z` is the zoom level, `x` is the column and `y` is the row. The difference is in the way the `y` value is counted. OpenStreetMap has y=0 at the top. TMS has y=0 at the bottom. An illustrative example: at zoom level 2 the map is divided into 16 total tiles. The OpenStreetMap scheme numbers them like so: 0/0 1/0 2/0 3/0 0/1 1/1 2/1 3/1 0/2 1/2 2/2 3/2 0/3 1/3 2/3 3/3 The TMS scheme looks like this: 0/3 1/3 2/3 3/3 0/2 1/2 2/2 3/2 0/1 1/1 2/1 3/1 0/0 1/0 2/0 3/0 `datasette-tiles` can serve tiles using either of these standards. For the OpenStreetMap / Google Maps 0-at-the-top system, use the following URL: /-/tiles/database-name/{z}/{x}/{y}.png For the TMS 0-at-the-bottom system, use this: /-/tiles-tms/database-name/{z}/{x}/{y}.png ### Configuring a Leaflet tile layer The following JavaScript will configure a [Leaflet TileLayer](https://leafletjs.com/reference-1.7.1.html#tilelayer) for use with this plugin: ```javascript var tiles = leaflet.tileLayer("/-/tiles/basemap/{z}/{x}/{y}.png", { minZoom: 0, maxZoom: 6, attribution: "\u00a9 OpenStreetMap contributors" }); ``` ### Tile stacks `datasette-tiles` can be configured to serve tiles from multiple attached MBTiles files, searching each database in order for a tile and falling back to the next in line if that tile is not found. For a demo of this in action, visit https://datasette-tiles-demo.datasette.io/-/tiles-stack and zoom in on Japan. It should start showing [Stamen's Toner map](maps.stamen.com) of Japan once you get to zoom level 6 and 7. The `/-/tiles-stack/{z}/{x}/{y}.png` endpoint provides this feature. If you start Datasette like this: datasette world.mbtiles country.mbtiles city1.mbtiles city2.mbtiles Any requests for a tile from the `/-/tiles-stack` path will first check the `city2` database, than `city1`, then `country`, then `world`. If you have the [datasette-basemap](https://datasette.io/plugins/datasette-basemap) plugin installed it will be given special treatment: the `basemap` database will always be the last database checked for a tile. Rather than rely on the order in which databases were attached, you can instead configure an explicit order using the `tiles-stack-order` plugin setting. Add the following to your `metadata.json` file: ```json { "plugins": { "datasette-tiles": { "tiles-stack-order": ["world", "country"] } } } ``` You can then run Datasette like this: datasette -m metadata.json country.mbtiles world.mbtiles This endpoint serves tiles using the OpenStreetMap / Google Maps coordinate system. To load tiles using the TMS coordinate system use this endpoint instead: /-/tiles-stack-tms/{z}/{x}/{y}.png ### Retina tiles Retina (double resolution) tiles are supported by `datasette-tiles` if the MBTiles database file contains 512x512 tile images as opposed to the default of 256x256. JavaScript libraries such as Leaflet will serve these tiles with a fixed 256x256 size, which will cause them to be displayed correctly by capable operating systems. ## Development To set up this plugin locally, first checkout the code. Then create a new virtual environment: cd datasette-tiles python3 -mvenv venv source venv/bin/activate Or if you are using `pipenv`: pipenv shell Now install the dependencies and tests: pip install -e '.[test]' To run the tests: pytest <div id="readme" class="md" data-path="README.md"><article class="markdown-body entry-content container-lg" itemprop="text"><h1 dir="auto"><a id="user-content-datasette-tiles" class="anchor" aria-hidden="true" href="#user-content-datasette-tiles"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a>datasette-tiles</h1> <p dir="auto"><a href="https://pypi.org/project/datasette-tiles/" rel="nofollow"><img src="https://camo.githubusercontent.com/72c38bbf12ff995549cf94a6c7ca06d205a19cf3543af89763d47186340b37a0/68747470733a2f2f696d672e736869656c64732e696f2f707970692f762f6461746173657474652d74696c65732e737667" alt="PyPI" data-canonical-src="https://img.shields.io/pypi/v/datasette-tiles.svg" style="max-width: 100%;"></a> <a href="https://github.com/simonw/datasette-tiles/releases"><img src="https://camo.githubusercontent.com/6aa9bdcd93e33cd40ad13d0d00224d316b3743f498bd502f2f751ab7315618e2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f73696d6f6e772f6461746173657474652d74696c65733f696e636c7564655f70726572656c6561736573266c6162656c3d6368616e67656c6f67" alt="Changelog" data-canonical-src="https://img.shields.io/github/v/release/simonw/datasette-tiles?include_prereleases&amp;label=changelog" style="max-width: 100%;"></a> <a href="https://github.com/simonw/datasette-tiles/actions?query=workflow%3ATest"><img src="https://github.com/simonw/datasette-tiles/workflows/Test/badge.svg" alt="Tests" style="max-width: 100%;"></a> <a href="https://github.com/simonw/datasette-tiles/blob/main/LICENSE"><img src="https://camo.githubusercontent.com/1698104e976c681143eb0841f9675c6f802bb7aa832afc0c7a4e719b1f3cf955/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d417061636865253230322e302d626c75652e737667" alt="License" data-canonical-src="https://img.shields.io/badge/license-Apache%202.0-blue.svg" style="max-width: 100%;"></a></p> <p dir="auto">Datasette plugin for serving MBTiles map tiles</p> <h2 dir="auto"><a id="user-content-installation" class="anchor" aria-hidden="true" href="#user-content-installation"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a>Installation</h2> <p dir="auto">Install this plugin in the same environment as Datasette.</p> <div class="snippet-clipboard-content position-relative overflow-auto" data-snippet-clipboard-copy-content="$ datasette install datasette-tiles"><pre><code>$ datasette install datasette-tiles </code></pre></div> <h2 dir="auto"><a id="user-content-demo" class="anchor" aria-hidden="true" href="#user-content-demo"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a>Demo</h2> <p dir="auto">You can try this plugin out at <a href="https://datasette-tiles-demo.datasette.io/-/tiles" rel="nofollow">https://datasette-tiles-demo.datasette.io/-/tiles</a></p> <h2 dir="auto"><a id="user-content-usage" class="anchor" aria-hidden="true" href="#user-content-usage"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a>Usage</h2> <p dir="auto">This plugin scans all database files connected to Datasette to see if any of them are valid MBTiles databases.</p> <p dir="auto">It can then serve tiles from those databases at the following URL:</p> <div class="snippet-clipboard-content position-relative overflow-auto" data-snippet-clipboard-copy-content="/-/tiles/db-name/zoom/x/y.png"><pre><code>/-/tiles/db-name/zoom/x/y.png </code></pre></div> <p dir="auto">An example map for each database demonstrating the configured minimum and maximum zoom for that database can be found at <code>/-/tiles/db-name</code> - this can also be accessed via the table and database action menus for that database.</p> <p dir="auto">Visit <code>/-/tiles</code> for an index page of attached valid databases.</p> <p dir="auto">You can install the <a href="https://datasette.io/plugins/datasette-basemap" rel="nofollow">datasette-basemap</a> plugin to get a <code>basemap</code> default set of tiles, handling zoom levels 0 to 6 using OpenStreetMap.</p> <h3 dir="auto"><a id="user-content-tile-coordinate-systems" class="anchor" aria-hidden="true" href="#user-content-tile-coordinate-systems"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a>Tile coordinate systems</h3> <p dir="auto">There are two tile coordinate systems in common use for online maps. The first is used by OpenStreetMap and Google Maps, the second is from a specification called <a href="https://en.wikipedia.org/wiki/Tile_Map_Service" rel="nofollow">Tile Map Service</a>, or TMS.</p> <p dir="auto">Both systems use three components: <code>z/x/y</code> - where <code>z</code> is the zoom level, <code>x</code> is the column and <code>y</code> is the row.</p> <p dir="auto">The difference is in the way the <code>y</code> value is counted. OpenStreetMap has y=0 at the top. TMS has y=0 at the bottom.</p> <p dir="auto">An illustrative example: at zoom level 2 the map is divided into 16 total tiles. The OpenStreetMap scheme numbers them like so:</p> <div class="snippet-clipboard-content position-relative overflow-auto" data-snippet-clipboard-copy-content="0/0 1/0 2/0 3/0 0/1 1/1 2/1 3/1 0/2 1/2 2/2 3/2 0/3 1/3 2/3 3/3"><pre><code>0/0 1/0 2/0 3/0 0/1 1/1 2/1 3/1 0/2 1/2 2/2 3/2 0/3 1/3 2/3 3/3 </code></pre></div> <p dir="auto">The TMS scheme looks like this:</p> <div class="snippet-clipboard-content position-relative overflow-auto" data-snippet-clipboard-copy-content="0/3 1/3 2/3 3/3 0/2 1/2 2/2 3/2 0/1 1/1 2/1 3/1 0/0 1/0 2/0 3/0"><pre><code>0/3 1/3 2/3 3/3 0/2 1/2 2/2 3/2 0/1 1/1 2/1 3/1 0/0 1/0 2/0 3/0 </code></pre></div> <p dir="auto"><code>datasette-tiles</code> can serve tiles using either of these standards. For the OpenStreetMap / Google Maps 0-at-the-top system, use the following URL:</p> <div class="snippet-clipboard-content position-relative overflow-auto" data-snippet-clipboard-copy-content="/-/tiles/database-name/{z}/{x}/{y}.png"><pre><code>/-/tiles/database-name/{z}/{x}/{y}.png </code></pre></div> <p dir="auto">For the TMS 0-at-the-bottom system, use this:</p> <div class="snippet-clipboard-content position-relative overflow-auto" data-snippet-clipboard-copy-content="/-/tiles-tms/database-name/{z}/{x}/{y}.png"><pre><code>/-/tiles-tms/database-name/{z}/{x}/{y}.png </code></pre></div> <h3 dir="auto"><a id="user-content-configuring-a-leaflet-tile-layer" class="anchor" aria-hidden="true" href="#user-content-configuring-a-leaflet-tile-layer"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a>Configuring a Leaflet tile layer</h3> <p dir="auto">The following JavaScript will configure a <a href="https://leafletjs.com/reference-1.7.1.html#tilelayer" rel="nofollow">Leaflet TileLayer</a> for use with this plugin:</p> <div class="highlight highlight-source-js position-relative overflow-auto" data-snippet-clipboard-copy-content="var tiles = leaflet.tileLayer(&quot;/-/tiles/basemap/{z}/{x}/{y}.png&quot;, { minZoom: 0, maxZoom: 6, attribution: &quot;\u00a9 OpenStreetMap contributors&quot; });"><pre><span class="pl-k">var</span> <span class="pl-s1">tiles</span> <span class="pl-c1">=</span> <span class="pl-s1">leaflet</span><span class="pl-kos">.</span><span class="pl-en">tileLayer</span><span class="pl-kos">(</span><span class="pl-s">"/-/tiles/basemap/{z}/{x}/{y}.png"</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c1">minZoom</span>: <span class="pl-c1">0</span><span class="pl-kos">,</span> <span class="pl-c1">maxZoom</span>: <span class="pl-c1">6</span><span class="pl-kos">,</span> <span class="pl-c1">attribution</span>: <span class="pl-s">"\u00a9 OpenStreetMap contributors"</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <h3 dir="auto"><a id="user-content-tile-stacks" class="anchor" aria-hidden="true" href="#user-content-tile-stacks"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a>Tile stacks</h3> <p dir="auto"><code>datasette-tiles</code> can be configured to serve tiles from multiple attached MBTiles files, searching each database in order for a tile and falling back to the next in line if that tile is not found.</p> <p dir="auto">For a demo of this in action, visit <a href="https://datasette-tiles-demo.datasette.io/-/tiles-stack" rel="nofollow">https://datasette-tiles-demo.datasette.io/-/tiles-stack</a> and zoom in on Japan. It should start showing <a href="maps.stamen.com">Stamen's Toner map</a> of Japan once you get to zoom level 6 and 7.</p> <p dir="auto">The <code>/-/tiles-stack/{z}/{x}/{y}.png</code> endpoint provides this feature.</p> <p dir="auto">If you start Datasette like this:</p> <div class="snippet-clipboard-content position-relative overflow-auto" data-snippet-clipboard-copy-content="datasette world.mbtiles country.mbtiles city1.mbtiles city2.mbtiles"><pre><code>datasette world.mbtiles country.mbtiles city1.mbtiles city2.mbtiles </code></pre></div> <p dir="auto">Any requests for a tile from the <code>/-/tiles-stack</code> path will first check the <code>city2</code> database, than <code>city1</code>, then <code>country</code>, then <code>world</code>.</p> <p dir="auto">If you have the <a href="https://datasette.io/plugins/datasette-basemap" rel="nofollow">datasette-basemap</a> plugin installed it will be given special treatment: the <code>basemap</code> database will always be the last database checked for a tile.</p> <p dir="auto">Rather than rely on the order in which databases were attached, you can instead configure an explicit order using the <code>tiles-stack-order</code> plugin setting. Add the following to your <code>metadata.json</code> file:</p> <div class="highlight highlight-source-json position-relative overflow-auto" data-snippet-clipboard-copy-content="{ &quot;plugins&quot;: { &quot;datasette-tiles&quot;: { &quot;tiles-stack-order&quot;: [&quot;world&quot;, &quot;country&quot;] } } }"><pre>{ <span class="pl-ent">"plugins"</span>: { <span class="pl-ent">"datasette-tiles"</span>: { <span class="pl-ent">"tiles-stack-order"</span>: [<span class="pl-s"><span class="pl-pds">"</span>world<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>country<span class="pl-pds">"</span></span>] } } }</pre></div> <p dir="auto">You can then run Datasette like this:</p> <div class="snippet-clipboard-content position-relative overflow-auto" data-snippet-clipboard-copy-content="datasette -m metadata.json country.mbtiles world.mbtiles"><pre><code>datasette -m metadata.json country.mbtiles world.mbtiles </code></pre></div> <p dir="auto">This endpoint serves tiles using the OpenStreetMap / Google Maps coordinate system. To load tiles using the TMS coordinate system use this endpoint instead:</p> <div class="snippet-clipboard-content position-relative overflow-auto" data-snippet-clipboard-copy-content="/-/tiles-stack-tms/{z}/{x}/{y}.png"><pre><code>/-/tiles-stack-tms/{z}/{x}/{y}.png </code></pre></div> <h3 dir="auto"><a id="user-content-retina-tiles" class="anchor" aria-hidden="true" href="#user-content-retina-tiles"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a>Retina tiles</h3> <p dir="auto">Retina (double resolution) tiles are supported by <code>datasette-tiles</code> if the MBTiles database file contains 512x512 tile images as opposed to the default of 256x256. JavaScript libraries such as Leaflet will serve these tiles with a fixed 256x256 size, which will cause them to be displayed correctly by capable operating systems.</p> <h2 dir="auto"><a id="user-content-development" class="anchor" aria-hidden="true" href="#user-content-development"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a>Development</h2> <p dir="auto">To set up this plugin locally, first checkout the code. Then create a new virtual environment:</p> <div class="snippet-clipboard-content position-relative overflow-auto" data-snippet-clipboard-copy-content="cd datasette-tiles python3 -mvenv venv source venv/bin/activate"><pre><code>cd datasette-tiles python3 -mvenv venv source venv/bin/activate </code></pre></div> <p dir="auto">Or if you are using <code>pipenv</code>:</p> <div class="snippet-clipboard-content position-relative overflow-auto" data-snippet-clipboard-copy-content="pipenv shell"><pre><code>pipenv shell </code></pre></div> <p dir="auto">Now install the dependencies and tests:</p> <div class="snippet-clipboard-content position-relative overflow-auto" data-snippet-clipboard-copy-content="pip install -e '.[test]'"><pre><code>pip install -e '.[test]' </code></pre></div> <p dir="auto">To run the tests:</p> <div class="snippet-clipboard-content position-relative overflow-auto" data-snippet-clipboard-copy-content="pytest"><pre><code>pytest </code></pre></div> </article></div> 1 public 0      

Links from other tables

  • 8 rows from repo in releases
Powered by Datasette · Queries took 1.232ms