Skip to content

Instantly share code, notes, and snippets.

@astojilj
astojilj / after_setting_style.js
Last active August 17, 2023 04:49
Hiding trees layer from style programatically
map.on('style.load', function() {
const treesLayerId = map.style._order.find((id) => map.style.getLayer(id).type === 'model' && id.startsWith("trees"));
if (treesLayerId) {
map.setLayoutProperty(treesLayerId, 'visibility', 'none');
}
});
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@astojilj
astojilj / route.geojson
Created February 24, 2022 08:02
route.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
We couldn’t find that file to show.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
/*
This query looks for nodes, ways and relations
with the given key.
Choose your region and hit the Run button above!
*/
[out:json][timeout:25];
// gather results
(
// query part for: “"building:part"=*”
node["building:part"]({{bbox}});
@astojilj
astojilj / depth-development-support.patch
Created April 15, 2020 14:28
depth-development-support.patch
diff --git a/src/render/painter.js b/src/render/painter.js
index 55fabcf62..4cb3fdeb1 100644
--- a/src/render/painter.js
+++ b/src/render/painter.js
@@ -645,7 +645,7 @@ class Painter {
const key = `${name}${programConfiguration ? programConfiguration.cacheKey : ''}${this._showOverdrawInspector ? '/overdraw' : ''}
${terrain ? '/terrain' : ''}${rtt ? '/rtt' : ''}`;
if (!this.cache[key]) {
- this.cache[key] = new Program(this.context, shaders[name], programConfiguration, programUniforms[name], this._showOverdrawInspector, terrain, rtt);
+ this.cache[key] = new Program(this.context, shaders[name], programConfiguration, programUniforms[name], this._showOverdrawInspector, terrain, rtt, name === 'terrainRaster');
@astojilj
astojilj / dem-measure.patch
Created August 27, 2019 12:30
new DEMData and getImageData measurement patch
diff --git a/src/source/raster_dem_tile_source.js b/src/source/raster_dem_tile_source.js
index 1937a103d..e7c6cafc2 100644
--- a/src/source/raster_dem_tile_source.js
+++ b/src/source/raster_dem_tile_source.js
@@ -55,7 +55,10 @@ class RasterDEMTileSource extends RasterTileSource implements Source {
delete (img: any).cacheControl;
delete (img: any).expires;
+ const t = performance.now();
const rawImageData = browser.getImageData(img);
@astojilj
astojilj / measure-relinking.patch
Created May 20, 2019 06:01
measure relinking patch and measured results
diff --git a/src/mbgl/gl/program.hpp b/src/mbgl/gl/program.hpp
index 3757c442d..9d4eb7c24 100644
--- a/src/mbgl/gl/program.hpp
+++ b/src/mbgl/gl/program.hpp
@@ -23,6 +23,8 @@
#include <string>
+#import <QuartzCore/QuartzCore.h>
+