Skip to content

Instantly share code, notes, and snippets.

@AlanPew
AlanPew / index.html
Last active February 24, 2023 10:38
Export PNG with World File from Mapbox GL
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title>Export PNG</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=yes' />
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.44.2/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.44.2/mapbox-gl.css' rel='stylesheet' />
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
@AlanPew
AlanPew / common.css
Last active December 19, 2022 01:58
Mapping Selections
/*
* Geofabrik Tools
*
* css/common.css
*
*/
body {
background-image: url(../img/bg-top.png);
background-position: 0 -64px;
@AlanPew
AlanPew / index.html
Last active December 6, 2022 08:23
mapbox browser support
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title></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.9.0/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.9.0/mapbox-gl.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
@AlanPew
AlanPew / index.html
Created July 4, 2022 18:05
maplibre ESRI OSM
<!--
To run this demo, you need to replace 'YOUR_API_KEY' with an API key from the ArcGIS Developers dashboard.
Sign up for a free account and get an API key.
https://developers.arcgis.com/documentation/mapping-apis-and-services/get-started/
-->
@AlanPew
AlanPew / index.html
Last active June 3, 2022 23:05
infra test
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Open Infrastructure Map</title>
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="@openinframap">
<meta name="twitter:creator" content="@russss">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="description" content="Map of the world's electricity, telecoms, oil, and gas infrastructure, using data from OpenStreetMap">
@AlanPew
AlanPew / index.html
Last active May 31, 2022 02:35
scrape
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title>map</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://code.jquery.com/jquery-1.6.4.min.js'></script>
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.44.2/mapbox-gl.js'></script>
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.44.2/mapbox-gl.js'></script>
<script src='https://raw.githack.com/mapbox/polyline/master/src/polyline.js'></script>
@AlanPew
AlanPew / export.py
Created October 22, 2021 00:11 — forked from rosskarchner/export.py
extract tiles from an mbtiles file
import sqlite3, os
conn = sqlite3.connect('Mills1860.mbtiles')
results=conn.execute('select * from tiles').fetchall()
for result in results:
zoom, column, row, png= result
try:
os.makedirs('%s/%s/' % (zoom, row))
@AlanPew
AlanPew / index.html
Created September 6, 2021 04:29
test agol
<!--
To run this demo, you need to replace 'YOUR_API_KEY' with an API key from the ArcGIS Developer dashboard.
Sign up for a free account and get an API key.
https://developers.arcgis.com/documentation/mapping-apis-and-services/get-started/
--><html>
<head>
@AlanPew
AlanPew / index.html
Created September 5, 2021 16:29
esri nat geo webmap
<html>
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="initial-scale=1,maximum-scale=1,user-scalable=no"
/>
<title>Load a basic WebMap | Sample | ArcGIS API for JavaScript 4.20</title>
<style>
@AlanPew
AlanPew / index.html
Last active September 5, 2021 16:14
esri js test 2
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
<title>ArcGIS Developer Guide: Display a map (2D)</title>
<style>
html,
body,
#viewDiv {