diff --git a/.Rbuildignore b/.Rbuildignore index e158d38..ae37304 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -4,3 +4,7 @@ ^.*\.Rproj$ ^\.Rproj\.user$ ^data-raw$ +^_pkgdown\.yml$ +^docs$ +^pkgdown$ +^LICENSE\.md$ diff --git a/.gitignore b/.gitignore index b469a11..6ac1d8c 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ .Rprofile renv archive +docs diff --git a/DESCRIPTION b/DESCRIPTION index 6645bed..8ff26f4 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,12 +1,14 @@ Package: maplibre Type: Package -Title: What the Package Does (Title Case) +Title: Provides R bindings for MapLibre GL JS Version: 0.1.0 -Author: Who wrote it -Maintainer: The package maintainer -Description: More about what it does (maybe more than one line) - Use four spaces when indenting paragraphs within the Description. -License: What license is it under? +Authors@R: c( + person("Nico", "Friess", email = "nico.friess@eoda.de", role = c("aut", "cre")), + person("Stefan", "Kuethe", email = "stefan.kuethe@eoda.de", role = c("aut", "cre")) + ) +Maintainer: Nico Friess +Description: Provides R bindings for MapLibre GL JS +License: MIT + file LICENSE Encoding: UTF-8 LazyData: true RoxygenNote: 7.2.3 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..a816715 --- /dev/null +++ b/LICENSE @@ -0,0 +1,2 @@ +YEAR: 2024 +COPYRIGHT HOLDER: maplibre authors diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..8e2882a --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,21 @@ +# MIT License + +Copyright (c) 2024 maplibre authors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/R/layer.R b/R/layer.R index 5c49b01..73536d0 100644 --- a/R/layer.R +++ b/R/layer.R @@ -1,3 +1,11 @@ +#' Create a layer +#' +#' @param type +#' @param id +#' @param source +#' @param paint +#' @param layout +#' #' @export layer <- function(type, id, source = NULL, paint = NULL, layout = NULL, ...) { list( @@ -10,6 +18,12 @@ layer <- function(type, id, source = NULL, paint = NULL, layout = NULL, ...) { purrr::compact() } + +#' Add a layer to map +#' +#' @param .map +#' @param layer +#' #' @export add_layer <- function(.map, layer) { .map |> add_call("addLayer", layer) diff --git a/_pkgdown.yml b/_pkgdown.yml new file mode 100644 index 0000000..d71acfb --- /dev/null +++ b/_pkgdown.yml @@ -0,0 +1,4 @@ +url: ~ +template: + bootstrap: 5 + diff --git a/man/add_layer.Rd b/man/add_layer.Rd new file mode 100644 index 0000000..024ff4b --- /dev/null +++ b/man/add_layer.Rd @@ -0,0 +1,14 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/layer.R +\name{add_layer} +\alias{add_layer} +\title{Add a layer to map} +\usage{ +add_layer(.map, layer) +} +\arguments{ +\item{layer}{} +} +\description{ +Add a layer to map +} diff --git a/man/layer.Rd b/man/layer.Rd new file mode 100644 index 0000000..02ff37c --- /dev/null +++ b/man/layer.Rd @@ -0,0 +1,14 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/layer.R +\name{layer} +\alias{layer} +\title{Create a layer} +\usage{ +layer(type, id, source = NULL, paint = NULL, layout = NULL, ...) +} +\arguments{ +\item{layout}{} +} +\description{ +Create a layer +} diff --git a/man/maplibre.Rd b/man/maplibre.Rd index 6e80ed6..ff1d48f 100644 --- a/man/maplibre.Rd +++ b/man/maplibre.Rd @@ -16,11 +16,13 @@ maplibre( } \examples{ -test <- mapOptions(center = c(-123.1256, 49.24658), - hash = TRUE, - pitch = 0, - style = basemaps$carto$dark_matter, - test = NULL) +test <- mapOptions( + center = c(-123.1256, 49.24658), + hash = TRUE, + pitch = 0, + style = basemaps$carto$dark_matter, + test = NULL +) maplibre(test, zoom = 12) |> - add_control("NavigationControl", "top-left", showCompass=F) + add_control("NavigationControl", "top-left", showCompass = F) }