Skip to content

Commit

Permalink
chore(Feature): rename base_altitudeDefault to camelCase
Browse files Browse the repository at this point in the history
  • Loading branch information
ftoromanoff committed Dec 13, 2023
1 parent ac9cea4 commit 658992d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/Core/Style.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -581,23 +581,23 @@ 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 = {};
defineStyleProperty(this, 'stroke', 'color', params.stroke.color);
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);
defineStyleProperty(this, 'point', 'line', params.point.line);
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 = {};
Expand Down
3 changes: 2 additions & 1 deletion src/Layer/LabelLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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);
Expand Down

0 comments on commit 658992d

Please sign in to comment.