Permalink
Browse files

change tile provider

  • Loading branch information...
1 parent 197cded commit bf1a568616ddda510fe7c277a44a12e0fa63694b @blmoore committed Dec 22, 2015
Showing with 31 additions and 35 deletions.
  1. +1 −5 server.R
  2. +30 −30 ui.R
View
@@ -92,11 +92,7 @@ shinyServer(function(input, output, session) {
ax <- getData()
l <- leaflet(data=ax) %>%
- addTiles(urlTemplate="http://openmapsurfer.uni-hd.de/tiles/roadsg/x={x}&y={y}&z={z}",
- options=tileOptions(minZoom=10, maxZoom=17)) %>%
- addTiles('http://{s}.tile.openstreetmap.se/hydda/roads_and_labels/{z}/{x}/{y}.png',
- attribution='&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>',
- options=tileOptions(minZoom=10, maxZoom=17)) %>%
+ addProviderTiles("CartoDB.Positron", tileOptions(minZoom=10, maxZoom=17)) %>%
setView(lng=-3.19, lat=55.95, zoom=13) %>%
setMaxBounds(lng1=-5, lat1=55, lng2=-2, lat2=57)
View
@@ -7,68 +7,68 @@ library("leaflet")
shinyUI(navbarPage("Blackspot", id="nav", collapsible=T,
tabPanel("Map",
div(class="outer",
-
+
tags$head(
includeScript("analytics.js"),
tags$link(rel = "stylesheet", type = "text/css",
href = "ion.rangeSlider.skinFlat.css"),
includeScript("spin.min.js"),
includeCSS("styles.css")
),
-
+
leafletOutput("mymap", width="100%", height="100%"),
tags$script("
var spinner = new Spinner().spin();
$( 'div#mymap' ).append(spinner.el);"),
-
+
absolutePanel(id = "controls", class = "panel panel-default", fixed = TRUE,
draggable = TRUE, top = 100, left = "auto", right = 20, bottom = "auto",
width = 360, height = "auto",
-
+
h2(),
p(class="intro",
strong("Blackspot"), " shows vechicle collisions in",
- "the city of Edinburgh, UK. Data from",
- a("Edinburgh Open Data.",
+ "the city of Edinburgh, UK. Data from",
+ a("Edinburgh Open Data.",
href="http://www.edinburghopendata.info/dataset/vehicle-collisions",
target="_blank")),
-
+
tabsetPanel(
tabPanel("Controls",
-
+
dateRangeInput('dates',
label = 'Occurred between:',
start = as.Date("2010-01-01"), end = as.Date("2013-07-01")),
-
- selectInput("color", "Colour by:",
+
+ selectInput("color", "Colour by:",
choices=c("None", "Severity", "Casualties", "Time", "Vehicles", "Speed limit")),
-
+
sliderInput("alpha", label="Opacity:",
min=0, max=1, value=0.4, step=.025, ticks=T),
-
+
fluidRow(
column(6,
sliderInput("base", label="Point size:",
min=1, max=5, value=1)
),
-
- column(6,
- selectInput("scale", label="Scale by:", width=120,
+
+ column(6,
+ selectInput("scale", label="Scale by:", width=120,
selected="Vehicles",
choices=c("Casualties", "Vehicles"))#)
)
),
-
+
hr(class="thin"),
p("Under development by",
a("@benjaminlmoore", href="http://twitter.com/benjaminlmoore",
target="_blank"),
- HTML("&bull;"), "See the code on ",
+ HTML("&bull;"), "See the code on ",
a("github", href="http://github.com/blmoore/blackspot",
target="_blank"),
class="foot")
),
-
+
tabPanel("Graphs",
#p("Static plots"),
plotOutput("monthTotals", height = "110px"),
@@ -81,7 +81,7 @@ $( 'div#mymap' ).append(spinner.el);"),
p(class="topp", "Explore vehicle collisions recorded in Edinburgh",
"between 2010 and 2013 in this interactive data visualisation."
),
- p("Blackspot is written in ",
+ p("Blackspot is written in ",
a("Shiny,", href="http://shiny.rstudio.com/", target="_blank"),
"a web application framework for the R language.",
"Maps are built with ",
@@ -97,39 +97,39 @@ $( 'div#mymap' ).append(spinner.el);"),
a("@benjaminlmoore", href="http://twitter.com/benjaminlmoore",
target="_blank"),
HTML("&mdash;"),
- "see the full code on ",
+ "see the full code on ",
a("github", href="http://github.com/blmoore/blackspot",
target="_blank"),
"or run locally with:"
),
pre("shiny::runGitHub('blmoore/blackspot')"),
hr(class="thin")
- )
+ )
# end about panel
),
-
+
tags$script('
Shiny.addCustomMessageHandler("map_done",
function(s) {
spinner.stop();
$( "div#mymap" ).remove(spinner);
});')
-
+
),
-
+
# mobile panel
- div(class="mobile-panel",
+ div(class="mobile-panel",
p(strong("Blackspot"), " shows vechicle collisions in",
"the city of Edinburgh, UK. Written in R Shiny by",
a("@benjaminlmoore,", href="https://twitter.com/benjaminlmoore"),
"see the code on ",
a("github.", href="http://github.com/blmoore/blackspot"),
- "Data: ",
- a("Edinburgh Open Data.",
+ "Data: ",
+ a("Edinburgh Open Data.",
href="http://www.edinburghopendata.info/dataset/vehicle-collisions")),
-
+
hr(class="thin"),
-
+
radioButtons("color_mob", "Colour by:", inline=T,
choices=c("None", "Severity", "Casualties", "Time", "Vehicles", "Speed limit"))
)
@@ -138,4 +138,4 @@ $( 'div#mymap' ).append(spinner.el);"),
)
), tabPanel("Table", DT::dataTableOutput("table"))
)
-)
+)

0 comments on commit bf1a568

Please sign in to comment.