當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript TileLayer.extend方法代碼示例

本文整理匯總了TypeScript中leaflet.TileLayer.extend方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript TileLayer.extend方法的具體用法?TypeScript TileLayer.extend怎麽用?TypeScript TileLayer.extend使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在leaflet.TileLayer的用法示例。


在下文中一共展示了TileLayer.extend方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: 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

示例2: 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

示例3: 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


注:本文中的leaflet.TileLayer.extend方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。