• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript leaflet.TileLayer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了TypeScript中leaflet.TileLayer的典型用法代码示例。如果您正苦于以下问题:TypeScript TileLayer类的具体用法?TypeScript TileLayer怎么用?TypeScript TileLayer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了TileLayer类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。

示例1: function

const LandscanPopulationOverlay = L.TileLayer.extend({
  bounds: null,
  enabled: true,
  id: 'landscan-population',
  legends: [],
  title: 'Population Density',

  /**
   * Build leaflet overlay
   */
  initialize: function() {
    const legend = document.createElement('img');
    legend.src = './assets/legend-landscan-population.png';
    legend.setAttribute('alt', 'Population Density Legend');

    // Add to legends array
    this.legends.push(legend);

    L.TileLayer.prototype.initialize.call(
      this,
      'https://earthquake.usgs.gov/arcgis/rest/services' +
        '/eq/pager_landscan2012bin/MapServer/tile/{z}/{y}/{x}',
      {
        attribution:
          '<a href="https://web.ornl.gov/sci/landscan/" target="_blank">' +
          'LandScan™ 2012 High Resolution global Population Data Set ' +
          'ŠUT BATTELLE, LLC.' +
          '</a>',
        maxZoom: 16
      }
    );
  }
});
开发者ID:ehunter-usgs,项目名称:earthquake-eventpages,代码行数:33,代码来源:landscan-population-overlay.ts


示例2: function

 */
// tslint:disable-next-line:variable-name
const HistoricSeismicityOverlay = L.TileLayer.extend({
  bounds: null,
  enabled: true,
  id: 'historic-seismicity',
  legends: [],
  title: 'Historic Seismicity',

  /**
   * Build leaflet overlay
   */
  initialize: function() {
    const legend = document.createElement('img');
    legend.src = './assets/legend-historic-seismicity.png';
    legend.setAttribute('alt', 'Historic seismicity legend');

    // Add to legends array
    this.legends = [legend];

    L.TileLayer.prototype.initialize.call(
      this,
      'https://earthquake.usgs.gov/arcgis/rest/services' +
        '/eq/catalog/MapServer/tile/{z}/{y}/{x}',
      {
        maxZoom: 16
      }
    );
  }
});

export { HistoricSeismicityOverlay };
开发者ID:ehunter-usgs,项目名称:earthquake-eventpages,代码行数:32,代码来源:historic-seismicity-overlay.ts


示例3: function

 */
// tslint:disable-next-line:variable-name
const TectonicPlatesOverlay = L.TileLayer.extend({
  bounds: null,
  enabled: true,
  id: 'tectonic-plates',
  legends: [],
  title: 'Tectonic Plates',

  /**
   * Build leaflet overlay
   */
  initialize: function() {
    const legend = document.createElement('img');
    legend.src = './assets/legend-tectonic-plates.png';
    legend.setAttribute('alt', 'Tectonic Plates Legend');

    // Add to legends array
    this.legends.push(legend);

    L.TileLayer.prototype.initialize.call(
      this,
      'https://earthquake.usgs.gov/basemap/tiles/plates/{z}/{x}/{y}.png',
      {
        attribution: '',
        maxZoom: 16
      }
    );
  }
});

export { TectonicPlatesOverlay };
开发者ID:ehunter-usgs,项目名称:earthquake-eventpages,代码行数:32,代码来源:tectonic-plates-overlay.ts


示例4: done

		return done();
	}
	return;
}


L.TileLayer.addInitHook(function(this: CachedTileLayer) {
	this._checkLimitCounter = CHECK_LIMIT_COUNTER;
	if (!this.options.useCache) {
		this._db = null;
		this._canvas = null;
		return;
	}
	if (this.options.dbOptions) {
		this._db = new PouchDB('offline-tiles', this.options.dbOptions);
	} else {
		this._db = new PouchDB('offline-tiles');
	}
	this._canvas = document.createElement('canvas');
	if (!(this._canvas.getContext && this._canvas.getContext('2d'))) {
			// HTML5 canvas is needed to pack the tiles as base64 data. If
			//   the browser doesn't support canvas, the code will forcefully
			//   skip caching the tiles.
			this._canvas = null;
		}
});

// 🍂namespace TileLayer
// 🍂section PouchDB tile caching options
// 🍂option useCache: Boolean = false
// Whether to use a PouchDB cache on this tile layer, or not
L.TileLayer.prototype.options.useCache = false;
开发者ID:hagai26,项目名称:Leaflet.TileLayer.PouchDBCached,代码行数:32,代码来源:leaflet-cached-tilelayer.ts



注:本文中的leaflet.TileLayer类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript leaflet.Util类代码示例发布时间:2022-05-25
下一篇:
TypeScript leaflet.Polyline类代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap