From 658992d16b541c3896a6de19c67f8437a00a35e1 Mon Sep 17 00:00:00 2001 From: ftoromanoff Date: Mon, 18 Sep 2023 17:45:16 +0200 Subject: [PATCH] chore(Feature): rename base_altitudeDefault to camelCase --- src/Core/Style.js | 8 ++++---- src/Layer/LabelLayer.js | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Core/Style.js b/src/Core/Style.js index 8856e58ede..f85986a78b 100644 --- a/src/Core/Style.js +++ b/src/Core/Style.js @@ -17,7 +17,7 @@ const inv255 = 1 / 255; const canvas = (typeof document !== 'undefined') ? document.createElement('canvas') : {}; const style_properties = {}; -function base_altitudeDefault(properties, ctx) { +function baseAltitudeDefault(properties, ctx) { return ctx?.coordinates?.z || ctx?.collection?.center?.z || 0; } @@ -581,7 +581,7 @@ class Style { defineStyleProperty(this, 'fill', 'color', params.fill.color); defineStyleProperty(this, 'fill', 'opacity', params.fill.opacity, 1.0); defineStyleProperty(this, 'fill', 'pattern', params.fill.pattern); - defineStyleProperty(this, 'fill', 'base_altitude', params.fill.base_altitude, base_altitudeDefault); + defineStyleProperty(this, 'fill', 'base_altitude', params.fill.base_altitude, baseAltitudeDefault); defineStyleProperty(this, 'fill', 'extrusion_height', params.fill.extrusion_height); this.stroke = {}; @@ -589,7 +589,7 @@ class Style { defineStyleProperty(this, 'stroke', 'opacity', params.stroke.opacity, 1.0); defineStyleProperty(this, 'stroke', 'width', params.stroke.width, 1.0); defineStyleProperty(this, 'stroke', 'dasharray', params.stroke.dasharray, []); - defineStyleProperty(this, 'stroke', 'base_altitude', params.stroke.base_altitude, base_altitudeDefault); + defineStyleProperty(this, 'stroke', 'base_altitude', params.stroke.base_altitude, baseAltitudeDefault); this.point = {}; defineStyleProperty(this, 'point', 'color', params.point.color); @@ -597,7 +597,7 @@ class Style { defineStyleProperty(this, 'point', 'opacity', params.point.opacity, 1.0); defineStyleProperty(this, 'point', 'radius', params.point.radius, 2.0); defineStyleProperty(this, 'point', 'width', params.point.width, 0.0); - defineStyleProperty(this, 'point', 'base_altitude', params.point.base_altitude, base_altitudeDefault); + defineStyleProperty(this, 'point', 'base_altitude', params.point.base_altitude, baseAltitudeDefault); defineStyleProperty(this, 'point', 'model', params.point.model); this.text = {}; diff --git a/src/Layer/LabelLayer.js b/src/Layer/LabelLayer.js index d2c55ef813..ae00ceaf85 100644 --- a/src/Layer/LabelLayer.js +++ b/src/Layer/LabelLayer.js @@ -243,6 +243,7 @@ class LabelLayer extends GeometryLayer { // Converting the extent now is faster for further operation extent.as(data.crs, _extent); coord.crs = data.crs; + context.globals = { icon: true, text: true, @@ -259,7 +260,7 @@ class LabelLayer extends GeometryLayer { // determine if altitude style is specified by the user const altitudeStyle = f.style.point.base_altitude; - const isDefaultElevationStyle = altitudeStyle instanceof Function && altitudeStyle.name == 'base_altitudeDefault'; + const isDefaultElevationStyle = altitudeStyle instanceof Function && altitudeStyle.name == 'baseAltitudeDefault'; // determine if the altitude needs update with ElevationLayer labels.needsAltitude = labels.needsAltitude || this.forceClampToTerrain === true || (isDefaultElevationStyle && !f.hasRawElevationData);