Constructor
new CanvasSource(options)
- Deprecated:
- Yes
Example
map.addSource('some id', {
type: 'canvas',
canvas: 'idOfMyHTMLCanvas',
animate: true,
coordinates: [
[-76.54, 39.18],
[-76.52, 39.18],
[-76.52, 39.17],
[-76.54, 39.17]
]
});
var mySource = map.getSource('some id');
mySource.setCoordinates([
[-76.54335737228394, 39.18579907229748],
[-76.52803659439087, 39.1838364847587],
[-76.5295386314392, 39.17683392507606],
[-76.54520273208618, 39.17876344106642]
]);
map.removeSource('some id'); // remove
Parameters:
Name | Type | Description |
---|---|---|
options |
Object | 源相关选项设置。 |
Members
animate :boolean
- Default Value:
- true
判断Canvas是否是动态的,如果canvas是静态的,则设置为false
Type:
- boolean
canvas :string
- Default Value:
- null
canvas的id
Type:
- string
coordinates :array
- Default Value:
- null
canvas 指定的坐标
Type:
- array