How to select then draw a custom feature/shape directly onto the map? #1010
Unanswered
JayCork
asked this question in
Questions & Help
Replies: 1 comment 2 replies
-
How do you style the lines? If this are only options they are need to be added on the layer you can use this:
https://jsfiddle.net/falkedesign/r7o3dx2c/ If you want, it would be nice to get a info about your project: #904 |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there. My team is working on a plug-in for a weather company and we have the need for some custom drawing options. What we would like to achive is the ability for our users to be able draw specific shapes. We've not quite sussed out how to achieve what we have set out to do, so we are looking for some guidence.
For a specific usecase we would like options within the drawLine tool that would allow them to select a weather front type (see image) and be able to draw directly on the map in the same way that you would draw a regualr shape.
At the moment we have two patterns for achieving something like this, but both end up with the user selecting the "weather front" after adding it to the map rather than before.
Patterns
Pattern 1
Action with a onClick event that runs an "addFeature()" function with parameters needed to create the desried feature.
This works well enough for some things, but the user experince is kind of nasty. As the feature is added to the map and then the feature needs to be edited. Rather than being able to click on "Cold Front", drawing on the map, and having it added with all the event handling, and custom data that we need.
Pattern 2
Upon a feature being drawn use the pm:create event to retrospectifly ask the user what they wanted to draw such as line style, data values, custom classes.
Desired Results
We would like the user to be able to select what they wanted to draw, allow them to draw it, and for it to appear complete on the map were, if they need to, can access the data to edit the feature.
Beta Was this translation helpful? Give feedback.
All reactions