Skip to content

Commit

Permalink
Address review findings
Browse files Browse the repository at this point in the history
  • Loading branch information
zmiao committed Mar 2, 2020
1 parent 5bc9c76 commit dc29ed9
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/style-spec/expression/definitions/within.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ class Within implements Expression {
return new Within(geojson, geojson);
}
}
return context.error(`'within' expression requires valid geojson source that contains polygon geometry type.`);
return context.error(`'within' expression requires valid geojson object that contains polygon geometry type.`);
}

evaluate(ctx: EvaluationContext) {
Expand Down
2 changes: 1 addition & 1 deletion src/style-spec/reference/v8.json
Original file line number Diff line number Diff line change
Expand Up @@ -3455,7 +3455,7 @@
}
},
"within": {
"doc": "Returns `true` if the feature being evaluated is inside the pre-defined geometry boundary, `false` otherwise. The arguments are required to be valid GeoJSON object which contains `Polygon` geometries. Currently only features with `Point` or `LineString` geometry types are supported.",
"doc": "Returns `true` if the feature being evaluated is inside the pre-defined geometry boundary, `false` otherwise. The expression has one argument which must be a valid GeoJSON Polygon/Multi-Polygon object. The expression only evaluates on `Point` or `LineString` feature. For `Point` feature, The expression will return false if any point of the feature is on the boundary or outside the boundary. For `LineString` feature, the expression will return false if the line is fully outside the boundary, or the line is partially intersecting the boundary, which means either part of the line is outside of the boundary, or end point of the line lies on the boundary.",
"group": "Decision",
"sdk-support": {
"basic functionality": {
Expand Down
6 changes: 3 additions & 3 deletions src/symbol/symbol_layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@ export function evaluateVariableOffset(anchor: TextAnchor, offset: [number, numb
}

export function performSymbolLayout(bucket: SymbolBucket,
glyphMap: {[string]: {[number]: ?StyleGlyph}},
glyphPositions: {[string]: {[number]: GlyphPosition}},
imageMap: {[string]: StyleImage},
glyphMap: {[_: string]: {[number]: ?StyleGlyph}},
glyphPositions: {[_: string]: {[number]: GlyphPosition}},
imageMap: {[_: string]: StyleImage},
imagePositions: {[_: string]: ImagePosition},
showCollisionBoxes: boolean,
canonical: CanonicalTileID) {
Expand Down
4 changes: 2 additions & 2 deletions test/expression.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function convertLines(lines, canonical, out) {
}
}

function getGeomtry(feature, geometry, canonical) {
function getGeometry(feature, geometry, canonical) {
if (geometry.coordinates) {
const coords = geometry.coordinates;
const type = geometry.type;
Expand Down Expand Up @@ -114,7 +114,7 @@ run('js', {ignores, tests}, (fixture) => {
}
if ('geometry' in input[1]) {
if (canonical !== null) {
getGeomtry(feature, input[1].geometry, canonical);
getGeometry(feature, input[1].geometry, canonical);
} else {
feature.type = input[1].geometry.type;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"compiled": {
"errors": [{
"key": "",
"error": "'within' expression requires valid geojson source that contains polygon geometry type."
"error": "'within' expression requires valid geojson object that contains polygon geometry type."
}],
"result": "error"
}
Expand Down

0 comments on commit dc29ed9

Please sign in to comment.