本文整理汇总了TypeScript中leaflet.Util.extend方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Util.extend方法的具体用法?TypeScript Util.extend怎么用?TypeScript Util.extend使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类leaflet.Util
的用法示例。
在下文中一共展示了Util.extend方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: function
_loadTileP: function(zoom, x, y) {
const head = document.getElementsByTagName('head')[0],
key = zoom + '_' + x + '_' + y,
functionName = 'lu_' + key,
wk = this._windowKey,
self = this;
const url = L.Util.template(
this._url,
L.Util.extend(
{
cb: wk + '.' + functionName,
s: L.TileLayer.prototype._getSubdomain.call(this, { x: x, y: y }),
x: x,
y: y,
z: zoom
},
this.options
)
);
const script = document.createElement('script');
script.setAttribute('type', 'text/javascript');
script.setAttribute('src', url);
window[wk][functionName] = function(data) {
self._cache[key] = data;
delete window[wk][functionName];
head.removeChild(script);
};
head.appendChild(script);
},
示例2:
prop2: '2',
};
const obj3 = {
prop3: 'three',
};
const obj4 = {
prop4: 'cuatro',
};
const obj5 = {
prop5: 'cinque',
};
const extended0: typeof obj1 = L.Util.extend(obj1);
const extended1: typeof obj1 & typeof obj2 = L.Util.extend(obj1, obj2);
const extended2: typeof obj1 & typeof obj2 & typeof obj3 = L.Util.extend(obj1, obj2, obj3);
const extended3: typeof obj1 & typeof obj2 & typeof obj3 & typeof obj4 = L.Util.extend(obj1, obj2, obj3, obj4);
const extended4: typeof obj1 & typeof obj2 & typeof obj3 & typeof obj4 & typeof obj5 = L.Util.extend(obj1, obj2, obj3, obj4, obj5);
L.Util.create({});
L.Util.create(null, {foo: {writable: true, value: 'bar'}});
L.Util.bind(() => {}, {});
L.Util.stamp({});
L.Util.throttle(() => {}, 123, {});
L.Util.wrapNum(123, []);
L.Util.wrapNum(123, [], true);
L.Util.falseFn();
L.Util.formatNum(123);
示例3:
iconUrl: 'my-icon.png'
})).setIcon(L.divIcon({
className: 'my-div-icon'
}));
const latLngs = [
{lat: 0, lng: 0},
{lat: 1, lng: 1}
];
const polygon = new L.Polygon(latLngs);
const polygonExclusion = new L.Polygon([latLngs, latLngs]);
L.polygon(latLngs).addTo(map);
L.polygon([latLngs, latLngs]).addTo(map);
L.Util.extend({});
L.Util.create({});
L.Util.bind(() => {}, {});
L.Util.stamp({});
L.Util.throttle(() => {}, 123, {});
L.Util.wrapNum(123, []);
L.Util.wrapNum(123, [], true);
L.Util.falseFn();
L.Util.formatNum(123);
L.Util.formatNum(123, 1);
L.Util.trim('word ');
L.Util.splitWords('word word');
L.Util.setOptions({}, {});
L.Util.getParamString({});
L.Util.getParamString({}, '');
L.Util.getParamString({}, '', true);