Git Product home page Git Product logo

artiledimageview's Introduction

ARTiledImageView

Build Status Version Platform

Demo

animated

Francisco De Goya Y Lucientes, Señora Sabasa Garcia, ca. 1806/1811, courtesy of the National Gallery of Art, Washington D.C., via Artsy.

Usage

ARWebTiledImageDataSource *ds = [[ARWebTiledImageDataSource alloc] init];
// height of the full zoomed in image
ds.maxTiledHeight = 2933;
// width of the full zommed in image
ds.maxTiledWidth = 2383;
// width of the full zommed in image
ds.minTileLevel = 10;
// maximum tile level
ds.maxTileLevel = 15;
// side of a square tile
ds.tileSize = 512;
// tile format
ds.tileFormat = @"jpg";
// location of tiles, organized in subfolders, one per level
ds.tileBaseURL = [NSURL URLWithString:@"https://raw.github.com/dblock/ARTiledImageView/master/Demo/Tiles/SenoraSabasaGarcia/tiles"];
// make sure to retain the datasource
_dataSource = ds;

ARTiledImageScrollView *sv = [[ARTiledImageScrollView alloc] initWithFrame:self.view.bounds];
// set datasource
sv.dataSource = ds;
// default background color
sv.backgroundColor = [UIColor grayColor];
// default stretched placeholder image
sv.backgroundImageURL = [NSURL URLWithString:@"https://raw.github.com/dblock/ARTiledImageView/master/Demo/Tiles/SenoraSabasaGarcia/large.jpg"];
// display tile borders, for debugging
sv.displayTileBorders = NO;

// add as a subview to another view
[self.view addSubview:sv];

Tiles and Data Sources

A typical organization for deep zoom map tiles consists of a folder for each zoom level and individual JPG files for each tile. You can see an example of such files here. ARTiledImageView comes with a local ARLocalTiledImageDataSource, which retrieves tile files from local storage, and a remote ARWebTiledImageDataSource data source, which retrieves map tiles from a remote URL and stores them in Library/Caches (NSCachesDirectory).

You can generate tiles using dzt or any other tool listed with the OpenSeadragon project.

Installation

ARTiledImageView is available through CocoaPods, to install it simply add the following line to your Podfile:

pod "ARTiledImageView"

Testing

Try it out with CocoaPods also,

pod try "ARTiledImageView"

Credits

ARTiledImageView was originally written by @orta, with contributions from @speednoisemovement and @dblock. Some of the implementation in ARTiledImageScrollView comes from NAMapKit.

Copyright & License

ARTiledImageView is (c) Artsy Inc., available under the MIT license.

See the LICENSE file for more information.

artiledimageview's People

Contributors

ashfurrow avatar dblock avatar dkhamsing avatar orta avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.