1 | Array.prototype.push.apply(a, [1,2])) |
a.push(1, 2, 3);
1 | var arr = [1]; |
1 | Array.prototype.push.apply(a, [1,2])) |
a.push(1, 2, 3);
1 | var arr = [1]; |
思路如下(console中有三个数据)
1 | function sleep(ms) { |
via https://stackoverflow.com/questions/951021/what-is-the-javascript-version-of-sleep
其实是重建
1 | function setLayerSource (layerId, source, sourceLayer) { |
1 | const DEFAULTS = { |
直接字面量创建
1 | var objA = {}; |
new关键字创建
1 | var objB = new Object(); |
Object.create 创建
一个完整的版本
1 | import StarRating from 'vue-star-rating' |
1 | import InfoWindowContent from '../InfoWindowContent.vue' |
1 | // 添加Popup对象 |
options.preserveDrawingBuffer
If true , the map’s canvas can be exported to a PNG using map.getCanvas().toDataURL() . This is false by default as a performance optimization.
1 | map.getCanvas().toDataURL() |
Returns an array of GeoJSON Feature objects representing visible features that satisfy the query parameters.
https://docs.mapbox.com/mapbox-gl-js/api/map/#map#queryrenderedfeatures
1 | // Find all features within a static bounding box |
1 | // Find all features within a bounding box around a point |
1 | // Query all rendered features from a single layer |
Returns an array of GeoJSON Feature objects representing features within the specified vector tile or GeoJSON source that satisfy the query parameters.
https://docs.mapbox.com/mapbox-gl-js/api/map/#map#querysourcefeatures
1 | // Find all features in one source layer in a vector source |
1 | // If an image with the ID 'cat' already exists in the style's sprite, |
1 | "icon-color": [ |
https://stackoverflow.com/questions/17964757/how-to-prune-delete-nodes-in-nested-tree-like-json
1 | var a = [ |
简单说,就是允许碰撞
1 | "icon-ignore-placement": true, // 不管下面 |
1 | var aa = { "type": "Polygon", |
最外面多一层
1 | var aa = { "type": "MultiPolygon", |
test.map.getSource(‘temp_polygon’).setData(aa)
1 | var aa = { |
1 | var aa = { |
