Skip to content

Instantly share code, notes, and snippets.

View williamscraigm's full-sized avatar
🗺️
Focusing

Craig Williams williamscraigm

🗺️
Focusing
View GitHub Profile
@williamscraigm
williamscraigm / index.html
Last active December 9, 2023 01:37
Mapbox
<!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/v1.13.0/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v1.13.0/mapbox-gl.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
@williamscraigm
williamscraigm / index.html
Last active December 9, 2023 01:33
Maplibre
<!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://unpkg.com/maplibre-gl/dist/maplibre-gl.js'></script>
<link href='https://unpkg.com/maplibre-gl/dist/maplibre-gl.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
@williamscraigm
williamscraigm / index.html
Last active March 26, 2021 05:26
Style rotation in VTs
<!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/v1.12.0/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v1.12.0/mapbox-gl.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
@williamscraigm
williamscraigm / index.html
Last active September 25, 2020 23:05
PromoteID Test
<!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/v1.12.0/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v1.12.1/mapbox-gl.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
@williamscraigm
williamscraigm / replace_vector_tile_layer.py
Created September 11, 2018 23:34
Create a new vector tile package, publish it, and replace an existing service. Replace API requires Portal 10.6+ or ArcGIS Online
"""
Name: replace_vector_tile_layer.py
Description: Replace a hosted vector tile layer with an updated version
from a map in a project while retaining the item name, id, and url.
"""
import os
import datetime
import arcpy
from arcgis.gis import GIS
<!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.44.1/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.44.1/mapbox-gl.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
@williamscraigm
williamscraigm / index.html
Created May 10, 2018 22:13
Test Fix Again 3
<!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.44.1/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.44.1/mapbox-gl.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
@williamscraigm
williamscraigm / index.html
Last active March 1, 2018 19:19
Overzoom fix
<!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.44.1/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.44.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/v1.10.1/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v1.10.1/mapbox-gl.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
@williamscraigm
williamscraigm / index.html
Last active February 17, 2018 01:36
4.x JSAPI vector tile sample
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
<title>WMTSLayer - 4.x</title>
<link rel="stylesheet" href="https://js.arcgis.com/4.6/esri/css/main.css">
<style>
html,