Create layers with property controls as components #5750
openlayers-droid
started this conversation in
General
Replies: 1 comment 7 replies
-
You cannot have layer definition and controls all in one React component, at least not in a non-tricky way. The way I recommend you to achieve what you want is: Create a React component that return a layer: ExampleLayer.js
Then in your App.js call that component:
Maybe it isn't a perfect example but I want to show you the workflow. |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
hi,
This may be trivial. However, i only started on React Js a week ago.
Basically what i need is to create a component of a specific layer that encapsulate the layer definition, loading of data, and controls to change layer properties using updateTriggers. Most of the examples demonstrate using a layer within the App.js component. I need to create a specific layer say GeoJsonLayer component (with buttons and sliders to control its properties such as radiusScale, Opacity ...etc) and then inject in the the App.js render method.
You assistance on this matter is greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions