Skip to content

Commit 44c51f7

Browse files
authored
Merge pull request #64 from benedictstrube/feat-line-metrics
feat(lineMetrics): added source property `lineMetrics`
2 parents e6c89b9 + 477082d commit 44c51f7

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

src/ui-mapbox/common.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,7 @@ export interface GeoJSONSource extends Source {
342342
data?: any;
343343
minzoom?: number;
344344
maxzoom?: number;
345+
lineMetrics?: boolean;
345346
cluster?: {
346347
radius;
347348
maxZoom;

src/ui-mapbox/index.android.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2505,6 +2505,11 @@ export class Mapbox extends MapboxCommon implements MapboxApi {
25052505
if (options.maxzoom) {
25062506
geojsonOptions.withMaxZoom(options.maxzoom);
25072507
}
2508+
2509+
if (options.lineMetrics !== undefined) {
2510+
geojsonOptions.withLineMetrics(options.lineMetrics);
2511+
}
2512+
25082513
if (options.cluster) {
25092514
geojsonOptions
25102515
.withCluster(true)

src/ui-mapbox/index.ios.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2773,7 +2773,9 @@ export class Mapbox extends MapboxCommon implements MapboxApi {
27732773
if (options.maxzoom !== undefined) {
27742774
sourceOptions[MGLShapeSourceOptionMaximumZoomLevel] = options.maxzoom;
27752775
}
2776-
2776+
if (options.lineMetrics !== undefined) {
2777+
sourceOptions[MGLShapeSourceOptionLineDistanceMetrics] = options.lineMetrics;
2778+
}
27772779
if (options.cluster) {
27782780
sourceOptions[MGLShapeSourceOptionClustered] = true;
27792781
sourceOptions[MGLShapeSourceOptionClusterRadius] = options.cluster.radius || 40;

0 commit comments

Comments
 (0)