Skip to content

Instantly share code, notes, and snippets.

@juliaogris
Last active September 22, 2015 05:55
Show Gist options
  • Save juliaogris/e0231b994946ef8bbcf6 to your computer and use it in GitHub Desktop.
Save juliaogris/e0231b994946ef8bbcf6 to your computer and use it in GitHub Desktop.
/**
* @param {!Array<!TileFactory>} factories
* @constructor
* @struct
* @final
* @implements {TileFactory}
*/
FallbackTileFactory = function(compositeFacotry, fallbackFactory, fallbackBounds) {
/** @override */
this.createTile = function(coord, zoom, size, div, opt_options) {
// in Korea
if (inBounds(coord, zoom, fallbackBounds)) {
return fallbackFactory.createTile(coord, xoom, size, div, opt_options);
}
// outside Korea
return compositeFactory.createTile(coord, xoom, size, div, opt_options);
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment