Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

assigned L.geoJson to var geojsonLayer for ability to resetStyle on mous... #317

Merged
merged 5 commits into from
Dec 22, 2013
Merged

Conversation

bbest
Copy link
Contributor

@bbest bbest commented Dec 17, 2013

Hi Ramanth,

Fantastic work with rCharts! Here's a very minor suggested tweak to your charts.R to enable mouseout style resetting similar to http://leafletjs.com/examples/choropleth.html, as demonstrated in line 51 of added example10.R. Hope this makes sense.

Thanks for your great work, Ben


// mouseout to resetHighlight
mouseout: function (e) {
geojsonLayer.resetStyle(e.target);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to assign L.geoJson to a variable in order to resetStyle

@ramnathv
Copy link
Owner

Thanks Ben. This looks terrific. Can you make the pull request to the dev branch of rCharts, since most development has been taking place on the dev branch? I plan to sync the two branches over the holidays.

…d javascript variable as the geoJson spec.features

otherwise takes way to long to round trip between R and javascript.
Added Shiny example app leaflet_chloropleth.
@bbest
Copy link
Contributor Author

bbest commented Dec 17, 2013

Hi Ramnath,

Thanks for your quick response. Here's another hacky tweak I did (added html_sub argument to renderMap) in order to preload a geojson variable and use that as the geoJson spec.features (by running a substitution from "features": "#! regions !#", to "features": regions,). See the inst/app/leaflet_chloropleth for an example Shiny app which should look like this:

leaflet_chloropleth_screenshot

I'm guessing there's a better way to handle this and open to suggestions. I'm happy to add this or an alternative option to the dev branch as well.

Thanks again!

@ramnathv
Copy link
Owner

That looks excellent! Let me take a closer look and then merge. Going forward I might be splitting rCharts into smaller packages. I am thinking of having an rChartsMaps package that consolidates all mapping related bindings, including Leaflet and DataMaps. Given your interest, it would be great if you can contribute.

Thanks again for providing very useful suggestions and implementing them.

@bbest
Copy link
Contributor Author

bbest commented Dec 17, 2013

Yes, will happily contribute, however you'd like to proceed.

bbest added a commit to bbest/ohigui that referenced this pull request Dec 17, 2013
in order to repeat a copy of the data layers when panning outside
initial globe extent (< -180, > 180). see all options at
http://leafletjs.com/reference.html#map-options
ramnathv added a commit that referenced this pull request Dec 22, 2013
assigned L.geoJson to var geojsonLayer for ability to resetStyle on mous...
@ramnathv ramnathv merged commit 8d6449e into ramnathv:master Dec 22, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants