本文整理汇总了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 };
示例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
}
);
}
});
示例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 };