diff --git a/examples/earthquakes.R b/examples/layers.R similarity index 91% rename from examples/earthquakes.R rename to examples/layers.R index 0c579ac..6d2a3f1 100644 --- a/examples/earthquakes.R +++ b/examples/layers.R @@ -5,7 +5,7 @@ earthquakes_source <- list( data = "https://docs.mapbox.com/mapbox-gl-js/assets/earthquakes.geojson" ) -earthquakes_layer <- layer( +earthquakes_layer <- Layer( id = "earthquakes", type = "circle", source = earthquakes_source, @@ -14,3 +14,5 @@ earthquakes_layer <- layer( maplibre() |> add_layer(earthquakes_layer) + + diff --git a/examples/markers.R b/examples/markers.R new file mode 100644 index 0000000..13cb1e3 --- /dev/null +++ b/examples/markers.R @@ -0,0 +1,9 @@ +library(maplibre) +marker = Marker( + lngLat = c(9.5,51.31667), + popup = list(text = "This is a marker",options = list(closeButton = F)), + color= "darkred" +) + +maplibre(mapOptions(center = c(9.5,51.31667)),zoom = 4) |> + add_marker(marker) diff --git a/man/Marker.Rd b/man/Marker.Rd new file mode 100644 index 0000000..152aef8 --- /dev/null +++ b/man/Marker.Rd @@ -0,0 +1,21 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/marker.R +\name{Marker} +\alias{Marker} +\title{Create a Marker} +\usage{ +Marker(lngLat, popup, ...) +} +\description{ +Create a Marker +} +\examples{ +marker = Marker( + lngLat = c(9.5,51.31667), + popup = list(text = "This is a marker",options = list(closeButton = F)), + color= "darkred" +) + +maplibre(mapOptions(center = c(9.5,51.31667)),zoom = 4) |> + add_marker(marker) +} diff --git a/man/add_marker.Rd b/man/add_marker.Rd new file mode 100644 index 0000000..70cb38c --- /dev/null +++ b/man/add_marker.Rd @@ -0,0 +1,14 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/marker.R +\name{add_marker} +\alias{add_marker} +\title{Add a marker to map} +\usage{ +add_marker(.map, marker) +} +\arguments{ +\item{marker}{} +} +\description{ +Add a marker to map +} diff --git a/man/layer.Rd b/man/layer.Rd deleted file mode 100644 index 02ff37c..0000000 --- a/man/layer.Rd +++ /dev/null @@ -1,14 +0,0 @@ -% 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 2517299..974b048 100644 --- a/man/maplibre.Rd +++ b/man/maplibre.Rd @@ -6,7 +6,7 @@ \usage{ maplibre( map_options = mapOptions(), - width = NULL, + width = "100\%", height = NULL, elementId = NULL, ...