Skip to content

[Bug]: Unable to display layers using ShapeSource with it's URL prop #3863

@HarshaZeitview

Description

@HarshaZeitview

Mapbox Implementation

Mapbox

Mapbox Version

default

React Native Version

0.79.2

Platform

iOS

@rnmapbox/maps version

10.1.39

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="idStreetLayer" url={'file://localPath.geojson'}>
          <LineLayer id="idStreetLayer" />
        </ShapeSource>
      </MapView>
    );
  }
}

Observed behavior and steps to reproduce

Actually when using the ShapeSource with the url prop the layers are not visible, but if same geoJson copied from the url and provided it through shape prop then working fine.
So it should expect same behaviour from the url prop as well.

Expected behavior

Layers should be visible on the map with URL props as well.

Notes / preliminary analysis

No errors and logs are displayed in console.

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