Skip to content

Instantly share code, notes, and snippets.

View ca0v's full-sized avatar

Corey Alix ca0v

  • Greenville, SC
View GitHub Profile
@ca0v
ca0v / google-maps-data-parser.js
Created February 22, 2022 23:08 — forked from jeteon/google-maps-data-parser.js
NodeJS script to parse the Google Maps "data" URL attribute into an array.
'use strict';
/**
* Basic code to parse the values in the "data" attribute in a Google Maps URL to an Array.
* There will likely still be some work to do to interpret the resulting Array.
*
* Based on information from:
* http://stackoverflow.com/a/34275131/1852838
* http://stackoverflow.com/a/24662610/1852838
*/
@ca0v
ca0v / Convert WKT to Json for ESRI JSAPI
Created June 15, 2018 18:49 — forked from mitch-cohen/Convert WKT to Json for ESRI JSAPI
This function will convert the Well Known Text to JSON for ESRI Geometry creation. See example at http://jsfiddle.net/mac1175/6hcax/
// from https://gist.github.com/mitch-cohen/9547514
export function toJson(WKTstr: string) {
// trim leading "(" and trailing ")" characters
function unbracket(str: string) {
let left = str.indexOf("(") + 1;
let right = str.lastIndexOf(")");
if (right < str.length - 1) right = str.length;
return str.substring(left, right);
}