From 2f8059af151e72178fee8e497329f609fd3f6b80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguye=CC=82=CC=83n?= Date: Wed, 26 Feb 2020 14:52:32 -0800 Subject: [PATCH] [ios, macos] Customized symbolAvoidsEdges documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit No one using the iOS or macOS map SDK will know whether it supports “global collision detection” based on “GL JS v0.42.0 or greater”. --- .../darwin/scripts/style-spec-overrides-v8.json | 3 +++ platform/darwin/src/MGLSymbolStyleLayer.h | 15 +++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/platform/darwin/scripts/style-spec-overrides-v8.json b/platform/darwin/scripts/style-spec-overrides-v8.json index 0ba2b77dc..e478ccaf0 100644 --- a/platform/darwin/scripts/style-spec-overrides-v8.json +++ b/platform/darwin/scripts/style-spec-overrides-v8.json @@ -67,6 +67,9 @@ "doc": "Name of a style image to use for drawing an image background.\n\nUse the `+[MGLStyle setImage:forName:]` method to associate an image with a name that you can set this property to.\n\nWithin a constant string value, a feature attribute name enclosed in curly braces (e.g., `{token}`) is replaced with the value of the named attribute. Tokens inside non-constant expressions are ignored; instead, use `mgl_join:` and key path expressions.", "examples": "See the Use images to cluster point data example to learn how to dynamically set your icons with an expression." }, + "symbol-avoid-edges": { + "doc": "Whether symbols in this layer avoid colliding with symbols in adjacent tiles.\n\nIf this property is set to `true`, symbols in this layer avoid crossing the edge of a tile. You should set this property to `true` if the backing vector tiles don’t have enough padding to prevent collisions, or if this layer’s `symbolPlacement` property is set to `MGLSymbolPlacementPoint` but this layer is above a symbol layer whose `symbolPlacement` property is set to `MGLSymbolPlacementLine`. You do not need to enable this property to prevent clipped labels at tile boundaries." + }, "text-field": { "doc": "Value to use for a text label.\n\nWithin a constant string value, a feature attribute name enclosed in curly braces (e.g., `{token}`) is replaced with the value of the named attribute. Tokens inside non-constant expressions are ignored; instead, use `mgl_join:` and key path expressions.", "examples": "See the Cluster point data and Use images to cluster point data to learn how to use an expression to set this attribute to the number of markers within a cluster." diff --git a/platform/darwin/src/MGLSymbolStyleLayer.h b/platform/darwin/src/MGLSymbolStyleLayer.h index 8b6bef3c5..9ca662887 100644 --- a/platform/darwin/src/MGLSymbolStyleLayer.h +++ b/platform/darwin/src/MGLSymbolStyleLayer.h @@ -991,12 +991,15 @@ MGL_EXPORT @property (nonatomic, null_resettable) NSExpression *textMaxWidth __attribute__((unavailable("Use maximumTextWidth instead."))); /** - If true, the symbols will not cross tile edges to avoid mutual collisions. - Recommended in layers that don't have enough padding in the vector tile to - prevent collisions, or if it is a point symbol layer placed after a line symbol - layer. When using a client that supports global collision detection, like - Mapbox GL JS version 0.42.0 or greater, enabling this property is not needed to - prevent clipped labels at tile boundaries. + Whether symbols in this layer avoid colliding with symbols in adjacent tiles. + + If this property is set to `true`, symbols in this layer avoid crossing the + edge of a tile. You should set this property to `true` if the backing vector + tiles don’t have enough padding to prevent collisions, or if this layer’s + `symbolPlacement` property is set to `MGLSymbolPlacementPoint` but this layer + is above a symbol layer whose `symbolPlacement` property is set to + `MGLSymbolPlacementLine`. You do not need to enable this property to prevent + clipped labels at tile boundaries. The default value of this property is an expression that evaluates to `NO`. Set this property to `nil` to reset it to the default value.