Created
March 24, 2021 08:04
-
-
Save ColinFay/2d2a489947a3708c288ecdb546c9df1f to your computer and use it in GitHub Desktop.
html_template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"/> | |
<style>body{background-color:white;}</style> | |
</head> | |
<html> | |
<head> | |
<title>Title</title> | |
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" | |
integrity="sha512-xodZBNTC5n17Xt2atTPuE1HxjVMSvLVW9ocqUKLsCC5CXdbqCmblAshOMAS6/keqq/sMZMZ19scR4PsZChSR7A==" | |
crossorigin=""/> | |
<script src="https://unpkg.com/[email protected]/dist/leaflet.js" | |
integrity="sha512-XQoYMqMTK8LvdxXYG3nZ448hOEQiglfqkJs1NOQV44cWnUrBc8PkAOcXy20w0vlaXaVUearIOBhiXZ5V3ynxwA==" | |
crossorigin=""></script> | |
</head> | |
<body> | |
<style> | |
#mapid { height: 180px; } | |
</style> | |
<div id="mapid"></div> | |
<script> | |
var mymap = L.map('mapid').setView([51.505, -0.09], 13); | |
var polygon = L.polygon([[51.509,-0.08],[51.503,-0.06],[51.51,-0.047]]).addTo(mymap); | |
</script> | |
</body> | |
</html> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(magrittr) | |
list( | |
c(51.509, -0.08), | |
c(51.503, -0.06), | |
c(51.51, -0.047) | |
) %>% | |
jsonlite::toJSON() %>% | |
htmltools::htmlTemplate( | |
"template.html", | |
polygons = . | |
) %>% | |
htmltools::save_html("filled_template.html") | |
browseURL("filled_template.html") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Title</title> | |
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" | |
integrity="sha512-xodZBNTC5n17Xt2atTPuE1HxjVMSvLVW9ocqUKLsCC5CXdbqCmblAshOMAS6/keqq/sMZMZ19scR4PsZChSR7A==" | |
crossorigin=""/> | |
<script src="https://unpkg.com/[email protected]/dist/leaflet.js" | |
integrity="sha512-XQoYMqMTK8LvdxXYG3nZ448hOEQiglfqkJs1NOQV44cWnUrBc8PkAOcXy20w0vlaXaVUearIOBhiXZ5V3ynxwA==" | |
crossorigin=""></script> | |
</head> | |
<body> | |
<style> | |
#mapid { height: 180px; } | |
</style> | |
<div id="mapid"></div> | |
<script> | |
var mymap = L.map('mapid').setView([51.505, -0.09], 13); | |
var polygon = L.polygon({{polygons}}).addTo(mymap); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment