Skip to content

Instantly share code, notes, and snippets.

@tsauerwein
tsauerwein / image-layer.html
Created March 19, 2013 09:44
Shows an OpenLayers image layer in grayscale, a combination of these two examples: http://openlayers.org/dev/examples/image-layer.html http://openlayers.org/dev/examples/osm-grayscale.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta name="apple-mobile-web-app-capable" content="yes">
<title>OpenLayers Image Layer Example</title>
<link rel="stylesheet" href="http://openlayers.org/dev/theme/default/style.css" type="text/css">
<link rel="stylesheet" href="http://openlayers.org/dev/examples/style.css" type="text/css">
<style type="text/css">
<sld:StyledLayerDescriptor xmlns:sld="http://www.opengis.net/sld" version="1.0.0" xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml"><sld:NamedLayer><sld:Name>REM_NAPPE_SOCLE</sld:Name><sld:UserStyle><sld:FeatureTypeStyle><sld:Rule><sld:Title>= Faible</sld:Title><ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"><ogc:PropertyIsEqualTo><ogc:PropertyName>legende</ogc:PropertyName><ogc:Literal>Faible</ogc:Literal></ogc:PropertyIsEqualTo></ogc:Filter><sld:PolygonSymbolizer><sld:Fill><sld:CssParameter name="fill">#ff0000</sld:CssParameter><sld:CssParameter name="fill-opacity">1</sld:CssParameter></sld:Fill><sld:Stroke><sld:CssParameter name="stroke">#ff0000</sld:CssParameter><sld:CssParameter name="stroke-opacity">1</sld:CssParameter><sld:CssParameter name="stroke-width">1</sld:CssParameter></sld:Stroke></sld:PolygonSymbolize
@tsauerwein
tsauerwein / ferry.geojson
Last active August 29, 2015 14:06
Romania Tour 2014
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tsauerwein
tsauerwein / update-gh-pages.sh
Last active August 29, 2015 14:28
OpenLayers 3: Update gh-pages
#!/bin/bash
# run from inside the ol3 directory with e.g.:
# ./../update-gh-pages.sh draw-and-modify
#
# http://tsauerwein.github.io/ol3/draw-and-modify/examples/
if [[ -z $1 ]]; then
echo "Usage error."
exit 1
@tsauerwein
tsauerwein / flight-animation-1.js
Created August 24, 2015 12:44
OpenLayers 3 Flight Animation
var map = new ol.Map({
layers: [
new ol.layer.Tile({
source: new ol.source.Stamen({layer: 'toner'})
})
],
renderer: 'canvas',
target: 'map',
view: new ol.View({
center: [0, 0],
@tsauerwein
tsauerwein / bulk_none.py
Created January 6, 2016 20:43
SQLAlchemy bulk insertion with None
from sqlalchemy import Column, String, Integer
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy.sql.expression import null
Base = declarative_base()
class Doc(Base):
__tablename__ = 'doc'
@tsauerwein
tsauerwein / index.html
Last active February 20, 2016 11:02
Smart mouse-wheel scrolling for OpenLayers 3 maps
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="http://openlayers.org/en/v3.13.1/css/ol.css" type="text/css">
<style>
.content {
@tsauerwein
tsauerwein / index.html
Created February 20, 2016 11:23
Smart mouse-wheel scrolling for OpenLayers 3 maps #2
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="http://openlayers.org/en/v3.13.1/css/ol.css" type="text/css">
<style>
.content {
@tsauerwein
tsauerwein / index.html
Last active November 28, 2019 08:48
ol3-google-maps test
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="robots" content="index, all" />
<title>OL3-Google-Maps vector example</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" />
<link rel="stylesheet" href="http://dev5.mapgears.com/ol3-google-maps/node_modules/openlayers/css/ol.css" type="text/css" />
<link rel="stylesheet" href="http://dev5.mapgears.com/ol3-google-maps/css/ol3gm.css" type="text/css" />
@tsauerwein
tsauerwein / index.html
Created April 19, 2016 20:21
OpenLayers 3 + windy.js
<!doctype html>
<html lang="en">
<head>
<title>windy.js integration example</title>
<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="http://openlayers.org/en/v3.15.0/css/ol.css" type="text/css">
<style type="text/css">
#map {