Skip to content

Instantly share code, notes, and snippets.

View klokan's full-sized avatar

Petr Pridal klokan

View GitHub Profile
@klokan
klokan / picker.html
Created May 9, 2016 09:12
google picker api demo test
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Google Picker Example</title>
<!-- The standard Google Loader script; use your own key. -->
<script src="http://www.google.com/jsapi?key=INSERT-YOUR-KEY"></script>
<script type="text/javascript">
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# The normalizeUnicode() function, inspired by Plone's
from unicodedata import normalize, decomposition, combining
import string
from exceptions import UnicodeEncodeError
# Hand-made table from PloneTool.py
var metrics = {"family":"Open Sans","style":"Regular","buffer":3,"size":24,"chars":{" ":[0,0,0,0,6],"!":[4,19,1,18,6,2,2],"\"":[8,8,1,18,9,14,2],"#":[15,18,0,18,15,30,2],"$":[12,21,1,19,13,53,2],"%":[18,19,1,18,19,73,2],"&":[17,19,1,18,17,99,2],"'":[3,8,1,18,5,124,2],"(":[7,22,0,18,7,135,2],")":[7,22,0,18,7,150,2],"*":[12,12,1,19,13,165,2],"+":[12,13,1,15,13,185,2],",":[5,7,0,3,5,205,2],"-":[7,3,0,8,7,218,2],".":[4,4,1,3,6,233,2],"/":[9,18,0,18,8,245,2],"0":[12,19,1,18,13,262,2],"1":[7,18,2,18,13,282,2],"2":[12,18,1,18,13,297,2],"3":[12,19,1,18,13,317,2],"4":[14,18,0,18,13,337,2],"5":[12,19,1,18,13,359,2],"6":[12,19,1,18,13,379,2],"7":[12,18,1,18,13,399,2],"8":[12,19,1,18,13,419,2],"9":[12,19,1,18,13,439,2],":":[4,15,1,14,6,459,2],";":[5,18,0,14,6,471,2],"<":[12,13,1,15,13,484,2],"=":[12,7,1,12,13,218,14],">":[12,13,1,15,13,165,22],"?":[10,19,0,18,10,185,23],"@":[20,21,1,18,21,484,23],"A":[16,18,0,18,15,238,28],"B":[13,18,2,18,15,459,28],"C":[14,19,1,18,15,14,28],"D":[15,18,2,18,17,282,28],"E":[10,18,2,18,13,
@klokan
klokan / bright-v8-local.json
Created August 3, 2016 12:40
bright-v8-local.json
{
"version": 8,
"name": "Bright",
"sources": {
"mapbox": {
"url": "http://osm2vectortiles.tileserver.com/v1.json",
"type": "vector"
}
},
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@klokan
klokan / index.html
Last active May 11, 2017 21:50 — forked from anonymous/index.html
OpenMapTiles Satellite
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>OpenMapTiles Satellite Preview</title>
<link rel="stylesheet" type="text/css" href="https://api.mapbox.com/mapbox-gl-js/v0.28.0/mapbox-gl.css" />
<script src="https://api.mapbox.com/mapbox-gl-js/v0.28.0/mapbox-gl.js"></script>
<style>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title>MapBox GL JS Local Example</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.36.0/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.36.0/mapbox-gl.css' rel='stylesheet' />
<!--
<script src='mapbox-gl.js'></script>
@klokan
klokan / style.json
Created May 12, 2017 15:40 — forked from anonymous/style.json
SBB Internal
{
"version": 8,
"name": "SBB Internal",
"metadata": {
"mapbox:autocomposite": false,
"mapbox:type": "template",
"maputnik:renderer": "mbgljs",
"openmaptiles:version": "3.x",
"openmaptiles:mapbox:owner": "openmaptiles",
"openmaptiles:mapbox:source:url": "mapbox://openmaptiles.4qljc88t"
@klokan
klokan / index.html
Last active April 29, 2019 11:47 — forked from anonymous/style.json
OpenMapTiles Satellite Hybrid BETA
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<title>OpenMapTiles Satellite Hybrid BETA</title>
<link rel="stylesheet" type="text/css" href="https://api.mapbox.com/mapbox-gl-js/v0.39.1/mapbox-gl.css" />
<script src="https://api.mapbox.com/mapbox-gl-js/v0.39.1/mapbox-gl.js"></script>
<style>
body { margin:0; padding:0; }