Skip to content

Commit

Permalink
roxygenize and prep for CRAN
Browse files Browse the repository at this point in the history
  • Loading branch information
timelyportfolio committed Feb 1, 2020
1 parent 4a16df2 commit 326ae05
Show file tree
Hide file tree
Showing 13 changed files with 155 additions and 65 deletions.
4 changes: 2 additions & 2 deletions R/edit.R
Original file line number Diff line number Diff line change
Expand Up @@ -252,15 +252,15 @@ editFeatures.sf = function(
x$edit_id = as.character(1:nrow(x))

if (is.null(map)) {
x = mapview:::checkAdjustProjection(x)
x = checkAdjustProjection(x)
map = mapview::mapview()@map
map = leafem::addFeatures(
map, data=x, layerId=~x$edit_id,
label=label,
labelOptions = leaflet::labelOptions(direction="top", offset=c(0,-40)),
group = "toedit"
)
ext = mapview:::createExtent(x)
ext = createExtent(x)
map = leaflet::fitBounds(
map,
lng1 = ext[1],
Expand Down
7 changes: 3 additions & 4 deletions R/playback.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ playback <- function(x, origsf = NULL) {
lapply(rec,function(x){x$feature})
))

x = mapview:::checkAdjustProjection(sf_all)
x = checkAdjustProjection(sf_all)

if(!is.null(origsf)) {
sf_all = c(
Expand All @@ -52,7 +52,7 @@ playback <- function(x, origsf = NULL) {
)
}

ext = mapview:::createExtent(sf_all)
ext = createExtent(sf_all)
map = leaflet::fitBounds(
map,
lng1 = ext[1],
Expand All @@ -63,15 +63,14 @@ playback <- function(x, origsf = NULL) {

orig_gj <- NULL
if(!is.null(origsf)) {
origsf = mapview:::checkAdjustProjection(origsf)
origsf = checkAdjustProjection(origsf)
origsf$edit_id = as.character(1:nrow(origsf))
orig_gj = geojsonio::geojson_list(origsf)
}

scr <- sprintf(
"
function(el, x) {
debugger;
var map = this;
var feat = %s;
var feat_lookup = {};
Expand Down
4 changes: 2 additions & 2 deletions R/select.R
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ selectFeatures.sf = function(
) {

nm = deparse(substitute(x))
x = mapview:::checkAdjustProjection(x)
x = checkAdjustProjection(x)
x$edit_id = as.character(1:nrow(x))

mode = match.arg(mode)
Expand All @@ -69,7 +69,7 @@ selectFeatures.sf = function(
map = leafem::addFeatures(
map, data = x, layerId = ~x$edit_id, label = label, ...
)
ext = mapview:::createExtent(x)
ext = createExtent(x)
map = leaflet::fitBounds(
map,
lng1 = ext[1],
Expand Down
15 changes: 10 additions & 5 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,23 @@ Interactive editing of spatial data in R | an [RConsortium](https://www.r-consor

### Status

`mapedit` is still in active development. We would very much appreciate feedback, ideas, and use cases. The API has stabilized, but please be aware that the API might change over the next couple of months. We will use semantic versioning with Github tagged releases to track changes and progress. All changes will also be documented in NEWS.md.
`mapedit` is still in active development. We would very much appreciate feedback, ideas, and use cases. The API has stabilized, and wee will use semantic versioning with Github tagged releases to track changes and progress. All changes will also be documented in NEWS.md.

### Blog Posts

[Introduction to mapedit](http://r-spatial.org/r/2017/01/30/mapedit_intro.html) - January 30, 2017
[Introduction to mapedit](http://r-spatial.org/r/2017/01/30/mapedit_intro.html) January 30, 2017


[mapedit updates in 0.2.0](http://r-spatial.org/r/2017/06/09/mapedit_0-2-0.html) June 12, 2017


[mapedit 0.5.0 and Leaflet.pm](https://www.r-spatial.org/r/2019/03/31/mapedit_leafpm.html) March 31, 2019


[mapedit updates in 0.2.0](http://r-spatial.org/r/2017/06/09/mapedit_0-2-0.html) - June 12, 2017

### Talks

[Tim Appelhans at useR 2017](https://channel9.msdn.com/events/useR-international-R-User-conferences/useR-International-R-User-2017-Conference/mapedit-interactive-manipulation-of-spatial-objects?term=tim%20appelhans) - July 2017
[Tim Appelhans at useR 2017](https://channel9.msdn.com/events/useR-international-R-User-conferences/useR-International-R-User-2017-Conference/mapedit-interactive-manipulation-of-spatial-objects?term=tim%20appelhans) July 2017

### Install

Expand All @@ -42,7 +47,7 @@ As the CRAN badge above indicates, `mapedit` has achieved CRAN status. To insta
```
install.packages("mapedit")
# cutting edge
# devtools::install_github("r-spatial/mapedit")
# remotes::install_github("r-spatial/mapedit@develop")
```

### Examples
Expand Down
64 changes: 46 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,55 +1,78 @@

<!-- README.md is generated from README.Rmd. Please edit that file -->
mapedit
=======

[![CRAN\_Status\_Badge](http://www.r-pkg.org/badges/version/mapedit)](https://cran.r-project.org/package=mapedit) [![monthly](http://cranlogs.r-pkg.org/badges/mapedit)](https://www.rpackages.io/package/mapedit) [![total](http://cranlogs.r-pkg.org/badges/grand-total/mapedit)](https://www.rpackages.io/package/mapedit)
# mapedit

Interactive editing of spatial data in R | an [RConsortium](https://www.r-consortium.org/) funded [project](https://www.r-consortium.org/projects/awarded-projects). For additional detail, please see the original [proposal](https://github.com/environmentalinformatics-marburg/mapview_toolchain/blob/master/mapview_interactive_data_manipulation.Rmd).
[![CRAN\_Status\_Badge](http://www.r-pkg.org/badges/version/mapedit)](https://cran.r-project.org/package=mapedit)
[![monthly](http://cranlogs.r-pkg.org/badges/mapedit)](https://www.rpackages.io/package/mapedit)
[![total](http://cranlogs.r-pkg.org/badges/grand-total/mapedit)](https://www.rpackages.io/package/mapedit)

Interactive editing of spatial data in R | an
[RConsortium](https://www.r-consortium.org/) funded
[project](https://www.r-consortium.org/projects/awarded-projects). For
additional detail, please see the original
[proposal](https://github.com/environmentalinformatics-marburg/mapview_toolchain/blob/master/mapview_interactive_data_manipulation.Rmd).

### Status

`mapedit` is still in active development. We would very much appreciate feedback, ideas, and use cases. The API has stabilized, but please be aware that the API might change over the next couple of months. We will use semantic versioning with Github tagged releases to track changes and progress. All changes will also be documented in NEWS.md.
`mapedit` is still in active development. We would very much appreciate
feedback, ideas, and use cases. The API has stabilized, and wee will use
semantic versioning with Github tagged releases to track changes and
progress. All changes will also be documented in NEWS.md.

### Blog Posts

[Introduction to mapedit](http://r-spatial.org/r/2017/01/30/mapedit_intro.html) - January 30, 2017
[Introduction to
mapedit](http://r-spatial.org/r/2017/01/30/mapedit_intro.html) January
30, 2017

[mapedit updates
in 0.2.0](http://r-spatial.org/r/2017/06/09/mapedit_0-2-0.html) June 12,
2017

[mapedit updates in 0.2.0](http://r-spatial.org/r/2017/06/09/mapedit_0-2-0.html) - June 12, 2017
[mapedit 0.5.0 and
Leaflet.pm](https://www.r-spatial.org/r/2019/03/31/mapedit_leafpm.html)
March 31, 2019

### Talks

[Tim Appelhans at useR 2017](https://channel9.msdn.com/events/useR-international-R-User-conferences/useR-International-R-User-2017-Conference/mapedit-interactive-manipulation-of-spatial-objects?term=tim%20appelhans) - July 2017
[Tim Appelhans at
useR 2017](https://channel9.msdn.com/events/useR-international-R-User-conferences/useR-International-R-User-2017-Conference/mapedit-interactive-manipulation-of-spatial-objects?term=tim%20appelhans)
July 2017

### Install

As the CRAN badge above indicates, `mapedit` has achieved CRAN status. To install, please use `install.packages`, or for the cutting edge, use `devtools::install_github`.
As the CRAN badge above indicates, `mapedit` has achieved CRAN status.
To install, please use `install.packages`, or for the cutting edge, use
`devtools::install_github`.

install.packages("mapedit")
# cutting edge
# devtools::install_github("r-spatial/mapedit")
# remotes::install_github("r-spatial/mapedit@develop")

### Examples

We can interactively CRD (create, update, delete) features on a map with `editMap`.
We can interactively CRD (create, update, delete) features on a map with
`editMap`.

library(mapedit)
library(leaflet)
library(mapview)

editMap(leaflet() %>% addTiles())

editMap(
mapview(breweries91),
targetLayerId = "breweries91"
)

`mapedit` also offers interactive selection of map features with `selectMap`.
`mapedit` also offers interactive selection of map features with
`selectMap`.

library(mapedit)
library(leaflet)
library(mapview)

selectMap(
leaflet(breweries91) %>%
addTiles() %>%
Expand All @@ -58,10 +81,15 @@ We can interactively CRD (create, update, delete) features on a map with `editMa

### Code of Conduct

Please note that this project is released with a [Contributor Code of Conduct](CONDUCT.md). By participating in this project you agree to abide by its terms.
Please note that this project is released with a [Contributor Code of
Conduct](CONDUCT.md). By participating in this project you agree to
abide by its terms.

### Acknowledgment

This project has been realized with financial [support](https://www.r-consortium.org/projects) from the
This project has been realized with financial
[support](https://www.r-consortium.org/projects) from the

<a href="https://www.r-consortium.org/projects/awarded-projects"> <img src="http://pebesma.staff.ifgi.de/RConsortium_Horizontal_Pantone.png" width="400"> </a>
<a href="https://www.r-consortium.org/projects/awarded-projects">
<img src="http://pebesma.staff.ifgi.de/RConsortium_Horizontal_Pantone.png" width="400">
</a>
12 changes: 9 additions & 3 deletions man/drawFeatures.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 13 additions & 4 deletions man/editFeatures.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 27 additions & 10 deletions man/editMap.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 12 additions & 3 deletions man/editMod.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/mapedit-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 11 additions & 4 deletions man/selectFeatures.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 9 additions & 4 deletions man/selectMap.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 326ae05

Please sign in to comment.