Skip to content

Instantly share code, notes, and snippets.

@pgiraud
pgiraud / geolocation.js
Created May 7, 2014 15:39
OpenLayers - Geolocation Example - HighAccuracy
var style = {
fillColor: '#000',
fillOpacity: 0.1,
strokeWidth: 0
};
var map = new OpenLayers.Map('map');
var layer = new OpenLayers.Layer.OSM( "Simple OSM Map");
var vector = new OpenLayers.Layer.Vector('vector');
map.addLayers([layer, vector]);
@pgiraud
pgiraud / README.md
Last active August 29, 2015 13:58 — forked from mbostock/.block
<!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 Basic OSM Example</title>
<script src="http://maps.google.com/maps/api/js?v=3&amp;sensor=false"></script>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/openlayers/2.13.1/theme/default/style.css" type="text/css">
@pgiraud
pgiraud / index.html
Last active August 29, 2015 13:58
OpenLayers Draw/Modify controls
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>OpenLayers Draw/Modify Controls</title>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/openlayers/2.13.1/theme/default/style.css" type="text/css">
<script src="//cdnjs.cloudflare.com/ajax/libs/openlayers/2.13.1/OpenLayers.js"></script>
</head>
<body>
<h1 id="title">OpenLayers Draw/Modify Controls</h1>
<!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 Basic OSM Example</title>
<script src="http://maps.google.com/maps/api/js?v=3&amp;sensor=false"></script>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/openlayers/2.13.1/theme/default/style.css" type="text/css">
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
@pgiraud
pgiraud / index.html
Last active August 29, 2015 13:57
OpenLayers Google min/max Resolution
<!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 Basic OSM Example</title>
<script src="http://maps.google.com/maps/api/js?v=3&amp;sensor=false"></script>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/openlayers/2.13.1/theme/default/style.css" type="text/css">
<script src="//cdnjs.cloudflare.com/ajax/libs/openlayers/2.13.1/OpenLayers.js"></script>
@pgiraud
pgiraud / index.html
Created February 28, 2014 13:52
OL3 - Geolocation simlulated
<!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">
<title>Mobile full screen example</title>
<style type="text/css">
html, body, .map {
margin: 0;
<!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">
<title>Mobile full screen example</title>
<style type="text/css">
html, body, .map {
margin: 0;
@pgiraud
pgiraud / geolocation_marker.png
Last active August 29, 2015 13:56
OL3 rotate and move with anchor
geolocation_marker.png