Skip to content

Instantly share code, notes, and snippets.

View andrewharvey's full-sized avatar

Andrew Harvey andrewharvey

View GitHub Profile
@andrewharvey
andrewharvey / index.html
Last active September 20, 2022 10:21
Mapbox GL JS Text Styled as Link on Hover
<!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.38.0/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.38.0/mapbox-gl.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
@andrewharvey
andrewharvey / index.html
Last active June 27, 2017 00:50
Mapbox GL JS 0.39.0 check geolocation within maxBounds
<!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.mapbox.com/mapbox-gl-js/v0.39.0/mapbox-gl.js'></script>
<link href='https://api.mapbox.com/mapbox-gl-js/v0.39.0/mapbox-gl.css' rel='stylesheet' />
<style>
<!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.32.1/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.32.1/mapbox-gl.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
<!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.32.1/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.32.1/mapbox-gl.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
@andrewharvey
andrewharvey / gdal_geometry_corners_as_geojson.sh
Created February 25, 2017 03:28
Returns a GeoJSON Polygon of a raster's coners using gdal_list_corners
gdal_list_corners $1 | js-yaml | jq '[[ .geometry_ll.upper_left_lon, .geometry_ll.upper_left_lat ], [ .geometry_ll.upper_right_lon, .geometry_ll.upper_right_lat ], [ .geometry_ll.lower_right_lon, .geometry_ll.lower_right_lat ], [ .geometry_ll.lower_left_lon, .geometry_ll.lower_left_lat ], [ .geometry_ll.upper_left_lon, .geometry_ll.upper_left_lat ]]'
@andrewharvey
andrewharvey / .block
Last active July 23, 2016 10:25
Mapbox GL JS Popup Offset Example Multiple Fixed
license: bsd-2-clause
@andrewharvey
andrewharvey / .block
Last active July 23, 2016 10:26
Mapbox GL JS Popup Offset Example Radius
license: bsd-2-clause
@andrewharvey
andrewharvey / .block
Last active July 23, 2016 10:26
Mapbox GL JS Popup Offset Example Single Fixed
license: bsd-2-clause
@andrewharvey
andrewharvey / index.html
Last active November 9, 2022 01:45
Mapbox GL JS Marker Offset Example
<!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='mapbox-gl-dev.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.21.0/mapbox-gl.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
@andrewharvey
andrewharvey / a.geojson
Last active July 5, 2016 09:31
JSTS Issue TypeError: this.seg.p1.equals2D is not a function https://github.com/bjornharrtell/jsts/issues/276
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.