diff --git a/.Rbuildignore b/.Rbuildignore
index c654bc4..2c370dc 100644
--- a/.Rbuildignore
+++ b/.Rbuildignore
@@ -4,4 +4,3 @@
^README-.*\.png$
^inst/examples
^docs/
-
diff --git a/DESCRIPTION b/DESCRIPTION
index 2c88498..3321642 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -29,4 +29,4 @@ Suggests:
memoise
URL: https://github.com/bhaskarvk/leaflet.esri
BugReports: https://github.com/bhaskarvk/leaflet.esri/issues
-RoxygenNote: 5.0.1
+RoxygenNote: 6.0.0
diff --git a/LICENSE b/LICENSE
index 6d3688c..3a1777e 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,2 +1,2 @@
-YEAR: 2016
+YEAR: 2016-2017
COPYRIGHT HOLDER: Bhaskar V. Karambelkar
diff --git a/NAMESPACE b/NAMESPACE
index 91db4af..26838ea 100644
--- a/NAMESPACE
+++ b/NAMESPACE
@@ -8,12 +8,14 @@ export(addEsriFeatureLayer)
export(addEsriGeocoderDependency)
export(addEsriHeatmapDependency)
export(addEsriHeatmapFeatureLayer)
+export(addEsriImageMapLayer)
export(addEsriRenderersDependency)
export(addEsriTiledMapLayer)
export(dynamicMapLayerOptions)
export(esriBasemapLabels)
export(esriBasemapLayers)
export(featureLayerOptions)
+export(imageMapLayerOptions)
export(tiledMapLayerOptions)
import(leaflet)
import(leaflet.extras)
diff --git a/NEWS.md b/NEWS.md
index 75c9bbd..7ec67e9 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,11 +1,19 @@
# leaflet.esri 0.1.3
-* Support for DynamicMapLayer and ImageMapLayer
+## Major changes
+
+- Support for DynamicMapLayer
+- Support for ImageMapLayer
# leaflet.esri 0.1.2
-* Support for FeatureLayer & TiledMapLayer.
+## Major changes
+
+- Support for FeatureLayer
+- Support for TiledMapLayer
# leaflet.esri 0.1.0
-* Initial Release with Esri basemap layers support.
\ No newline at end of file
+## Major changes
+
+- Initial Release with Esri basemap layers support
diff --git a/R/dynamicMapLayers.R b/R/dynamicMapLayers.R
index 3ab72ac..2f953a6 100644
--- a/R/dynamicMapLayers.R
+++ b/R/dynamicMapLayers.R
@@ -60,8 +60,8 @@ dynamicMapLayerOptions <- function(
#' identifying features and more.
#' Also supports custom popups and identification of features.
#' @param map The leaflet map
-#' @param url URL of the \href{http://resources.arcgis.com/en/help/arcgis-rest-api/#/Map_Service/02r3000000w2000000}{Map Service} with a tile cache.
-#' @param options options for the tiledmap layer.
+#' @param url URL of the \href{http://resources.arcgis.com/en/help/arcgis-rest-api/#/Map_Service/02r3000000w2000000/}{Map Service}.
+#' @param options options for the dynamic map layer.
#' @param popupFunction Uses the provided function to create a popup that will
#' identify features whenever the map is clicked.
#' Your function will be passed a GeoJSON FeatureCollection of the features
diff --git a/R/featureLayers.R b/R/featureLayers.R
index 19e7904..d50ab75 100644
--- a/R/featureLayers.R
+++ b/R/featureLayers.R
@@ -182,8 +182,8 @@ addEsriFeatureLayer <- function(
}
}
- invokeMethod(
- map, getMapData(map), 'addEsriFeatureLayer', url, options, layerId, group,
+ leaflet::invokeMethod(
+ map, leaflet::getMapData(map), 'addEsriFeatureLayer', url, options, layerId, group,
markerType, markerIcons,
markerIconProperty, markerOptions, markerIconFunction,
clusterOptions, clusterId,
@@ -209,6 +209,7 @@ addEsriHeatmapFeatureLayer <- function(
radius = radius,
gradient = gradient
)))
- invokeMethod(
- map, getMapData(map), 'addEsriHeatmapFeatureLayer', url, layerId, group, options)
+ leaflet::invokeMethod(
+ map, leaflet::getMapData(map),
+ 'addEsriHeatmapFeatureLayer', url, layerId, group, options)
}
\ No newline at end of file
diff --git a/R/imageMapLayers.R b/R/imageMapLayers.R
new file mode 100644
index 0000000..8b72139
--- /dev/null
+++ b/R/imageMapLayers.R
@@ -0,0 +1,96 @@
+#' Options for image map layer.
+#'
+#' @param format Output format of the image.
+#' @param f Server response content type.
+#' @param opacity Opacity of the layer. Should be a value between 0 and 1.
+#' @param position Position of the layer relative to other overlays.
+#' @param maxZoom Closest zoom level the layer will be displayed on the map.
+#' @param minZoom Furthest zoom level the layer will be displayed on the map.
+#' @param from Date When paired with to defines the time range of data to display.
+#' Requires the Image Layer to be time enabled.
+#' @param to Date When paired with from defines the time range of data to display.
+#' Requires the Image Layer to be time enabled.
+#' @param bandIds If there are multiple bands, you can specify which bands to export.
+#' @param noData The pixel value representing no information.
+#' @param noDataInterpretation Interpretation of the noData setting.
+#' @param pixelType Leave pixelType as unspecified, or UNKNOWN, in most exportImage use cases,
+#' unless such pixelType is desired.
+#' Possible values: C128, C64, F32, F64, S16, S32, S8, U1, U16, U2, U32, U4, U8, UNKNOWN.
+#' @param renderingRule A JSON representation of a \href{http://resources.arcgis.com/en/help/arcgis-rest-api/#/Raster_function_objects/02r3000000rv000000/}{raster function}
+#' @param mosaicRule A JSON representation of a \href{http://resources.arcgis.com/en/help/arcgis-rest-api/#/Mosaic_rule_objects/02r3000000s4000000/}{mosaic rule}
+#' @param token If you pass a token in your options it will be included in all requests to the service.
+#' @param proxy URL of an \href{https://developers.arcgis.com/javascript/jshelp/ags_proxy.html}{ArcGIS API for JavaScript proxy} or \href{https://github.com/Esri/resource-proxy}{ArcGIS Resource Proxy} to use for proxying requests.
+#' @param useCors If this service should use CORS when making GET requests.
+#' @param ... extra options
+#' @export
+imageMapLayerOptions <- function(
+ format = 'jpgpng',
+ f = 'json',
+ opacity = 1,
+ position = 'front',
+ maxZoom = NULL,
+ minZoom = NULL,
+ from = NULL,
+ to = NULL,
+ bandIds = NULL,
+ noData = NULL,
+ noDataInterpretation = NULL,
+ pixelType = NULL,
+ renderingRule = NULL,
+ mosaicRule = NULL,
+ token = NULL,
+ proxy = NULL,
+ useCors = TRUE,
+ ...
+) {
+ leaflet::filterNULL(list(
+ format = format,
+ f = f,
+ opacity = opacity,
+ position = position,
+ maxZoom = maxZoom,
+ minZoom = minZoom,
+ from = from,
+ to = to,
+ bandIds = bandIds,
+ noData = noData,
+ noDataInterpretation = noDataInterpretation,
+ pixelType = pixelType,
+ renderingRule = renderingRule,
+ mosaicRule = mosaicRule,
+ token = token,
+ proxy = proxy,
+ useCors = useCors,
+ ...
+ ))
+}
+
+#' Render and visualize Image Services from ArcGIS Online and ArcGIS Server.
+#'
+#' Image Services provide access to raster data through a web service.
+#' @param map The leaflet map
+#' @param url URL of the \href{http://resources.arcgis.com/en/help/arcgis-rest-api/#/Image_Service/02r3000000q8000000/}{Image Service}
+#' @param options options for the image map layer.
+#' @param popupFunction Uses the provided function to create a popup that will
+#' identify features whenever the map is clicked.
+#' Your function will be passed a GeoJSON FeatureCollection of the features
+#' at the clicked location and should return the appropriate HTML.
+#' If you do not want to open the popup when there are no results, return false.
+#' @param popupOptions See \code{\link[leaflet]{popupOptions}}.
+#' @param layerId A unique ID for the layer.
+#' @param group The name of the group this layer should be added to.
+#' @export
+addEsriImageMapLayer <- function(
+ map, url,
+ options = imageMapLayerOptions(),
+ popupFunction = NULL, popupOptions = NULL,
+ layerId = NULL, group = NULL) {
+ map <- addEsriDependency(map)
+ if(is.null(options)) {
+ options <- list()
+ }
+ leaflet::invokeMethod(
+ map, leaflet::getMapData(map),
+ 'addEsriImageMapLayer', url, layerId, group,
+ options, popupFunction, popupOptions)
+}
diff --git a/R/leaflet.esri-package.r b/R/leaflet.esri-package.r
index 3d85e6b..9a759c4 100644
--- a/R/leaflet.esri-package.r
+++ b/R/leaflet.esri-package.r
@@ -5,4 +5,5 @@
#'
#' @name leaflet.esri
#' @docType package
+#' @author Bhaskar V. Karambelkar
NULL
diff --git a/README.Rmd b/README.Rmd
index 651b42d..ee44154 100644
--- a/README.Rmd
+++ b/README.Rmd
@@ -10,17 +10,20 @@ ESRI bindings for the [leaflet](https://www.github.com/rstudio/leaflet) package,
**Compatibility Matrix**
+As of Feb, 2017 the leaflet R package is based on version 0.7.7 of the Leaflet Javascript library and therefore the leaflet.esri package is based on version 1.0.4 of esri-leaflet Jaascript library which is the last release compatible with the 0.7.x branch of Leaflet JS.
+The chart below shows more details.
+
| Leaflet JS ver. | R Leaflet pkg ver. | esri-leaflet JS Plugin ver. | R leaflet.esri pkg ver.|
| --------------- | ------------------ | --------------------------- | -------------------- |
| [0.7.x](https://github.com/Leaflet/Leaflet/releases/tag/v0.7.7) | [1.1](https://github.com/rstudio/leaflet) 1 | [1.0.4](https://github.com/Esri/esri-leaflet/releases/tag/v1.0.4) | 0.1.x |
| [1.x](https://github.com/Leaflet/Leaflet/releases/tag/v1.0.1) | ? 2 | [2.x](https://github.com/Esri/esri-leaflet/releases/tag/v2.0.4) | ? |
-1 - Release 1.1 of the leaflet package should hit CRAN very soon, for now `devtools::install_github('rstudio/leaflet')`.
+1 - Release 1.1 of the leaflet package should hit CRAN very soon, but for now `devtools::install_github('rstudio/leaflet')`.
2 - The R package has not yet been proted to Leaflet JS 1.x
### Features Tracking
-**NOTE** It may not be possible to implement each and every feature and the documentation will be updated accordingly. Each feature which is implemented has a tick mark (✔️) next to it. Any description you find in this section is directly taken from the esri-leaflt [API reference](https://esri.github.io/esri-leaflet/api-reference/).
+**NOTE** It may not be possible to implement each and every feature and if so the documentation will be updated accordingly. Each feature which is implemented has a tick mark (✔️) next to it. Any description you find in this section is directly taken from the esri-leaflt [API reference](https://esri.github.io/esri-leaflet/api-reference/).
#### Authentication Support
@@ -33,7 +36,7 @@ ESRI bindings for the [leaflet](https://www.github.com/rstudio/leaflet) package,
Layers provide visualization capabilities for data hosted in Feature Services, Map Services and Image Services.
- [Basemap Layer](https://esri.github.io/esri-leaflet/api-reference/layers/basemap-layer.html) ✔️
-- [Feature Layer](https://esri.github.io/esri-leaflet/api-reference/layers/feature-layer.html) - IN Progress
+- [Feature Layer](https://esri.github.io/esri-leaflet/api-reference/layers/feature-layer.html) - ✔️ (Except for Edit Features)
- Labels ✔️
- Popups ✔️
- Markers w/ Icons ✔️
@@ -44,8 +47,7 @@ Layers provide visualization capabilities for data hosted in Feature Services, M
- [Cluster Feature Layer](https://esri.github.io/esri-leaflet/api-reference/layers/clustered-feature-layer.html) ✔️
- [Heat Feature Layer](https://esri.github.io/esri-leaflet/api-reference/layers/heatmap-feature-layer.html) ✔️
- [Dynamic Map Layer](https://esri.github.io/esri-leaflet/api-reference/layers/dynamic-map-layer.html) ✔️
-- [Image Map Layer](https://esri.github.io/esri-leaflet/api-reference/layers/image-map-layer.html)
-- [Raster Layer](https://esri.github.io/esri-leaflet/api-reference/layers/raster-layer.html)
+- [Image Map Layer](https://esri.github.io/esri-leaflet/api-reference/layers/image-map-layer.html) ✔️
- [Tiled Map Layer](https://esri.github.io/esri-leaflet/api-reference/layers/tiled-map-layer.html) ✔️
- ~~[Vector Basemap](https://esri.github.io/esri-leaflet/api-reference/layers/vector-basemap.html)~~ Cannot be supported for now as this requires leaflet 1.x.
- [~~Vector Layer~~](https://esri.github.io/esri-leaflet/api-reference/layers/vector-layer.html) Cannot be supported for now as this requires leaflet 1.x.
@@ -58,10 +60,10 @@ Layers provide visualization capabilities for data hosted in Feature Services, M
Tasks are wrappers for commonly used API methods on ArcGIS services. They expose commonly used parameters to make them more accessible to Leaflet.
-- [Query](https://esri.github.io/esri-leaflet/api-reference/tasks/query.html)
-- [Find](https://esri.github.io/esri-leaflet/api-reference/tasks/find.html)
-- [IdentifyFeatures](https://esri.github.io/esri-leaflet/api-reference/tasks/identify-features.html)
-- [IdentifyImage](https://esri.github.io/esri-leaflet/api-reference/tasks/identify-image.html)
+- [Query](https://esri.github.io/esri-leaflet/api-reference/tasks/query.html) ✔️
+- [Find](https://esri.github.io/esri-leaflet/api-reference/tasks/find.html) ✔️
+- [IdentifyFeatures](https://esri.github.io/esri-leaflet/api-reference/tasks/identify-features.html) ✔️
+- [IdentifyImage](https://esri.github.io/esri-leaflet/api-reference/tasks/identify-image.html) ✔️
- [Geocode](https://esri.github.io/esri-leaflet/api-reference/tasks/geocode.html)
- [Reverse Geocode](https://esri.github.io/esri-leaflet/api-reference/tasks/reverse-geocode.html)
- [Suggest](https://esri.github.io/esri-leaflet/api-reference/tasks/suggest.html)
@@ -70,14 +72,13 @@ Tasks are wrappers for commonly used API methods on ArcGIS services. They expose
#### Events
-[Event](https://esri.github.io/esri-leaflet/api-reference/events.html) types common across components of Esri Leaflet.
+[Event](https://esri.github.io/esri-leaflet/api-reference/events.html) types common across components of Esri Leaflet. ✔️
- loading
- load
- createfeature
- removefeature
- addfeature
-- ???
### License
diff --git a/README.md b/README.md
index 891e706..2b0b351 100644
--- a/README.md
+++ b/README.md
@@ -7,6 +7,8 @@ ESRI bindings for the [leaflet](https://www.github.com/rstudio/leaflet) package,
**Compatibility Matrix**
+As of Feb, 2017 the leaflet R package is based on version 0.7.7 of the Leaflet Javascript library and therefore the leaflet.esri package is based on version 1.0.4 of esri-leaflet Jaascript library which is the last release compatible with the 0.7.x branch of Leaflet JS. The chart below shows more details.
+
addEsriBasemapLayer(map, key, autoLabels = FALSE, layerId = NULL, - group = NULL, options = NULL)- -
tileOptions()
.Adds a ArcGIS Basemap layer
- --## Not run: ------------------------------------ -# leaflet() %>% -# addEsriBasemapLayer(esriBasemapLayers$Oceans, autoLabels=TRUE) -## ---------------------------------------------
addEsriDynamicMapLayer(map, url, options = dynamicMapLayerOptions(), - layerId = NULL, group = NULL)- -
popupOptions
.Map Services are a way to expose the contents of a map as a web service and -expose capabilities for exporting tile images, querying and -identifying features and more. -Also supports custom popups and identification of features.
- -addEsriFeatureLayer(map, url, useServiceSymbology = FALSE, - options = featureLayerOptions(), layerId = NULL, group = NULL, - markerType = NULL, markerIcons = NULL, markerIconProperty = NULL, - markerOptions = leaflet::markerOptions(), clusterOptions = NULL, - clusterId = NULL, labelProperty = NULL, - labelOptions = leaflet::labelOptions(), popupProperty = NULL, - popupOptions = leaflet::popupOptions(), stroke = TRUE, color = "#03F", - weight = 5, opacity = 0.5, fill = TRUE, fillColor = color, - fillOpacity = 0.2, dashArray = NULL, smoothFactor = 1, noClip = FALSE, - pathOptions = leaflet::pathOptions(), highlightOptions = NULL, - fitBounds = FALSE)- -
addTiles
)markerIcons
.
-In either case the result must be one of the indexes of markerIcons.makeIcon
-or a list of markers using iconList
NULL
, markers will be clustered using
-Leaflet.markercluster;
- you can use markerClusterOptions()
to specify marker cluster
-optionslabelOptions
to provide label
-options for each label. Default NULL
popupOptions
to provide popupshighlightOptions()
to specify highlightFeatureLayer is used to visualize, style, query and edit vector geographic data hosted in both ArcGIS Online and published using ArcGIS Server. Copyright text from the service is added to map attribution automatically.
- -addEsriHeatmapFeatureLayer(map, url, radius = 25, gradient = NULL, - options = featureLayerOptions(), layerId = NULL, group = NULL)- -
Add Esri Heatmap Feature Layer.
- -addEsriTiledMapLayer(map, url, options = tiledMapLayerOptions(), - layerId = NULL, group = NULL)- -
If you have published a Feature Service in ArcGIS Online, it can be used to create a static set of tiles as well. You can find details about that process in the ArcGIS Online Help. -Your map service must be published using the Web Mercator Auxiliary Sphere tiling scheme (WKID 102100/3857) and the default scale options used by Google Maps, Bing Maps and ArcGIS Online. Esri Leaflet will not support any other spatial reference for tile layers.
- -dynamicMapLayerOptions(format = "png24", transparent = TRUE, f = "json", - attribution = "", layers = NULL, layerDefs = NULL, opacity = 1, - position = "front", maxZoom = NULL, minZoom = NULL, - dynamicLayers = NULL, token = NULL, proxy = NULL, useCors = TRUE, ...)- -
Options for dynamic map layer.
- -esriBasemapLayers - -esriBaseMapLabels - -addEsriBaseMapLayer(map, key, autoLabels = FALSE, layerId = NULL, - group = NULL, options = list())- -
An object of class list
of length 9.
Esri Basemap Layers. -basemapLayer is used to display Esri hosted basemaps and attributes data providers appropriately. The Terms of Use for Esri hosted services apply to all Leaflet applications. -Taken from https://esri.github.io/esri-leaflet/api-reference/layers/basemap-layer.html.
- -Esri basemap labels. -Taken from https://esri.github.io/esri-leaflet/api-reference/layers/basemap-layer.html#optional-labels.
- -Adds a ArcGIS Basemap layer
- --## Not run: ------------------------------------ -# leaflet() %>% -# addEsriBaseMapLayer(esriBaseMapLayers$Oceans, autoLabels=TRUE) -## ---------------------------------------------
addEsriDependency(map) - -addEsriClusterDependency(map) - -addEsriGeocoderDependency(map) - -addEsriHeatmapDependency(map) - -addEsriRenderersDependency(map)- -
Adds esri-leaflet dependency to the leaflet widget
- -Adds esri-leaflet-clustered-feature-layer dependency to the leaflet widget
- -Adds esri-leaflet-geocoder dependency to the leaflet widget
- -Adds esri-leaflet-heatmap dependency to the leaflet widget
- -Adds esri-leaflet-renderers dependency to the leaflet widget
- -featureLayerOptions() - -addEsriFeatureLayer(map, url, useServiceSymbology = FALSE, - popupFunction = NULL, popupOptions = leaflet::popupOptions(), - layerId = NULL, group = NULL, options = featureLayerOptions())- -
Options for featureLayers
- -Adds an ArcGIS Feature Layer. -FeatureLayer is used to visualize, style, query and edit vector geographic data hosted in both ArcGIS Online and published using ArcGIS Server. Copyright text from the service is added to map attribution automatically.
- -esriBasemapLabels
-
- An object of class list
of length 7.
Taken from https://esri.github.io/esri-leaflet/api-reference/layers/basemap-layer.html#optional-labels.
- -esriBasemapLayers
-
- An object of class list
of length 9.
BasemapLayer is used to display Esri hosted basemaps and attributes data providers appropriately. The Terms of Use for Esri hosted services apply to all Leaflet applications. -Taken from https://esri.github.io/esri-leaflet/api-reference/layers/basemap-layer.html.
- -featureLayerOptions(where = NULL, minZoom = NULL, maxZoom = NULL, - cacheLayers = NULL, fields = NULL, from = NULL, to = NULL, - timeField = NULL, timeFilterMode = NULL, simplifyFactor = NULL, - precision = NULL, token = NULL, proxy = NULL, useCors = NULL, - renderer = NULL, ...)- -
Options for featureLayers.
- -