Did I find the right examples for you? yes no

All Samples(21)  |  Call(19)  |  Derive(0)  |  Import(2)

src/d/j/django-mbtiles-1.3/mbtilesmap/views.py   django-mbtiles(Download)
 
from . import app_settings
from models import MBTiles, MissingTileError, MBTilesNotFoundError
 
 
def tile(request, name, z, x, y, catalog=None):
    """ Serve a single image tile """
    try:
        mbtiles = MBTiles(name, catalog)
        data = mbtiles.tile(z, x, y)
def preview(request, name, catalog=None):
    try:
        mbtiles = MBTiles(name, catalog)
        z, x, y = mbtiles.center_tile()
        return tile(request, name, z, x, y)
def grid(request, name, z, x, y, catalog=None):
    """ Serve a single UTF-Grid tile """
    callback = request.GET.get('callback', None)
    try:
        mbtiles = MBTiles(name, catalog)
def tilejson(request, name, catalog=None):
    """ Serve the map configuration as TileJSON """
    callback = request.GET.get('callback', None)
    try:
        mbtiles = MBTiles(name, catalog)

src/d/j/django-mbtiles-1.3/mbtilesmap/tests.py   django-mbtiles(Download)
 
from . import app_settings, MBTILES_ID_PATTERN
from models import (MBTiles, MBTilesManager, 
                    MBTilesFolderError, MBTilesNotFoundError)
 
    def test_mbtiles_should_fail_if_mbtiles_does_not_exist(self):
        MBTiles('country', catalog='pouet')
        self.assertRaises(MBTilesNotFoundError, MBTiles, 'country', catalog='paf')
 
 
    def test_bounds_are_world_if_no_metadata(self):
        mb = MBTiles('france-35')
        # MBTiles has no metadata, bounds will be (-180, -90, 180, 90)
        self.failUnlessEqual((-180, -90, 180, 90), mb.bounds)
 
    def test_bounds_come_from_metadata(self):
        mb = MBTiles('geography-class')
    def test_center_is_0_0_if_no_metadata(self):
        mb = MBTiles('france-35')
        # Only one zoom level
        self.failUnlessEqual([3, 5], mb.zoomlevels)
        c = mb.center