Browse Source

better base leaflet

Petra Lamborn 3 years ago
parent
commit
915d690143
1 changed files with 7 additions and 6 deletions
  1. 7
    6
      viz/app.R

+ 7
- 6
viz/app.R View File

@@ -2,16 +2,17 @@ library(shiny)
2 2
 library(leaflet)
3 3
 library(rgdal)
4 4
 
5
-sf <- readOGR(dsn="../shapefiles/sa20025WGSfil")
6
-crs <- leafletCRS(proj4def = sf@proj4string,
7
-                  bounds=sf@bbox)
8
-leaflet(sf) %>% addPolygons()
5
+sf <- readOGR(dsn="../shapefiles/sa20025WGSfilcth")
6
+leaflet(sf, options = leafletOptions(minZoom = 3, maxZoom = 13)) %>% 
7
+  addPolygons(color="#000", opacity = 1, weight=1,
8
+                            popup = sf@data$SA22018__1) %>%
9
+  setView(174, -41, 5)
9 10
 
10
-# Define UI for application that draws a histogram
11
+# Define UI
11 12
 ui <- fluidPage(
12 13
 )
13 14
 
14
-# Define server logic required to draw a histogram
15
+# Define server logic
15 16
 server <- function(input, output) {
16 17
 }
17 18