score:0
your question helped me a lot to get my code working, so trying to give something back:
i think you need to add a key to your geojson layer, see this answer here: https://stackoverflow.com/a/46593710/7392069
for the wfs i used i also had to add the projection to the request params, since another local epsg code was used by default:
srsname:'epsg:4326'
you may also need to add a style, but at least in my example the mapserver applied a standard style, so this should be optional:
style = (feature) => {
return {
// fillcolor: '',
weight: 3,
opacity: 1,
color: 'red',
dasharray: '3',
fillopacity: 0.0
};
}
and
<geojson
key={hash(blah)}
data={this.state.data}
style={this.style}
/>
Source: stackoverflow.com
Related Query
- GeoJSON from react-leaflet doesn't render the layer over the map
- how I can get the geoJson file for gall-peters world map for react leaflet
- Assigning IDs to React components to add to state and map over in the render function
- Is there a way to map over an array of objects in react and also get the accosiated images from cloudinary
- Render Content Dynamically from an array map function in React Native
- How to get the data from React Context Consumer outside the render
- How to pass the match when using render in Route component from react router (v4)
- Laravel 5.5 render a React component in a blade view with data from the controller
- Why react new page render from the bottom of the screen?
- React Leaflet - Align Popup on the center of the map
- How to render the entity map of type LINK of draft js in my react component?
- Assignments to the 'timeInterval' variable from inside React Hook useEffect will be lost after each render
- Render react Component from Map Object
- React Link tag changes the url but doesnt render the component
- REACT JS: Map over an array of objects to render in JSX
- React Leaflet: Get objects from MongoDB to Leaflet map as markers (using node.js and express)
- React render array returned from map
- How to Map the data that I am getting from ajax React js?
- Is there a way to map over the cities on my cities array using the api and rendering the info from all cities on the array?
- Render a table body in react using the map function
- How to map over 2 Array of object in React and render to Table
- Can we render elements from multiple js files into the root node in React JS?
- Loading geoJSON Markers from API - React Leaflet
- React Component Array Map - Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null
- Use react component as a child or from within the render function of a React component
- Can't map data coming from API to render components in React
- Map letters from array if the condition is met REACT
- Filter and Map over the same array in React
- When I load the map React leaflet will some open popups be initialized?
- how to map over an Object and render the arrays inside the object javascript/reactjs?
More Query from same tag
- React Grommet Select - passing in object data as options
- Adding property to nested objects in Flow causes errors
- React Components to SvelteKit - Objects with HTML in attribute (JSX rendering) to Script tag
- How to dynamically change displayed image using React and Parceljs?
- React's setState(), data mutation for nested structures, why not modify state directly?
- How to remove most index.ts files from my project
- React Typescript - Can't pass fetch response to child component [hooks, functionalComponent]
- How to set the default value to props
- How do i disable docs for a storybook page
- Remove duplicate objects in array, based on only one value in the objects
- Recharts set Y-axis to YES and NO
- ReduxForm and ReactRouter - Form Not Rendering
- How to display file name after selecting it in file browser
- How to use react-router 4.0 to refresh current route? not reload the whole page
- When React requests to Django API, net::ERR_SSL_PROTOCOL_ERROR is occured
- What is the definition of "parent component" in React?
- Cannot load local files in electron js
- Remove items form the list in React js
- How to add dynamically created link in React
- How to check if user is already in "/home" page using react and typescript?
- Using useEffect to get data from an api
- React-Bootstrap causing margins on left and right side
- Spring Boot / React blocks CORS
- How can I set up the initial route in next.js?
- React(JS) UI does not match state
- How do I import an SVG to a class-based child-component in React?
- What does the at symbol (@) do in ES6 javascript? (ECMAScript 2015)
- React - Difference between two statements with reduxForm
- Columns in the footer (React-bootstrap) are assembling vertically and I want the column should appear horizontally
- 'State' is not defined and 'handleToggle' is not defined no-undef