myMap <- reactive({ return( leaflet(mls) %>% addControlFullScreen() %>% addProviderTiles("CartoDB.Positron", options = providerTileOptions(noWrap = TRUE)) %>% addDrawToolbar(polyline = FALSE, marker = FALSE) %>% addCircleMarkers( group = "marker", label = ~ mls$address, lat = ~ geo.latitude, lng = ~ geo.longitude, stroke = FALSE, fillOpacity = 0.5, color = "coral", radius = 5 ) %>% addSearchMarker("marker", position = "topleft", propertyName = "label") %>% addControlGPS() ) })
output$mymap <- renderLeaflet({ myMap() }) # A reactive expression that returns the set of mls locations that are in bounds right now mlsInBounds <- reactive({ if (is.null(input$mymap_bounds)) return(mls[FALSE, ]) bounds <- input$mymap_bounds latRng <- range(bounds$north, bounds$south) lngRng <- range(bounds$east, bounds$west) subset( mls, geo.latitude >= latRng[1] & geo.latitude <= latRng[2] & geo.longitude >= lngRng[1] & geo.longitude <= lngRng[2] ) }) output$scatterMlsMap <- renderPlot({ # If no listings are in view, don't plot if (nrow(mlsInBounds()) == 0) return(NULL) print( xyplot( floor.area.grand.total ~ list.price, data = mlsInBounds(), xlim = range(mls$floor.area.grand.total), ylim = range(mls$list.price) ) ) })--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shiny-discuss/adaa02f9-6dc8-45c3-90a2-7f018c7e809f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
On Thursday, June 9, 2016 at 12:05:00 PM UTC-7, Joe Cheng [RStudio] wrote:
That should work. Do you see any errors in your browser's JavaScript console?
--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shiny-discuss/c4c261e7-1d2a-4d5e-bd61-9afb93286d20%40googlegroups.com.