Comments (12)
@lbusett I think we can close this, given that addExtent
, addStaticLabels
as well as addStarsImage
and addRasterRGB
are now in leafem.
Please re-open if you disagree
from leafem.
Hi @lbusett
yes, I am aware of those but didn't deem them to be very important. I was planning on moving those for the next release.
I would appreciate a PR. I'm currently at useR!2019 and won't have too much time to work on those.
I agree, addStarsImage()
should be taken care of in #1
from leafem.
Ok. I'll start looking into this and let you know.
from leafem.
Thanks!
from leafem.
Hi @tim-salabim
currentlly working on this. Migrating the add
functions is not difficult. However, I wanted to ask you how you would like to proceed with the helpers: for example, to migrate addStaticLabels
, I would need to migrate or replicate also helper functions such as checkAdjustProjection
, makelabels
, getLayerNamesFromMap
, getGeometryType
.
What is your take on this?
from leafem.
I remember that this was one of the reasons that made me skip migrating addStaticLabels
. I guess the sane thing to do is to migrate these functions from mapview to leafem as we import it in mapview anyway. What do you think?
from leafem.
Makes sense to me. Having them duplicated between the two could generate confusion in the long run, IMO.
I could put all the "required" functions within utils.R
, check where they are called within mapview
and substitute with a leafem::
construct.
However, I noticed that utils.R
already contains several "helper" functions duplicated between the two packages (e.g., combineExtent, getLayerControlEntriesFromMap, getGeometryType and others wihtin utils.R
). Is your idea to eliminate all duplicates? (that would require a more careful job of function-call hunting)
from leafem.
Well spotted! Yes, my approach was to split out and duplicate all that it is needed first to make sure that everything works and then eventually (when things are stable) to address code completion. In the light of this, we could also just duplicate things for now and then I will use a dedicated development cycle to rid all packages of duplicates. Given that this involves some 6 packages, I think this may just be the easiest to do. So I would suggest not to worry about duplication, just make sure all helpers needed are in leafem.
Is that OK for you?
from leafem.
Ok for me. I'll put everything needed in utils.R, then (I guess no worries about shadowing, because I think that none of the helpers is exported) .
One further question: I was also considering mofifyng addFeatures
and addStsticLabels
so that they can be used in a leaflet pipe without specifying the data
argument, such as in:
indata <- sf::st_read(system.file("shape/nc.shp", package="sf"))
leaflet(indata) %>%
addFeatures() %>%
addStaticLabels()
would you be ok with that change?
from leafem.
Yes, that would be great. In case you find any other cases that should be modified this way, feel free to change those too. And please also add yourself to the DESCRIPTION as an author!
from leafem.
I tried a "coupled" PR on leafem and mapview to move functions and implement some additional changes. I tested as best as I could, and commented on changes I wasn't sure about.
HTH!
from leafem.
Works for me. Thanks.
from leafem.
Related Issues (20)
- Feature request (addLogo): ability to change logo depending on selected baselayer HOT 5
- Rendering Two Different Logos according to Input in Shiny HOT 5
- Installation fails on R 4.1.2 HOT 6
- addGeotiff unable to make NA values transparent HOT 2
- Edit label in addFgb HOT 3
- Transparency not working with addGeotiff and colorOptions HOT 6
- When using addGeoRaster viridis color palette, how do you create a matching legend? HOT 2
- How to remove GeoRaster when using shiny/leafletproxy?
- segmentation fault during installation (Ubuntu 20.04.2, R 4.1.3) HOT 7
- pane option for addStarsImage HOT 7
- COG and addRasterRGB HOT 3
- addCOG does not show the layer HOT 6
- Change to new cran checks badge URL HOT 1
- Shapes added with `addFgb` don't register click events in R Shiny HOT 1
- addCOG HOT 1
- footnotes HOT 6
- Could addRasterRGB support SpatRaster class object HOT 1
- [feature request] addImageQuery functionality with SpatRast
- check error with _R_CHECK_FORCE_SUGGESTS_=false _R_CHECK_DEPENDS_ONLY_=true HOT 7
- Interactive option for leaflet doesn't' seem to work for flatgeobuf files HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from leafem.