Replies: 1 comment
-
If you have a geojson file with valid data, you should pass it like this: import geoJson from '../assets/test.json';
...
const [lineStrings, setLineStrings] = useState([]);
const filteredLineStrings = geojson.filter(feature => feature.geometry.type === 'LineString');
//where geojson contains the data generated by https://geojson.io/
setLineStrings(filteredLineStrings);
...
...
<ShapeSource id="lineLayer-1" shape={{type: 'FeatureCollection', features: lineStrings}}> Please refer to the extremely useful example application: I recommend pulling/forking the whole repo, navigate into the example folder and read the README.md. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm seeing examples and i observed that all examples are passing shapes to shape prop of ShapeSource however i did like that, am i worng ?
Beta Was this translation helpful? Give feedback.
All reactions