Convert L examples to use strapless template
This commit is contained in:
@@ -1,16 +1,12 @@
|
|||||||
---
|
---
|
||||||
layout: example.html
|
layout: strapless.html
|
||||||
title: Layer WebGL clipping example
|
title: Layer Clipping with WebGL
|
||||||
shortdesc: Layer WebGL clipping example.
|
shortdesc: Layer WebGL clipping example.
|
||||||
docs: >
|
docs: >
|
||||||
This example shows how to use the <code>precompose</code> and <code>postcompose</code> rendering hooks to clip layers using WebGL.
|
This example shows how to use the <code>precompose</code> and <code>postcompose</code> rendering hooks to clip layers using WebGL.
|
||||||
tags: "clipping, webgl, openstreetmap"
|
tags: "clipping, webgl, openstreetmap"
|
||||||
---
|
---
|
||||||
<div class="row-fluid">
|
<div id="map" class="map"></div>
|
||||||
<div class="span12">
|
|
||||||
<div id="map" class="map"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div id="no-webgl" class="alert alert-danger" style="display: none">
|
<div id="no-webgl" class="alert alert-danger" style="display: none">
|
||||||
This example requires a browser that supports <a href="http://get.webgl.org/">WebGL</a>.
|
This example requires a browser that supports <a href="http://get.webgl.org/">WebGL</a>.
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
#map {
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
@@ -1,13 +1,9 @@
|
|||||||
---
|
---
|
||||||
layout: example.html
|
layout: strapless.html
|
||||||
title: Layer clipping example
|
title: Layer Clipping
|
||||||
shortdesc: Layer clipping example
|
shortdesc: Layer clipping example
|
||||||
docs: >
|
docs: >
|
||||||
Layer clipping example
|
Layer clipping example
|
||||||
tags: "clipping, openstreetmap"
|
tags: "clipping, openstreetmap"
|
||||||
---
|
---
|
||||||
<div class="row-fluid">
|
<div id="map" class="map"></div>
|
||||||
<div class="span12">
|
|
||||||
<div id="map" class="map"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
layout: example.html
|
layout: strapless.html
|
||||||
title: Limited Layer Extent
|
title: Limited Layer Extent
|
||||||
shortdesc: Restricting layer rendering to a limited extent.
|
shortdesc: Restricting layer rendering to a limited extent.
|
||||||
docs: >
|
docs: >
|
||||||
@@ -8,15 +8,9 @@ docs: >
|
|||||||
to limit rendering based on an extent.
|
to limit rendering based on an extent.
|
||||||
tags: "extent, tilejson"
|
tags: "extent, tilejson"
|
||||||
---
|
---
|
||||||
<div class="row-fluid">
|
<div id="map" class="map"></div>
|
||||||
<div class="span12">
|
<button type="button" class="btn btn-default" id="northwest">northwest</button>
|
||||||
<div id="map" class="map"></div>
|
<button type="button" class="btn btn-default" id="northeast">northeast</button>
|
||||||
</div>
|
<button type="button" class="btn btn-default" id="southeast">southeast</button>
|
||||||
</div>
|
<button type="button" class="btn btn-default" id="southwest">southwest</button>
|
||||||
<div class="btn-group">
|
<button type="button" class="btn btn-default" id="world">world</button>
|
||||||
<button type="button" class="btn btn-default" id="northwest">northwest</button>
|
|
||||||
<button type="button" class="btn btn-default" id="northeast">northeast</button>
|
|
||||||
<button type="button" class="btn btn-default" id="southeast">southeast</button>
|
|
||||||
<button type="button" class="btn btn-default" id="southwest">southwest</button>
|
|
||||||
<button type="button" class="btn btn-default" id="world">world</button>
|
|
||||||
</div>
|
|
||||||
|
|||||||
+47
-49
@@ -1,56 +1,54 @@
|
|||||||
---
|
---
|
||||||
layout: example.html
|
layout: strapless.html
|
||||||
title: Layer group example
|
title: Layer Groups
|
||||||
shortdesc: Example of a map with layer group.
|
shortdesc: Example of a map with layer group.
|
||||||
docs: >
|
docs: >
|
||||||
Example of a map with layer group.
|
Example of a map with layer group.
|
||||||
tags: "tilejson, input, bind, group, layergroup"
|
tags: "tilejson, input, bind, group, layergroup"
|
||||||
|
resources:
|
||||||
|
- https://code.jquery.com/jquery-1.11.2.min.js
|
||||||
---
|
---
|
||||||
<div class="row-fluid">
|
<div id="map" class="map"></div>
|
||||||
<div class="span6">
|
<div id="layertree">
|
||||||
<div id="map" class="map"></div>
|
<h5>Click on layer nodes below to change their properties.</h5>
|
||||||
</div>
|
<ul>
|
||||||
<div id="layertree" class="span6">
|
<li><span>OpenAerial layer</span>
|
||||||
<h5>Click on layer nodes below to change their properties.</h5>
|
<fieldset id="layer0">
|
||||||
<ul>
|
<label class="checkbox" for="visible0">
|
||||||
<li><span>OpenAerial layer</span>
|
<input id="visible0" class="visible" type="checkbox"/>visibility
|
||||||
<fieldset id="layer0">
|
</label>
|
||||||
<label class="checkbox" for="visible0">
|
<label>opacity</label>
|
||||||
<input id="visible0" class="visible" type="checkbox"/>visibility
|
<input class="opacity" type="range" min="0" max="1" step="0.01"/>
|
||||||
</label>
|
</fieldset>
|
||||||
<label>opacity</label>
|
</li>
|
||||||
<input class="opacity" type="range" min="0" max="1" step="0.01"/>
|
<li><span>Layer group</span>
|
||||||
</fieldset>
|
<fieldset id="layer1">
|
||||||
</li>
|
<label class="checkbox" for="visible1">
|
||||||
<li><span>Layer group</span>
|
<input id="visible1" class="visible" type="checkbox"/>visibility
|
||||||
<fieldset id="layer1">
|
</label>
|
||||||
<label class="checkbox" for="visible1">
|
<label>opacity</label>
|
||||||
<input id="visible1" class="visible" type="checkbox"/>visibility
|
<input class="opacity" type="range" min="0" max="1" step="0.01"/>
|
||||||
</label>
|
</fieldset>
|
||||||
<label>opacity</label>
|
<ul>
|
||||||
<input class="opacity" type="range" min="0" max="1" step="0.01"/>
|
<li><span>Food insecurity layer</span>
|
||||||
</fieldset>
|
<fieldset id="layer10">
|
||||||
<ul>
|
<label class="checkbox" for="visible10">
|
||||||
<li><span>Food insecurity layer</span>
|
<input id="visible10" class="visible" type="checkbox"/>visibility
|
||||||
<fieldset id="layer10">
|
</label>
|
||||||
<label class="checkbox" for="visible10">
|
<label>opacity</label>
|
||||||
<input id="visible10" class="visible" type="checkbox"/>visibility
|
<input class="opacity" type="range" min="0" max="1" step="0.01"/>
|
||||||
</label>
|
</fieldset>
|
||||||
<label>opacity</label>
|
</li>
|
||||||
<input class="opacity" type="range" min="0" max="1" step="0.01"/>
|
<li><span>World borders layer</span>
|
||||||
</fieldset>
|
<fieldset id="layer11">
|
||||||
</li>
|
<label class="checkbox" for="visible11">
|
||||||
<li><span>World borders layer</span>
|
<input id="visible11" class="visible" type="checkbox"/>visibility
|
||||||
<fieldset id="layer11">
|
</label>
|
||||||
<label class="checkbox" for="visible11">
|
<label>opacity</label>
|
||||||
<input id="visible11" class="visible" type="checkbox"/>visibility
|
<input class="opacity" type="range" min="0" max="1" step="0.01"/>
|
||||||
</label>
|
</fieldset>
|
||||||
<label>opacity</label>
|
</li>
|
||||||
<input class="opacity" type="range" min="0" max="1" step="0.01"/>
|
</ul>
|
||||||
</fieldset>
|
</li>
|
||||||
</li>
|
</ul>
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
layout: example.html
|
layout: strapless.html
|
||||||
title: Layer Spy Example
|
title: Layer Spy
|
||||||
shortdesc: View a portion of one layer over another
|
shortdesc: View a portion of one layer over another
|
||||||
docs: >
|
docs: >
|
||||||
<p>Layer rendering can be manipulated in <code>precompose</code> and <code>postcompose</code> event listeners.
|
<p>Layer rendering can be manipulated in <code>precompose</code> and <code>postcompose</code> event listeners.
|
||||||
@@ -12,8 +12,4 @@ tags: "spy, image manipulation"
|
|||||||
cloak:
|
cloak:
|
||||||
Ak-dzM4wZjSqTlzveKz5u0d4IQ4bRzVI309GxmkgSVr1ewS6iPSrOvOKhA-CJlm3: Your Bing Maps Key from http://bingmapsportal.com/ here
|
Ak-dzM4wZjSqTlzveKz5u0d4IQ4bRzVI309GxmkgSVr1ewS6iPSrOvOKhA-CJlm3: Your Bing Maps Key from http://bingmapsportal.com/ here
|
||||||
---
|
---
|
||||||
<div class="row-fluid">
|
<div id="map" class="map"></div>
|
||||||
<div class="span12">
|
|
||||||
<div id="map" class="map"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|||||||
+12
-5
@@ -14,9 +14,11 @@ var imagery = new ol.layer.Tile({
|
|||||||
source: new ol.source.BingMaps({key: key, imagerySet: 'Aerial'})
|
source: new ol.source.BingMaps({key: key, imagerySet: 'Aerial'})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var container = document.getElementById('map');
|
||||||
|
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
layers: [roads, imagery],
|
layers: [roads, imagery],
|
||||||
target: 'map',
|
target: container,
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
center: ol.proj.fromLonLat([-109, 46.5]),
|
center: ol.proj.fromLonLat([-109, 46.5]),
|
||||||
zoom: 6
|
zoom: 6
|
||||||
@@ -24,22 +26,27 @@ var map = new ol.Map({
|
|||||||
});
|
});
|
||||||
|
|
||||||
var radius = 75;
|
var radius = 75;
|
||||||
$(document).keydown(function(evt) {
|
document.addEventListener('keydown', function(evt) {
|
||||||
if (evt.which === 38) {
|
if (evt.which === 38) {
|
||||||
radius = Math.min(radius + 5, 150);
|
radius = Math.min(radius + 5, 150);
|
||||||
map.render();
|
map.render();
|
||||||
|
evt.preventDefault();
|
||||||
} else if (evt.which === 40) {
|
} else if (evt.which === 40) {
|
||||||
radius = Math.max(radius - 5, 25);
|
radius = Math.max(radius - 5, 25);
|
||||||
map.render();
|
map.render();
|
||||||
|
evt.preventDefault();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// get the pixel position with every move
|
// get the pixel position with every move
|
||||||
var mousePosition = null;
|
var mousePosition = null;
|
||||||
$(map.getViewport()).on('mousemove', function(evt) {
|
|
||||||
mousePosition = map.getEventPixel(evt.originalEvent);
|
container.addEventListener('mousemove', function(event) {
|
||||||
|
mousePosition = map.getEventPixel(event);
|
||||||
map.render();
|
map.render();
|
||||||
}).on('mouseout', function() {
|
});
|
||||||
|
|
||||||
|
container.addEventListener('mouseout', function() {
|
||||||
mousePosition = null;
|
mousePosition = null;
|
||||||
map.render();
|
map.render();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
layout: example.html
|
layout: strapless.html
|
||||||
title: Layer Swipe example
|
title: Layer Swipe
|
||||||
shortdesc: Example of a Layer swipe map.
|
shortdesc: Example of a Layer swipe map.
|
||||||
docs: >
|
docs: >
|
||||||
Example of a Layer swipe map.
|
Example of a Layer swipe map.
|
||||||
@@ -8,9 +8,5 @@ tags: "swipe, openstreetmap"
|
|||||||
cloak:
|
cloak:
|
||||||
Ak-dzM4wZjSqTlzveKz5u0d4IQ4bRzVI309GxmkgSVr1ewS6iPSrOvOKhA-CJlm3: Your Bing Maps Key from http://bingmapsportal.com/ here
|
Ak-dzM4wZjSqTlzveKz5u0d4IQ4bRzVI309GxmkgSVr1ewS6iPSrOvOKhA-CJlm3: Your Bing Maps Key from http://bingmapsportal.com/ here
|
||||||
---
|
---
|
||||||
<div class="row-fluid">
|
<div id="map" class="map"></div>
|
||||||
<div class="span12">
|
<input id="swipe" type="range" style="width: 100%">
|
||||||
<div id="map" class="map"></div>
|
|
||||||
<input id="swipe" type="range" style="width: 100%">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|||||||
@@ -1,20 +1,14 @@
|
|||||||
---
|
---
|
||||||
layout: example.html
|
layout: strapless.html
|
||||||
title: Z-index layer ordering example
|
title: Layer Z-Index
|
||||||
shortdesc: Example of ordering layers using Z-index.
|
shortdesc: Example of ordering layers using Z-index.
|
||||||
docs: >
|
docs: >
|
||||||
|
There are are two managed layers (square and triangle) and one unmanaged layer (star).</br>
|
||||||
|
The Z-index determines the rendering order; with {square: 1, triangle: 0, star: unmanaged} indices, the rendering order is triangle, square and star on top.
|
||||||
|
|
||||||
tags: "layer, ordering, z-index"
|
tags: "layer, ordering, z-index"
|
||||||
---
|
---
|
||||||
<div class="row-fluid">
|
<div id="map" class="map"></div>
|
||||||
<div class="span12">
|
|
||||||
<div id="map" class="map"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
There are are two managed layers (square and triangle) and one unmanaged layer (star).</br>
|
|
||||||
The Z-index determines the rendering order; with {square: 1, triangle: 0, star: unmanaged} indices, the rendering order is triangle, square and star on top.
|
|
||||||
</div>
|
|
||||||
<div>
|
<div>
|
||||||
<label for="idx1">
|
<label for="idx1">
|
||||||
<input type="number" id="idx1"></input>
|
<input type="number" id="idx1"></input>
|
||||||
|
|||||||
@@ -82,11 +82,11 @@ layer0.setMap(map);
|
|||||||
|
|
||||||
|
|
||||||
function bindInputs(id, layer) {
|
function bindInputs(id, layer) {
|
||||||
var idxInput = $('#idx' + id);
|
var idxInput = document.getElementById('idx' + id);
|
||||||
idxInput.on('input change', function() {
|
idxInput.onchange = function() {
|
||||||
layer.setZIndex(parseInt(this.value, 10) || 0);
|
layer.setZIndex(parseInt(this.value, 10) || 0);
|
||||||
});
|
};
|
||||||
idxInput.val(String(layer.getZIndex()));
|
idxInput.value = String(layer.getZIndex());
|
||||||
}
|
}
|
||||||
bindInputs(1, layer1);
|
bindInputs(1, layer1);
|
||||||
bindInputs(2, layer2);
|
bindInputs(2, layer2);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
layout: example.html
|
layout: strapless.html
|
||||||
title: Lazy Source
|
title: Lazy Source
|
||||||
shortdesc: Example of setting a layer source after construction.
|
shortdesc: Example of setting a layer source after construction.
|
||||||
docs: >
|
docs: >
|
||||||
@@ -11,10 +11,6 @@ docs: >
|
|||||||
until its source is set.</p>
|
until its source is set.</p>
|
||||||
tags: "source"
|
tags: "source"
|
||||||
---
|
---
|
||||||
<div class="row-fluid">
|
<div id="map" class="map"></div>
|
||||||
<div class="span12">
|
|
||||||
<div id="map" class="map"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<button id="set-source" class="code">layer.setSource(source)</button>
|
<button id="set-source" class="code">layer.setSource(source)</button>
|
||||||
<button id="unset-source" class="code">layer.setSource(null)</button>
|
<button id="unset-source" class="code">layer.setSource(null)</button>
|
||||||
|
|||||||
@@ -1,13 +1,9 @@
|
|||||||
---
|
---
|
||||||
layout: example.html
|
layout: strapless.html
|
||||||
title: LineString arrows example
|
title: LineString Arrows
|
||||||
shortdesc: Example of drawing arrows for each line string segment.
|
shortdesc: Example of drawing arrows for each line string segment.
|
||||||
docs: >
|
docs: >
|
||||||
Example of drawing arrows for each line string segment.
|
Example of drawing arrows for each line string segment.
|
||||||
tags: "draw, vector, arrow"
|
tags: "draw, vector, arrow"
|
||||||
---
|
---
|
||||||
<div class="row-fluid">
|
<div id="map" class="map"></div>
|
||||||
<div class="span12">
|
|
||||||
<div id="map" class="map"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|||||||
@@ -1,14 +1,10 @@
|
|||||||
---
|
---
|
||||||
layout: example.html
|
layout: strapless.html
|
||||||
title: Localized OpenStreetMap example
|
title: Localized OpenStreetMap
|
||||||
shortdesc: Example of a localized OpenStreetMap map with a custom tile server and a custom attribution.
|
shortdesc: Example of a localized OpenStreetMap map with a custom tile server and a custom attribution.
|
||||||
docs: >
|
docs: >
|
||||||
<p>The base layer is <a href="http://www.opencyclemap.org/">OpenCycleMap</a> with an overlay from <a href="http://www.openseamap.org/">OpenSeaMap</a>. The OpenSeaMap tile server
|
<p>The base layer is <a href="http://www.opencyclemap.org/">OpenCycleMap</a> with an overlay from <a href="http://www.openseamap.org/">OpenSeaMap</a>. The OpenSeaMap tile server
|
||||||
does not support <a href="http://enable-cors.org/">CORS</a> headers.</p>
|
does not support <a href="http://enable-cors.org/">CORS</a> headers.</p>
|
||||||
tags: "cors, localized-openstreetmap, openseamap, openstreetmap"
|
tags: "cors, localized-openstreetmap, openseamap, openstreetmap"
|
||||||
---
|
---
|
||||||
<div class="row-fluid">
|
<div id="map" class="map"></div>
|
||||||
<div class="span12">
|
|
||||||
<div id="map" class="map"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|||||||
@@ -6,9 +6,6 @@ goog.require('ol.layer.Tile');
|
|||||||
goog.require('ol.source.OSM');
|
goog.require('ol.source.OSM');
|
||||||
|
|
||||||
|
|
||||||
// tiles.openseamap.org does not set CORS headers, so we have to disable
|
|
||||||
// crossOrigin and we cannot use WebGL.
|
|
||||||
|
|
||||||
var openCycleMapLayer = new ol.layer.Tile({
|
var openCycleMapLayer = new ol.layer.Tile({
|
||||||
source: new ol.source.OSM({
|
source: new ol.source.OSM({
|
||||||
attributions: [
|
attributions: [
|
||||||
|
|||||||
Reference in New Issue
Block a user