Skip to content

[Bug]: Property lineMetrics expected to be a number or nil but was: 1 #3780

@FinnLawrence

Description

@FinnLawrence

Mapbox Implementation

Mapbox

Mapbox Version

10.19.3, also tested with 11.8.0

React Native Version

0.76.7

Platform

iOS

@rnmapbox/maps version

10.1.33

Standalone component to reproduce

import React from 'react';
import {
  MapView,
  ShapeSource,
  LineLayer,
  Camera,
} from '@rnmapbox/maps';

const aLine = {
  type: 'LineString',
  coordinates: [
    [-74.00597, 40.71427],
    [-74.00697, 40.71527],
  ],
};

class BugReportExample extends React.Component {
  render() {
    return (
      <MapView style={{flex: 1}}>
        <Camera centerCoordinate={[-74.00597, 40.71427]} zoomLevel={14} />
        <ShapeSource id="box" shape={aLine} lineMetrics={true}>
          <LineLayer id="box" />
        </ShapeSource>
      </MapView>
    );
  }
}

Observed behavior and steps to reproduce

When setting the lineMetrics property on a shape source, getting (NOBRIDGE) ERROR Mapbox [error] Property lineMetrics expected to be a number or nil but was: 1 in the terminal.

This occurs for the following that I tried:

  • lineMetrics={true}
  • lineMetrics="true"
  • lineMetrics={1}
  • lineMetrics

Expected behavior

Expect that lineMetrics works as documented.

Notes / preliminary analysis

No response

Additional links and references

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🪲Something isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions