Skip to content

Instantly share code, notes, and snippets.

View ThomasG77's full-sized avatar

Thomas Gratier ThomasG77

View GitHub Profile
@ThomasG77
ThomasG77 / departements-france-2017.json
Last active December 31, 2017 10:39
Create legend for proportional circles in OpenLayers
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ThomasG77
ThomasG77 / index.html
Last active January 20, 2018 02:50
Using WMS Capabilities to get layer center (OK only if layer center is not the CRS center but really the layer data center...)
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
<meta name=description content="">
<meta name=viewport content="width=device-width, initial-scale=1">
<title>WMS Capabilities Parsing</title>
<link rel="stylesheet" href="https://openlayers.org/en/v4.6.4/css/ol.css" type="text/css">
<!-- The line below is only needed for old environments like Internet Explorer and Android 4.x -->
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=requestAnimationFrame,Element.prototype.classList,URL"></script>
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
<meta name=description content="">
<meta name=viewport content="width=device-width, initial-scale=1">
<title>WFS</title>
<link rel="stylesheet" href="https://openlayers.org/en/v4.6.4/css/ol.css" type="text/css">
<!-- The line below is only needed for old environments like Internet Explorer and Android 4.x -->
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=requestAnimationFrame,Element.prototype.classList,URL"></script>
@ThomasG77
ThomasG77 / index.html
Last active January 27, 2018 21:51
Constrainted drawing within another layer area with OpenLayers (based on official Measure example)
<!DOCTYPE html>
<html>
<head>
<title>Constrainted drawing (based on official Measure example)</title>
<link rel="stylesheet" href="https://openlayers.org/en/v4.6.4/css/ol.css" type="text/css">
<script src='https://npmcdn.com/@turf/turf/turf.min.js'></script>
<!-- The line below is only needed for old environments like Internet Explorer and Android 4.x -->
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=requestAnimationFrame,Element.prototype.classList,URL"></script>
<script src="https://openlayers.org/en/v4.6.4/build/ol.js"></script>
<style>
@ThomasG77
ThomasG77 / load_xyz_sources.py
Created February 27, 2018 15:48
PyQGIS script to save/load/wipe XYZ sources in Browser Panel in QGIS3
# -*- coding: utf-8 -*-
"""
/***************************************************************************
Name : XYZ manager
Description : Script to save/load/wipe WYZ sources in QGIS 3.0
Date : February 27, 2017
copyright : (C) 2017 by Thomas Gratier
email : [email protected]
@ThomasG77
ThomasG77 / .gitignore
Created February 28, 2018 01:17 — forked from tschaub/.gitignore
OpenLayers + Webpack
/node_modules/
bundle.js
@ThomasG77
ThomasG77 / index.html
Created April 16, 2018 23:41
Map Export with PNGW & PRJ files
<!DOCTYPE html>
<html>
<head>
<title>Map Export with PNGW &amp; PRJ files</title>
<meta charset=utf-8>
<meta name=description content="">
<meta name=viewport content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css" type="text/css">
<link rel="stylesheet" href="https://openlayers.org/en/v4.6.5/css/ol.css" type="text/css">
<style type="text/css">
@ThomasG77
ThomasG77 / index.html
Created April 28, 2018 21:08
Use ol.source.Raster to mask only 2 layers instead of playing between full canvas and a particular layer
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
<meta name=description content="">
<meta name=viewport content="width=device-width, initial-scale=1">
<title>Simple Map with mask between 2 layers</title>
<link rel="stylesheet" href="https://openlayers.org/en/v4.6.5/css/ol.css" type="text/css">
<!-- The line below is only needed for old environments like Internet Explorer and Android 4.x -->
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=requestAnimationFrame,Element.prototype.classList,URL"></script>
@ThomasG77
ThomasG77 / index.html
Last active May 5, 2018 16:01
Demo to use OpenLayers with Finland projection and WMS Aeromagnetic anomalous layer from GTK
<!DOCTYPE html>
<html>
<head>
<title>Finland Aeromagnetic anomalous map with Proj4</title>
<link rel="stylesheet" href="https://openlayers.org/en/v4.6.5/css/ol.css" type="text/css">
<!-- The line below is only needed for old environments like Internet Explorer and Android 4.x -->
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=requestAnimationFrame,Element.prototype.classList,URL"></script>
<script src="https://openlayers.org/en/v4.6.5/build/ol.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.4.4/proj4.js"></script>
</head>
@ThomasG77
ThomasG77 / index.html
Created May 5, 2018 20:28
Finland map with local OpenStreetMap basemap OpenLayers
<!DOCTYPE html>
<html>
<head>
<title>Finland map with local OpenStreetMap basemap</title>
<link rel="stylesheet" href="https://openlayers.org/en/v4.6.5/css/ol.css" type="text/css">
<!-- The line below is only needed for old environments like Internet Explorer and Android 4.x -->
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=requestAnimationFrame,Element.prototype.classList,URL"></script>
<script src="https://openlayers.org/en/v4.6.5/build/ol.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.4.4/proj4.js"></script>
</head>