-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New editorOptions= argument for lower-level toolbar customization #100
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we not set allowSelfIntersection = FALSE
in the default leafpm options? Also, do we really need to distinguish between polylines/polygon and markers - markers cannot self-intersect anyway?
@JoshOBrien this looks good to me. See my comment here. I haven't tested any of it though (just looked over it). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
R/addToolbar.R
Outdated
##' \code{leafpm::addPmToolbar}. | ||
processOpts <- function(fun, args) { | ||
## Account for special meaning of `FALSE` as arg in leaflet.extras | ||
if(isFALSE(args)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we use r-spatial/mapview#177 technique instead? I would prefer not to force users to have to upgrade to newer version of R
. I am sensitive to this since this has blocked me inside restrictive employers from using some packages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added in develop
branch 469f620. @tim-salabim, please let me know if you encountered any challenges with this replacement in mapview
. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually @tim-salabim @JoshOBrien this should be only match FALSE
exactly so I changed in bb5e7c9#diff-ad5b576355b0f070a49b21f08b1c27ffR14. sorry.
@JoshOBrien @tim-salabim I have merged #98 and this pull into Sorry for the very long delay. This is not how I anticipate operating going forward. |
@tim-salabim will you please test |
@tim-salabim I ran CRAN-checks and everything passes except for #102. |
@timelyportfolio. I just arrived in the us. Will try to find some time to test this week. |
@JoshOBrien looks like force push closed this pull request. Was this intentional? If you made changes I will try to add into |
Oops. No, not intentional, so please disregard.
…On Mon, Jul 22, 2019, 05:10 timelyportfolio ***@***.***> wrote:
@JoshOBrien <https://github.com/JoshOBrien> looks like force push closed
this pull request. Was this intentional? If you made changes I will try to
add into develop.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#100?email_source=notifications&email_token=AA2RGJNPGXKR3AUUX2W5HUDQAWPRZA5CNFSM4HUERFFKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2PW4IQ#issuecomment-513764898>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA2RGJNH25SA5KAPW5EOAZ3QAWPRZANCNFSM4HUERFFA>
.
|
@timelyportfolio I've had a test run. The only thing I fund missing is that the new Thanks guys for this awesome addition!! |
The new
editorOptions=
argument takes a user-supplied list of named options that are ultimately passed on to eitherleafpm::addPmToolbar()
orleaflet.extras::addDrawToolbar()
, depending on the value of theeditor=
argument. (This addresses #92 and incorporates suggestions made in the discussion resulting from #97)When
editor = "leafpm"
, the list can consist of one or more elements with names"toolbarOptions"
,"drawOptions"
,"editOptions"
, and"cutOptions"
. For details, see?leafpm::addPmToolbar
.When
editor = "leaflet.extras"
, allowable names for list elements are"polylineOptions
,"polygonOptions"
,"circleOptions"
,"rectangleOptions"
,"makerOptions"
,"circleMarkerOptions"
, and"editOptions"
. For details, see?leaflet.extras::addDrawToolbar
.Currently, there is no checking or validation of the list passed in to
editorOptions=
, so users will need to take particular care that the list's structure (including the names of all of its elements) matchwith what is expected by the
leafpm::addPmToolbar()
orleaflet.extras::addDrawToolbar()
functions.Here are few simple examples demonstrating the new argument's usage: