-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAssignment 1 - Creating Maps with Leaflet.Rmd
49 lines (32 loc) · 1.4 KB
/
Assignment 1 - Creating Maps with Leaflet.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
---
title: "Assignment 1 - Creating Maps Using Leaflet"
author: "Partha S. Ghose"
date: "4/19/2017"
output: ioslides_presentation
---
## Code for Map
```{r, echo=TRUE, eval = FALSE}
library("leaflet")
locs <- read.csv("locations_1.csv")
locs %>%
leaflet() %>%
addTiles() %>%
addCircleMarkers(~lng, ~lat, popup = ~as.character(names),
label = ~as.character(names), color = c("red", "red", "steelblue",
"darkgreen", "magenta", "purple"), fillColor = c("red", "red",
"steelblue","darkgreen", "magenta", "purple"),fillOpacity=0.6) %>%
addLegend("bottomright",labels = c("","Market Area", "Office",
"Monastery", "Rope Way Station", "Shopping Plaza"),
values = ~as.factor(locs$type), colors = c("", "red",
"steelblue","darkgreen", "magenta", "purple"))
```
## Map of Gangtok Town (Sikkim, India)
```{r, echo=FALSE}
library("leaflet")
locs <- read.csv("locations_1.csv")
locs %>%
leaflet() %>%
addTiles() %>%
addCircleMarkers(~lng, ~lat, popup = ~as.character(names), label = ~as.character(names), color = c("red", "red", "steelblue","darkgreen", "magenta", "purple"), fillColor = c("red", "red", "steelblue","darkgreen", "magenta", "purple"),fillOpacity=0.6) %>%
addLegend("bottomright",labels = c("","Market Area", "Office","Monastery", "Rope Way Station", "Shopping Plaza"), values = ~as.factor(locs$type), colors = c("", "red", "steelblue","darkgreen", "magenta", "purple"))
```