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
| var proj = require("proj4"); | |
| proj.defs("EPSG:3068", "+proj=cass +lat_0=52.41864827777778 +lon_0=13.62720366666667 +x_0=40000 +y_0=10000 +ellps=bessel +datum=potsdam +units=m +no_defs"); | |
| console.log(proj("EPSG:3068", "WGS84", [26197,19294])); |
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
| // <canvas> | |
| var w = 600, h = 300; | |
| var canvas = document.getElementsByTagName('CANVAS')[0]; | |
| canvas.width = w; | |
| canvas.height = h; | |
| var context = canvas.getContext('2d'); |
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 toLocalISOString(d) { | |
| var off = d.getTimezoneOffset(); | |
| return new Date(d.getFullYear(), d.getMonth(), d.getDate(), d.getHours(), d.getMinutes() - off, d.getSeconds(), d.getMilliseconds()).toISOString(); | |
| } |
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
| /** | |
| * @author Jan Marsch (@kekscom) | |
| * @example see http://jsfiddle.net/osmbuildings/2e5KX/5/ | |
| * @example thickLineToPolygon([{x:50,y:155}, {x:75,y:150}, {x:100,y:100}, {x:50,y:100}], 20) | |
| * @param polyline {array} a list of point objects in format {x:75,y:150} | |
| * @param thickness {int} line thickness | |
| */ | |
| var thickLineToPolygon = (function () { | |
| function getOffsets(a, b, thickness) { |
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
| /** | |
| This little helper creates bulk SQL insert queries like this: | |
| INSERT INTO mytable (id, col1, col2) VALUES | |
| (1, "col1value", "col2value"), | |
| (2, "col1value", "col2value"), | |
| (3, "col1value", "col2value"), | |
| : | |
| : | |
| (4999, "col1value", "col2value"), |
NewerOlder