- Support for delaying the lookup (good for preventing too many AJAX requests)
- Some fixes regarding the data fed to the onselect callback
For the proper source, and other examples, please see the original gist and the extended version
For the proper source, and other examples, please see the original gist and the extended version
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>Gypsum</title> | |
<link rel="stylesheet" type="text/css" href="http://cdn.leafletjs.com/leaflet-0.4.4/leaflet.css"/> | |
<link rel="stylesheet" type="text/css" href='https://raw.github.com/jacobtoye/Leaflet.iconlabel/master/dist/leaflet.iconlabel.css'/> | |
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> | |
<script src='http://cdn.leafletjs.com/leaflet-0.4.4/leaflet.js'></script> |
# Imports all GSD shape data to a database. | |
# NOTE: If the db exists, it is *dropped* before importing any data | |
DB=lmv | |
GSD_PATH=/media/local/MapData/lmv-shape | |
SQL_LOG=/dev/null | |
ERROR_LOG=gsd_import.log | |
# Create a clean slate | |
rm $SQL_LOG |
#!/usr/bin/python | |
from sys import argv | |
path = argv[1] | |
hex_pattern = argv[2] | |
str_pattern = "".join([chr(int(hex_pattern[x:x+2], 16)) for x in range(0,len(hex_pattern), 2)]) | |
with open(path, 'r') as f: |
GEOMETRYCOLLECTION (LINESTRING (6308869.40378 356821.22669, 6308867.893 356822.41744, 6308852.75314 356830.22159, 6308869.92754 356844.26638), LINESTRING (6308755.07971 356674.51686, 6308784.81355 356719.16757, 6308815.20022 356765.46178, 6308829.63774 356763.22832, 6308852.87023 356759.82402, 6308867.19982 356771.06823, 6308875.40631 356796.20162, 6308872.51907 356815.17242), LINESTRING (6308874.12086 356813.73392, 6308876.83028 356795.77697, 6308868.23871 356770.06254, 6308853.09618 356758.29456, 6308815.86529 356763.89689, 6308799.76731 356739.37835, 6308747.77971 356662.11613, 6308746.55411 356661.61702, 6308744.06545 356657.72563, 6308731.77184 356668.45076, 6308699.45221 356683.15463, 6308682.44689 356684.63193, 6308654.96629 356683.66846, 6308636.13879 356680.0482, 6308618.19888 356671.76352, 6308608.41685 356661.79428, 6308578.7973 356592.35062, 6308545.33908 356542.14886, 6308517.52088 356509.38474, 6308505.40266 356506.84141, 6308493.59689 356506.98067, 6308375.07918 356520.46209), LINESTRING (63088 |
from sys import argv | |
from math import ceil, floor | |
res = float(argv[1]) | |
number_zoom_levels = int(argv[2]) | |
tile_size = int(argv[3]) | |
bbox = [float(v) for v in argv[4].split(',')] | |
total_tiles = 0 | |
for z in xrange(0, number_zoom_levels + 1): |
var dbName = 'http://localhost:5984/couch-test', | |
nDocs = 10000, | |
batchSize = 1000, | |
scrapFactor = 0, | |
docs = [], | |
testQuery = 'entries/sumTime', | |
destroyDb = false, | |
_log = console.log, | |
db; |
var _log = console.log; | |
console.log = function() { | |
var e = document.getElementById('log'), | |
i; | |
for (i = 0; i < arguments.length; i++) { | |
e.innerHTML = e.innerHTML + arguments[i] + '\n'; | |
} |
I hereby claim:
To claim this, I am signing this object: