Service | SSL | status | Response Type | Allowed methods | Allowed headers |
---|
The Leaflet JS mapping library has lots of plugins available. The Leaflet package for R provides direct support for some, but far from all, of these plugins, by providing R functions for invoking the plugins.
If you as an R user find yourself wanting to use a Leaflet plugin that isn't directly supported in the R package, you can use the technique shown here to load the plugin yourself and invoke it using JS code.
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
#!/usr/bin/env python3 | |
# encoding: utf-8 | |
"""Use instead of `python3 -m http.server` when you need CORS""" | |
from http.server import HTTPServer, SimpleHTTPRequestHandler | |
class CORSRequestHandler(SimpleHTTPRequestHandler): | |
def end_headers(self): | |
self.send_header('Access-Control-Allow-Origin', '*') |
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
#devtools::install("jeroenooms/V8") | |
library("V8") | |
library(pipeR) | |
ct = new_context("window") | |
# min.js gives me a call stack size error but non-min works fine | |
ct$source( | |
"https://raw.githubusercontent.com/morganherlocker/turf/master/turf.js" | |
) | |
# one of the examples from turf API docs |
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
function mergeDeep (o1, o2) { | |
var tempNewObj = o1; | |
//if o1 is an object - {} | |
if (o1.length === undefined && typeof o1 !== "number") { | |
$.each(o2, function(key, value) { | |
if (o1[key] === undefined) { | |
tempNewObj[key] = value; | |
} else { | |
tempNewObj[key] = mergeDeep(o1[key], o2[key]); |