trafficonese / leaflet.extras

Extra functionality for leaflet R package.
https://trafficonese.github.io/leaflet.extras/
GNU General Public License v3.0
213 stars 74 forks source link

wish: leaflet.RotatedMarker #72

Open rickyars opened 7 years ago

rickyars commented 7 years ago

Plugin for leaflet that enables rotation of marker icons in Leaflet: https://github.com/bbecquet/Leaflet.RotatedMarker

bhaskarvk commented 7 years ago

The latest leaflet has rotateIcon support for awesomeIcons. https://github.com/rstudio/leaflet/blob/master/R/plugin-awesomeMarkers.R#L131 Will that work ?

rickyars commented 7 years ago

Hmmm, I guess I was too quick to reply. When you said leaflet I thought you meant the javascript library and not the R package. I tested out iconRotate and it does rotate the icon, not the teardrop. Is there any way to remove the teardrop from an awesome marker? I only want to see the icon - not the marker.

bhaskarvk commented 7 years ago

Yeah I think it should be possible with something like

addLabelOnlyMarkers(lat, lng, options=labelOptions(style="transform: rotate(90deg);"))

You may also need to add browser specific styles. See https://github.com/rstudio/leaflet/blob/master/inst/htmlwidgets/plugins/Leaflet.awesome-markers/leaflet.awesome-markers.js#L91 for how it's done.