

{"id":80,"date":"2016-09-08T22:10:47","date_gmt":"2016-09-08T20:10:47","guid":{"rendered":"http:\/\/blog.hwr-berlin.de\/codeandstats\/?p=80"},"modified":"2016-11-20T12:59:37","modified_gmt":"2016-11-20T11:59:37","slug":"offline-maps-with-rgooglemaps-and-leaflets","status":"publish","type":"post","link":"https:\/\/blog.hwr-berlin.de\/codeandstats\/offline-maps-with-rgooglemaps-and-leaflets\/","title":{"rendered":"Offline Maps with RgoogleMaps and leaflets"},"content":{"rendered":"<p><!DOCTYPE html><\/p>\n<p><html xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\"><\/p>\n<p><head><\/p>\n<p><meta charset=\"utf-8\"><br \/>\n<meta http-equiv=\"Content-Type\" content=\"text\/html; charset=utf-8\" \/><br \/>\n<meta name=\"generator\" content=\"pandoc\" \/><\/p>\n<p><meta name=\"author\" content=\"M Loecher\" \/><\/p>\n<p><title>Offline Maps with RgoogleMaps and leaflets<\/title><\/p>\n<p><script src=\"https:\/\/blog.hwr-berlin.de\/codeandstats\/wp-content\/uploads\/rmarkdown\/jquery-1.11.3\/jquery.min.js\"><\/script><br \/>\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" \/>\n<link href=\"https:\/\/blog.hwr-berlin.de\/codeandstats\/wp-content\/uploads\/rmarkdown\/bootstrap-3.3.5\/css\/bootstrap.min.css\" rel=\"stylesheet\" \/>\n<script src=\"https:\/\/blog.hwr-berlin.de\/codeandstats\/wp-content\/uploads\/rmarkdown\/bootstrap-3.3.5\/js\/bootstrap.min.js\"><\/script><br \/>\n<script src=\"https:\/\/blog.hwr-berlin.de\/codeandstats\/wp-content\/uploads\/rmarkdown\/bootstrap-3.3.5\/shim\/html5shiv.min.js\"><\/script><br \/>\n<script src=\"https:\/\/blog.hwr-berlin.de\/codeandstats\/wp-content\/uploads\/rmarkdown\/bootstrap-3.3.5\/shim\/respond.min.js\"><\/script><br \/>\n<script src=\"https:\/\/blog.hwr-berlin.de\/codeandstats\/wp-content\/uploads\/rmarkdown\/htmlwidgets-0.7\/htmlwidgets.js\"><\/script>\n<link href=\"https:\/\/blog.hwr-berlin.de\/codeandstats\/wp-content\/uploads\/rmarkdown\/leaflet-0.7.3\/leaflet.css\" rel=\"stylesheet\" \/>\n<script src=\"https:\/\/blog.hwr-berlin.de\/codeandstats\/wp-content\/uploads\/rmarkdown\/leaflet-0.7.3\/leaflet.js\"><\/script>\n<link href=\"https:\/\/blog.hwr-berlin.de\/codeandstats\/wp-content\/uploads\/rmarkdown\/leafletfix-1.0.0\/leafletfix.css\" rel=\"stylesheet\" \/>\n<script src=\"https:\/\/blog.hwr-berlin.de\/codeandstats\/wp-content\/uploads\/rmarkdown\/leaflet-binding-1.0.1\/leaflet.js\"><\/script><\/p>\n<style type=\"text\/css\">code{white-space: pre;}<\/style>\n<link rel=\"stylesheet\"\n      href=\"https:\/\/blog.hwr-berlin.de\/codeandstats\/wp-content\/uploads\/rmarkdown\/highlight\/default.css\"\n      type=\"text\/css\" \/><br \/>\n<script src=\"https:\/\/blog.hwr-berlin.de\/codeandstats\/wp-content\/uploads\/rmarkdown\/highlight\/highlight.js\"><\/script><\/p>\n<style type=\"text\/css\">\n  pre:not([class]) {\n    background-color: white;\n  }\n<\/style>\n<p><script type=\"text\/javascript\">\nif (window.hljs && document.readyState && document.readyState === \"complete\") {\n   window.setTimeout(function() {\n      hljs.initHighlighting();\n   }, 0);\n}\n<\/script><\/p>\n<style type=\"text\/css\">\nh1 {\n  font-size: 34px;\n}\nh1.title {\n  font-size: 38px;\n}\nh2 {\n  font-size: 30px;\n}\nh3 {\n  font-size: 24px;\n}\nh4 {\n  font-size: 18px;\n}\nh5 {\n  font-size: 16px;\n}\nh6 {\n  font-size: 12px;\n}\n.table th:not([align]) {\n  text-align: left;\n}\n<\/style>\n<p><\/head><\/p>\n<p><body><\/p>\n<style type = \"text\/css\">\n.main-container {\n  max-width: 940px;\n  margin-left: auto;\n  margin-right: auto;\n}\ncode {\n  color: inherit;\n  background-color: rgba(0, 0, 0, 0.04);\n}\nimg {\n  max-width:100%;\n  height: auto;\n}\n.tabbed-pane {\n  padding-top: 12px;\n}\nbutton.code-folding-btn:focus {\n  outline: none;\n}\n<\/style>\n<div class=\"container-fluid main-container\">\n<p><!-- tabsets --><br \/>\n<script src=\"https:\/\/blog.hwr-berlin.de\/codeandstats\/wp-content\/uploads\/rmarkdown\/navigation-1.1\/tabsets.js\"><\/script><br \/>\n<script>\n$(document).ready(function () {\n  window.buildTabsets(\"TOC\");\n});\n<\/script><\/p>\n<p><!-- code folding --><\/p>\n<div class=\"fluid-row\" id=\"header\">\n<h4 class=\"author\"><em>M Loecher<\/em><\/h4>\n<h4 class=\"date\"><em>7 September 2016<\/em><\/h4>\n<\/div>\n<div id=\"new-version-of-rgooglemaps-now-fetches-map-tiles\" class=\"section level3\">\n<h3>New version of RgoogleMaps now fetches map tiles<\/h3>\n<p>Until version 1.3.0 <em>RgoogleMaps<\/em> only downloaded static maps as provided by the static maps APIs from e.g.\u00a0Google, bing and OSM. While there are numerous advantages to this strategy such as full access to the extensive feature list provided by those APIs, the limitations are also clear:<\/p>\n<ol style=\"list-style-type: decimal\">\n<li>unlikely reusability of previously stored static maps,<\/li>\n<li>limits on the maximum size of the map (640,640),<\/li>\n<li>and the requirement to be online.<\/li>\n<\/ol>\n<p>Beginning with <a href=\"http:\/\/rgooglemaps.r-forge.r-project.org\/\">version 1.4.1<\/a> (which is now on <a href=\"https:\/\/cran.r-project.org\/web\/packages\/RgoogleMaps\/index.html\">CRAN<\/a> ) , we added the functions <em>GetMapTiles<\/em> and <em>PlotOnMapTiles<\/em> which fetch individual map tiles and store them locally.<\/p>\n<p>For example, if we wanted to fetch 20 tiles (in each direction) at zoom level 16 around Washington Square Park in Manhattan, we would simply run<\/p>\n<pre class=\"r\"><code>library(RgoogleMaps)\r\n(center=getGeoCode(&quot;Washington Square Park;NY&quot;))<\/code><\/pre>\n<pre><code>##       lat       lon \r\n##  40.73082 -73.99733<\/code><\/pre>\n<pre class=\"r\"><code>GetMapTiles(center, zoom=16,nTiles = c(20,20))<\/code><\/pre>\n<p>Note that the default server is taken to be <em>openstreetmap<\/em> and the default local directory &#8220;~\/mapTiles\/OSM&#8221;. We could have also passed the location string directly and saved several zoom levels at once (note the constant radius adaptation of the number of tiles):<\/p>\n<pre class=\"r\"><code>for (zoom in 13:15)\r\n  GetMapTiles(&quot;Washington Square Park;NY&quot;, zoom=zoom,nTiles = round(c(20,20)\/(17-zoom)))<\/code><\/pre>\n<p>Before requesting new tiles, the function checks if that map tile exists already which avoids redundant downloads.<\/p>\n<p>We can repeat the process with Google map tiles and plot them:<\/p>\n<pre class=\"r\"><code>for (zoom in 13:16)\r\n  GetMapTiles(&quot;Washington Square Park;NY&quot;, zoom=zoom,nTiles = round(c(20,20)\/(17-zoom)),\r\n              urlBase = &quot;http:\/\/mt1.google.com\/vt\/lyrs=m&quot;, tileDir= &quot;~\/mapTiles\/Google\/&quot;)\r\n\r\n#just get 3x3 tiles:\r\n\r\n#mt= GetMapTiles(center = c(lat = 40.73082, lon =-73.99733), zoom=16,nTiles = c(3,3), urlBase = &quot;http:\/\/mt1.google.com\/vt\/lyrs=m&quot;, tileDir= &quot;~\/mapTiles\/Google\/&quot;, returnTiles = TRUE)\r\n\r\nmt= GetMapTiles(&quot;Washington Square Park;NY&quot;, zoom=16,nTiles = c(3,3),\r\n              urlBase = &quot;http:\/\/mt1.google.com\/vt\/lyrs=m&quot;, tileDir= &quot;~\/mapTiles\/Google\/&quot;, returnTiles = TRUE)\r\nPlotOnMapTiles(mt)<\/code><\/pre>\n<p> <a href=\"http:\/\/blog.hwr-berlin.de\/codeandstats\/wp-content\/uploads\/2016\/09\/unnamed-chunk-3-1.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.hwr-berlin.de\/codeandstats\/wp-content\/uploads\/2016\/09\/unnamed-chunk-3-1.png\" alt=\"unnamed-chunk-3-1\" width=\"800\" height=\"800\" class=\"alignnone size-medium wp-image-104\" srcset=\"https:\/\/blog.hwr-berlin.de\/codeandstats\/wp-content\/uploads\/2016\/09\/unnamed-chunk-3-1.png 1920w, https:\/\/blog.hwr-berlin.de\/codeandstats\/wp-content\/uploads\/2016\/09\/unnamed-chunk-3-1-150x150.png 150w, https:\/\/blog.hwr-berlin.de\/codeandstats\/wp-content\/uploads\/2016\/09\/unnamed-chunk-3-1-300x300.png 300w, https:\/\/blog.hwr-berlin.de\/codeandstats\/wp-content\/uploads\/2016\/09\/unnamed-chunk-3-1-768x768.png 768w, https:\/\/blog.hwr-berlin.de\/codeandstats\/wp-content\/uploads\/2016\/09\/unnamed-chunk-3-1-1024x1024.png 1024w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/a><\/p>\n<\/div>\n<div id=\"interactive-web-maps-with-the-javascript-leaflet-library\" class=\"section level3\">\n<h3>Interactive Web Maps with the JavaScript \u2018Leaflet\u2019 Library<\/h3>\n<p>While the original motivation of <em>GetMapTiles<\/em> was to enable offline creation of static maps within the package <em>RgoogleMaps<\/em>, combining this feature with the interactivity of the <em>leaflet<\/em> library leads to an effective offline maps version of leaflet!<\/p>\n<p>We only need to replace the default server specified by the parameter <em>urlTemplate<\/em> by a local server obliging with the file naming scheme zoom_X_Y.png set by <em>GetMapTiles<\/em> Any simple local Web service will suffice, but the following two solutions work best for me<\/p>\n<ol style=\"list-style-type: decimal\">\n<li>\n<p>(<a href=\"http:\/\/stackoverflow.com\/questions\/5050851\/best-lightweight-web-server-only-static-content-for-windows\" class=\"uri\">http:\/\/stackoverflow.com\/questions\/5050851\/best-lightweight-web-server-only-static-content-for-windows<\/a>) \u201cTo use Python as a simple web server just change your working directory to the folder with your static content and type python -m SimpleHTTPServer 8000, everything in the directory will be available at <a href=\"http:\/localhost:8000\/\" class=\"uri\">http:\/localhost:8000\/<\/a>\u201d<\/p>\n<\/li>\n<li>\n<p>(<a href=\"https:\/\/github.com\/yihui\/servr\" class=\"uri\">https:\/\/github.com\/yihui\/servr<\/a>) Use the R package servr: Rscript -e \u2018servr::httd()\u2019 -p8000<\/p>\n<\/li>\n<\/ol>\n<p>So assuming (i) successful execution of the map tileabove and (ii) the correct launch of the server (in the parent dirtectory of <em>mapTiles\/<\/em>), the following code will have leaflet dynamically load them (from the local repository) for zooming and panning abilities:<\/p>\n<pre class=\"r\"><code>library(leaflet)\r\n  m = leaflet::leaflet() %&gt;% \r\n    addTiles( urlTemplate = &quot;http:\/localhost:8000\/mapTiles\/OSM\/{z}_{x}_{y}.png&quot;)\r\n  m = m %&gt;% leaflet::setView(-73.99733, 40.73082 , zoom = 16)\r\n  m = m %&gt;% leaflet::addMarkers(-73.99733, 40.73082 )\r\n  m<\/code><\/pre>\n<div id=\"htmlwidget-0a917dd086d612be569e\" style=\"width:672px;height:480px;\" class=\"leaflet html-widget\"><\/div>\n<p><script type=\"application\/json\" data-for=\"htmlwidget-0a917dd086d612be569e\">{\"x\":{\"calls\":[{\"method\":\"addTiles\",\"args\":[\"http:\/\/{s}.tile.openstreetmap.org\/{z}\/{x}\/{y}.png\",null,null,{\"minZoom\":0,\"maxZoom\":18,\"maxNativeZoom\":null,\"tileSize\":256,\"subdomains\":\"abc\",\"errorTileUrl\":\"\",\"tms\":false,\"continuousWorld\":false,\"noWrap\":false,\"zoomOffset\":0,\"zoomReverse\":false,\"opacity\":1,\"zIndex\":null,\"unloadInvisibleTiles\":null,\"updateWhenIdle\":null,\"detectRetina\":false,\"reuseTiles\":false,\"attribution\":\"&copy; <a href=\\\"http:\/\/openstreetmap.org\\\">OpenStreetMap\\u003c\/a> contributors, <a href=\\\"http:\/\/creativecommons.org\/licenses\/by-sa\/2.0\/\\\">CC-BY-SA\\u003c\/a>\"}]},{\"method\":\"addMarkers\",\"args\":[40.73082,-73.99733,null,null,null,{\"clickable\":true,\"draggable\":false,\"keyboard\":true,\"title\":\"\",\"alt\":\"\",\"zIndexOffset\":0,\"opacity\":1,\"riseOnHover\":false,\"riseOffset\":250},null,null,null]}],\"setView\":[[40.73082,-73.99733],16,[]],\"limits\":{\"lat\":[40.73082,40.73082],\"lng\":[-73.99733,-73.99733]}},\"evals\":[],\"jsHooks\":[]}<\/script><\/p>\n<p>And for google map tiles:<\/p>\n<pre class=\"r\"><code>library(leaflet)\r\n  m = leaflet::leaflet() %&gt;% \r\n    addTiles( urlTemplate = &quot;http:\/localhost:8000\/mapTiles\/Google\/{z}_{x}_{y}.png&quot;)\r\n  m = m %&gt;% leaflet::setView(-73.99733, 40.73082 , zoom = 16)\r\n  m = m %&gt;% leaflet::addMarkers(-73.99733, 40.73082 )\r\n  m<\/code><\/pre>\n<div id=\"htmlwidget-b7f345f878cce8fd3831\" style=\"width:672px;height:480px;\" class=\"leaflet html-widget\"><\/div>\n<p><script type=\"application\/json\" data-for=\"htmlwidget-b7f345f878cce8fd3831\">{\"x\":{\"calls\":[{\"method\":\"addTiles\",\"args\":[\"http:\/\/mt1.google.com\/vt\/lyrs=m&x={x}&y={y}&z={z}\",null,null,{\"minZoom\":0,\"maxZoom\":18,\"maxNativeZoom\":null,\"tileSize\":256,\"subdomains\":\"abc\",\"errorTileUrl\":\"\",\"tms\":false,\"continuousWorld\":false,\"noWrap\":false,\"zoomOffset\":0,\"zoomReverse\":false,\"opacity\":1,\"zIndex\":null,\"unloadInvisibleTiles\":null,\"updateWhenIdle\":null,\"detectRetina\":false,\"reuseTiles\":false}]},{\"method\":\"addMarkers\",\"args\":[40.73082,-73.99733,null,null,null,{\"clickable\":true,\"draggable\":false,\"keyboard\":true,\"title\":\"\",\"alt\":\"\",\"zIndexOffset\":0,\"opacity\":1,\"riseOnHover\":false,\"riseOffset\":250},null,null,null]}],\"setView\":[[40.73082,-73.99733],16,[]],\"limits\":{\"lat\":[40.73082,40.73082],\"lng\":[-73.99733,-73.99733]}},\"evals\":[],\"jsHooks\":[]}<\/script>\n<\/div>\n<\/div>\n<p><script><\/p>\n<p>\/\/ add bootstrap table styles to pandoc tables\n$(document).ready(function () {\n  $('tr.header').parent('thead').parent('table').addClass('table table-condensed');\n});<\/p>\n<p><\/script><\/p>\n<p><!-- dynamically load mathjax for compatibility with self-contained --><br \/>\n<script>\n  (function () {\n    var script = document.createElement(\"script\");\n    script.type = \"text\/javascript\";\n    script.src  = \"https:\/\/cdn.mathjax.org\/mathjax\/latest\/MathJax.js?config=TeX-AMS-MML_HTMLorMML\";\n    document.getElementsByTagName(\"head\")[0].appendChild(script);\n  })();\n<\/script><\/p>\n<p><\/body><br \/>\n<\/html><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Offline Maps with RgoogleMaps and leaflets M Loecher 7 September 2016 New version of RgoogleMaps now fetches map tiles Until version 1.3.0 RgoogleMaps only downloaded static maps as provided by the static maps APIs from e.g.\u00a0Google, bing and OSM. While there are numerous advantages to this strategy such as full access to the extensive feature &hellip; <a href=\"https:\/\/blog.hwr-berlin.de\/codeandstats\/offline-maps-with-rgooglemaps-and-leaflets\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Offline Maps with RgoogleMaps and leaflets<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-80","post","type-post","status-publish","format-standard","hentry","category-r"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Offline Maps with RgoogleMaps and leaflets - Code and Stats<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blog.hwr-berlin.de\/codeandstats\/offline-maps-with-rgooglemaps-and-leaflets\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Offline Maps with RgoogleMaps and leaflets - Code and Stats\" \/>\n<meta property=\"og:description\" content=\"Offline Maps with RgoogleMaps and leaflets M Loecher 7 September 2016 New version of RgoogleMaps now fetches map tiles Until version 1.3.0 RgoogleMaps only downloaded static maps as provided by the static maps APIs from e.g.\u00a0Google, bing and OSM. While there are numerous advantages to this strategy such as full access to the extensive feature &hellip; Continue reading Offline Maps with RgoogleMaps and leaflets\" \/>\n<meta property=\"og:url\" content=\"https:\/\/blog.hwr-berlin.de\/codeandstats\/offline-maps-with-rgooglemaps-and-leaflets\/\" \/>\n<meta property=\"og:site_name\" content=\"Code and Stats\" \/>\n<meta property=\"article:published_time\" content=\"2016-09-08T20:10:47+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2016-11-20T11:59:37+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/blog.hwr-berlin.de\/codeandstats\/wp-content\/uploads\/2016\/09\/unnamed-chunk-3-1.png\" \/>\n<meta name=\"author\" content=\"Markus L\u00f6cher\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Markus L\u00f6cher\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/blog.hwr-berlin.de\\\/codeandstats\\\/offline-maps-with-rgooglemaps-and-leaflets\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blog.hwr-berlin.de\\\/codeandstats\\\/offline-maps-with-rgooglemaps-and-leaflets\\\/\"},\"author\":{\"name\":\"Markus L\u00f6cher\",\"@id\":\"https:\\\/\\\/blog.hwr-berlin.de\\\/codeandstats\\\/#\\\/schema\\\/person\\\/b8b34fa3bb407386693d915a45ba08be\"},\"headline\":\"Offline Maps with RgoogleMaps and leaflets\",\"datePublished\":\"2016-09-08T20:10:47+00:00\",\"dateModified\":\"2016-11-20T11:59:37+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/blog.hwr-berlin.de\\\/codeandstats\\\/offline-maps-with-rgooglemaps-and-leaflets\\\/\"},\"wordCount\":403,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/blog.hwr-berlin.de\\\/codeandstats\\\/offline-maps-with-rgooglemaps-and-leaflets\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/blog.hwr-berlin.de\\\/codeandstats\\\/wp-content\\\/uploads\\\/2016\\\/09\\\/unnamed-chunk-3-1.png\",\"articleSection\":[\"R\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/blog.hwr-berlin.de\\\/codeandstats\\\/offline-maps-with-rgooglemaps-and-leaflets\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/blog.hwr-berlin.de\\\/codeandstats\\\/offline-maps-with-rgooglemaps-and-leaflets\\\/\",\"url\":\"https:\\\/\\\/blog.hwr-berlin.de\\\/codeandstats\\\/offline-maps-with-rgooglemaps-and-leaflets\\\/\",\"name\":\"Offline Maps with RgoogleMaps and leaflets - Code and Stats\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blog.hwr-berlin.de\\\/codeandstats\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/blog.hwr-berlin.de\\\/codeandstats\\\/offline-maps-with-rgooglemaps-and-leaflets\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/blog.hwr-berlin.de\\\/codeandstats\\\/offline-maps-with-rgooglemaps-and-leaflets\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/blog.hwr-berlin.de\\\/codeandstats\\\/wp-content\\\/uploads\\\/2016\\\/09\\\/unnamed-chunk-3-1.png\",\"datePublished\":\"2016-09-08T20:10:47+00:00\",\"dateModified\":\"2016-11-20T11:59:37+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/blog.hwr-berlin.de\\\/codeandstats\\\/#\\\/schema\\\/person\\\/b8b34fa3bb407386693d915a45ba08be\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/blog.hwr-berlin.de\\\/codeandstats\\\/offline-maps-with-rgooglemaps-and-leaflets\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/blog.hwr-berlin.de\\\/codeandstats\\\/offline-maps-with-rgooglemaps-and-leaflets\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/blog.hwr-berlin.de\\\/codeandstats\\\/offline-maps-with-rgooglemaps-and-leaflets\\\/#primaryimage\",\"url\":\"https:\\\/\\\/blog.hwr-berlin.de\\\/codeandstats\\\/wp-content\\\/uploads\\\/2016\\\/09\\\/unnamed-chunk-3-1.png\",\"contentUrl\":\"https:\\\/\\\/blog.hwr-berlin.de\\\/codeandstats\\\/wp-content\\\/uploads\\\/2016\\\/09\\\/unnamed-chunk-3-1.png\",\"width\":1920,\"height\":1920},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/blog.hwr-berlin.de\\\/codeandstats\\\/offline-maps-with-rgooglemaps-and-leaflets\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/blog.hwr-berlin.de\\\/codeandstats\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Offline Maps with RgoogleMaps and leaflets\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/blog.hwr-berlin.de\\\/codeandstats\\\/#website\",\"url\":\"https:\\\/\\\/blog.hwr-berlin.de\\\/codeandstats\\\/\",\"name\":\"Code and Stats\",\"description\":\"Statistics, Probability and R\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/blog.hwr-berlin.de\\\/codeandstats\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/blog.hwr-berlin.de\\\/codeandstats\\\/#\\\/schema\\\/person\\\/b8b34fa3bb407386693d915a45ba08be\",\"name\":\"Markus L\u00f6cher\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/6ca24d61b3fa96cb1a5f305a4b918469dd9e62da1c9887160357fc3343083247?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/6ca24d61b3fa96cb1a5f305a4b918469dd9e62da1c9887160357fc3343083247?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/6ca24d61b3fa96cb1a5f305a4b918469dd9e62da1c9887160357fc3343083247?s=96&d=mm&r=g\",\"caption\":\"Markus L\u00f6cher\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Offline Maps with RgoogleMaps and leaflets - Code and Stats","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/blog.hwr-berlin.de\/codeandstats\/offline-maps-with-rgooglemaps-and-leaflets\/","og_locale":"en_US","og_type":"article","og_title":"Offline Maps with RgoogleMaps and leaflets - Code and Stats","og_description":"Offline Maps with RgoogleMaps and leaflets M Loecher 7 September 2016 New version of RgoogleMaps now fetches map tiles Until version 1.3.0 RgoogleMaps only downloaded static maps as provided by the static maps APIs from e.g.\u00a0Google, bing and OSM. While there are numerous advantages to this strategy such as full access to the extensive feature &hellip; Continue reading Offline Maps with RgoogleMaps and leaflets","og_url":"https:\/\/blog.hwr-berlin.de\/codeandstats\/offline-maps-with-rgooglemaps-and-leaflets\/","og_site_name":"Code and Stats","article_published_time":"2016-09-08T20:10:47+00:00","article_modified_time":"2016-11-20T11:59:37+00:00","og_image":[{"url":"http:\/\/blog.hwr-berlin.de\/codeandstats\/wp-content\/uploads\/2016\/09\/unnamed-chunk-3-1.png","type":"","width":"","height":""}],"author":"Markus L\u00f6cher","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Markus L\u00f6cher","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/blog.hwr-berlin.de\/codeandstats\/offline-maps-with-rgooglemaps-and-leaflets\/#article","isPartOf":{"@id":"https:\/\/blog.hwr-berlin.de\/codeandstats\/offline-maps-with-rgooglemaps-and-leaflets\/"},"author":{"name":"Markus L\u00f6cher","@id":"https:\/\/blog.hwr-berlin.de\/codeandstats\/#\/schema\/person\/b8b34fa3bb407386693d915a45ba08be"},"headline":"Offline Maps with RgoogleMaps and leaflets","datePublished":"2016-09-08T20:10:47+00:00","dateModified":"2016-11-20T11:59:37+00:00","mainEntityOfPage":{"@id":"https:\/\/blog.hwr-berlin.de\/codeandstats\/offline-maps-with-rgooglemaps-and-leaflets\/"},"wordCount":403,"commentCount":0,"image":{"@id":"https:\/\/blog.hwr-berlin.de\/codeandstats\/offline-maps-with-rgooglemaps-and-leaflets\/#primaryimage"},"thumbnailUrl":"http:\/\/blog.hwr-berlin.de\/codeandstats\/wp-content\/uploads\/2016\/09\/unnamed-chunk-3-1.png","articleSection":["R"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/blog.hwr-berlin.de\/codeandstats\/offline-maps-with-rgooglemaps-and-leaflets\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/blog.hwr-berlin.de\/codeandstats\/offline-maps-with-rgooglemaps-and-leaflets\/","url":"https:\/\/blog.hwr-berlin.de\/codeandstats\/offline-maps-with-rgooglemaps-and-leaflets\/","name":"Offline Maps with RgoogleMaps and leaflets - Code and Stats","isPartOf":{"@id":"https:\/\/blog.hwr-berlin.de\/codeandstats\/#website"},"primaryImageOfPage":{"@id":"https:\/\/blog.hwr-berlin.de\/codeandstats\/offline-maps-with-rgooglemaps-and-leaflets\/#primaryimage"},"image":{"@id":"https:\/\/blog.hwr-berlin.de\/codeandstats\/offline-maps-with-rgooglemaps-and-leaflets\/#primaryimage"},"thumbnailUrl":"http:\/\/blog.hwr-berlin.de\/codeandstats\/wp-content\/uploads\/2016\/09\/unnamed-chunk-3-1.png","datePublished":"2016-09-08T20:10:47+00:00","dateModified":"2016-11-20T11:59:37+00:00","author":{"@id":"https:\/\/blog.hwr-berlin.de\/codeandstats\/#\/schema\/person\/b8b34fa3bb407386693d915a45ba08be"},"breadcrumb":{"@id":"https:\/\/blog.hwr-berlin.de\/codeandstats\/offline-maps-with-rgooglemaps-and-leaflets\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blog.hwr-berlin.de\/codeandstats\/offline-maps-with-rgooglemaps-and-leaflets\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/blog.hwr-berlin.de\/codeandstats\/offline-maps-with-rgooglemaps-and-leaflets\/#primaryimage","url":"https:\/\/blog.hwr-berlin.de\/codeandstats\/wp-content\/uploads\/2016\/09\/unnamed-chunk-3-1.png","contentUrl":"https:\/\/blog.hwr-berlin.de\/codeandstats\/wp-content\/uploads\/2016\/09\/unnamed-chunk-3-1.png","width":1920,"height":1920},{"@type":"BreadcrumbList","@id":"https:\/\/blog.hwr-berlin.de\/codeandstats\/offline-maps-with-rgooglemaps-and-leaflets\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/blog.hwr-berlin.de\/codeandstats\/"},{"@type":"ListItem","position":2,"name":"Offline Maps with RgoogleMaps and leaflets"}]},{"@type":"WebSite","@id":"https:\/\/blog.hwr-berlin.de\/codeandstats\/#website","url":"https:\/\/blog.hwr-berlin.de\/codeandstats\/","name":"Code and Stats","description":"Statistics, Probability and R","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blog.hwr-berlin.de\/codeandstats\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/blog.hwr-berlin.de\/codeandstats\/#\/schema\/person\/b8b34fa3bb407386693d915a45ba08be","name":"Markus L\u00f6cher","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/6ca24d61b3fa96cb1a5f305a4b918469dd9e62da1c9887160357fc3343083247?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/6ca24d61b3fa96cb1a5f305a4b918469dd9e62da1c9887160357fc3343083247?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6ca24d61b3fa96cb1a5f305a4b918469dd9e62da1c9887160357fc3343083247?s=96&d=mm&r=g","caption":"Markus L\u00f6cher"}}]}},"_links":{"self":[{"href":"https:\/\/blog.hwr-berlin.de\/codeandstats\/wp-json\/wp\/v2\/posts\/80","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.hwr-berlin.de\/codeandstats\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.hwr-berlin.de\/codeandstats\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.hwr-berlin.de\/codeandstats\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.hwr-berlin.de\/codeandstats\/wp-json\/wp\/v2\/comments?post=80"}],"version-history":[{"count":16,"href":"https:\/\/blog.hwr-berlin.de\/codeandstats\/wp-json\/wp\/v2\/posts\/80\/revisions"}],"predecessor-version":[{"id":110,"href":"https:\/\/blog.hwr-berlin.de\/codeandstats\/wp-json\/wp\/v2\/posts\/80\/revisions\/110"}],"wp:attachment":[{"href":"https:\/\/blog.hwr-berlin.de\/codeandstats\/wp-json\/wp\/v2\/media?parent=80"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.hwr-berlin.de\/codeandstats\/wp-json\/wp\/v2\/categories?post=80"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.hwr-berlin.de\/codeandstats\/wp-json\/wp\/v2\/tags?post=80"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}