Skip to content

Instantly share code, notes, and snippets.

@pgiraud
pgiraud / app.js
Last active September 29, 2020 20:14
OpenLayers 2 ESRI XYZ layers
var map, layer;
function init(){
map = new OpenLayers.Map('map', {
layers: [new OpenLayers.Layer.OSM()]
});
layer = new OpenLayers.Layer.XYZ( "ESRI",
"https://services1.arcgis.com/rMlsWo8szOzlrpCq/arcgis/rest/services/danger_d_avalanche/MapServer/tile/${z}/${y}/${x}",
{sphericalMercator: true, isBaseLayer: false}
);
map.addLayer(layer);
@pgiraud
pgiraud / 169_4326.json
Last active August 29, 2015 14:22
D3 GeoJSON labels
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pgiraud
pgiraud / http_request.py
Last active August 29, 2015 14:16
Python script to test connection behind proxy
import httplib2
httplib2.debuglevel = 4
PROXY_SERVER = "http://proxy.iiit.ac.in"
PROXY_PORT = 8080
PROXY = httplib2.ProxyInfo(httplib2.socks.PROXY_TYPE_HTTP, PROXY_SERVER, PROXY_PORT, proxy_rdns=True)
h = httplib2.Http(proxy_info=PROXY)
(resp_headers, content) = h.request("http://example.org/", "GET")
print content
@pgiraud
pgiraud / index.html
Last active August 29, 2015 14:14
OpenLayers 3 - Dash weird display
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="//openlayers.org/en/master/css/ol.css" type="text/css">
<link rel="stylesheet" href="//openlayers.org/en/master/resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="//openlayers.org/en/master/resources/layout.css" type="text/css">
<link rel="stylesheet" href="//openlayers.org/en/master/resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
@pgiraud
pgiraud / index.html
Last active August 29, 2015 14:13
OpenLayers - Geolocation spoofer
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="style.css">
<script src="http://openlayers.org/en/master/build/ol.js"></script>
</head>
<body>
<div id="map"></div>
@pgiraud
pgiraud / arrow_skip_up.png
Last active August 29, 2015 14:13
OpenLayers3 - Show destination
arrow_skip_up.png
@pgiraud
pgiraud / index.html
Last active August 29, 2015 14:13
OpenLayers3 - Device orientation -> map orientation
<!DOCTYPE html>
<html>
<head>
<title>OpenLayers3 Map Rotation with device compass</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="http://openlayers.org/en/master/css/ol.css" type="text/css">
@pgiraud
pgiraud / index.html
Created November 21, 2014 11:14
OpenLayers3 vector tiles
<html>
</html>
@pgiraud
pgiraud / States_sample.json
Created November 17, 2014 10:28
GeoJSON in OL3
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pgiraud
pgiraud / index.html
Created August 11, 2014 08:04
OL3 Mobile Vevey Cartoriviera
something