maps icon indicating copy to clipboard operation
maps copied to clipboard

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

Open FinnLawrence opened this issue 1 year ago • 0 comments

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

FinnLawrence avatar Feb 17 '25 23:02 FinnLawrence