Transformed

This commit is contained in:
Tim Schaub
2017-12-11 16:29:33 -07:00
parent 1cdb6a66f0
commit 7f47883c48
737 changed files with 22216 additions and 21609 deletions

View File

@@ -1,3 +1,10 @@
/*
* Jugl.js -- JavaScript Template Library
*
* Copyright 2007-2010 Tim Schaub
* Released under the MIT license. Please see
* http://github.com/tschaub/jugl/blob/master/license.txt for the full license.
*/
/* /*
* Jugl.js -- JavaScript Template Library * Jugl.js -- JavaScript Template Library
* *

View File

@@ -1,23 +1,23 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.control'); import _ol_control_ from '../src/ol/control.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.source.OSM'); import _ol_source_OSM_ from '../src/ol/source/OSM.js';
var map = new ol.Map({ var map = new _ol_Map_({
layers: [ layers: [
new ol.layer.Tile({ new _ol_layer_Tile_({
source: new ol.source.OSM() source: new _ol_source_OSM_()
}) })
], ],
target: 'map', target: 'map',
controls: ol.control.defaults({ controls: _ol_control_.defaults({
attributionOptions: { attributionOptions: {
collapsible: false collapsible: false
} }
}), }),
view: new ol.View({ view: new _ol_View_({
center: [0, 0], center: [0, 0],
zoom: 2 zoom: 2
}) })

View File

@@ -1,27 +1,27 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.easing'); import _ol_easing_ from '../src/ol/easing.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.proj'); import _ol_proj_ from '../src/ol/proj.js';
goog.require('ol.source.OSM'); import _ol_source_OSM_ from '../src/ol/source/OSM.js';
var london = ol.proj.fromLonLat([-0.12755, 51.507222]); var london = _ol_proj_.fromLonLat([-0.12755, 51.507222]);
var moscow = ol.proj.fromLonLat([37.6178, 55.7517]); var moscow = _ol_proj_.fromLonLat([37.6178, 55.7517]);
var istanbul = ol.proj.fromLonLat([28.9744, 41.0128]); var istanbul = _ol_proj_.fromLonLat([28.9744, 41.0128]);
var rome = ol.proj.fromLonLat([12.5, 41.9]); var rome = _ol_proj_.fromLonLat([12.5, 41.9]);
var bern = ol.proj.fromLonLat([7.4458, 46.95]); var bern = _ol_proj_.fromLonLat([7.4458, 46.95]);
var view = new ol.View({ var view = new _ol_View_({
center: istanbul, center: istanbul,
zoom: 6 zoom: 6
}); });
var map = new ol.Map({ var map = new _ol_Map_({
target: 'map', target: 'map',
layers: [ layers: [
new ol.layer.Tile({ new _ol_layer_Tile_({
preload: 4, preload: 4,
source: new ol.source.OSM() source: new _ol_source_OSM_()
}) })
], ],
// Improve user experience by loading tiles while animating. Will make // Improve user experience by loading tiles while animating. Will make
@@ -79,11 +79,11 @@ onClick('rotate-around-rome', function() {
view.animate({ view.animate({
rotation: rotation + Math.PI, rotation: rotation + Math.PI,
anchor: rome, anchor: rome,
easing: ol.easing.easeIn easing: _ol_easing_.easeIn
}, { }, {
rotation: rotation + 2 * Math.PI, rotation: rotation + 2 * Math.PI,
anchor: rome, anchor: rome,
easing: ol.easing.easeOut easing: _ol_easing_.easeOut
}); });
}); });
@@ -119,11 +119,11 @@ onClick('spin-to-rome', function() {
center[1] + (rome[1] - center[1]) / 2 center[1] + (rome[1] - center[1]) / 2
], ],
rotation: Math.PI, rotation: Math.PI,
easing: ol.easing.easeIn easing: _ol_easing_.easeIn
}, { }, {
center: rome, center: rome,
rotation: 2 * Math.PI, rotation: 2 * Math.PI,
easing: ol.easing.easeOut easing: _ol_easing_.easeOut
}); });
}); });

View File

@@ -1,29 +1,29 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.layer.Image'); import _ol_layer_Image_ from '../src/ol/layer/Image.js';
goog.require('ol.source.OSM'); import _ol_source_OSM_ from '../src/ol/source/OSM.js';
goog.require('ol.source.ImageArcGISRest'); import _ol_source_ImageArcGISRest_ from '../src/ol/source/ImageArcGISRest.js';
var url = 'https://sampleserver1.arcgisonline.com/ArcGIS/rest/services/' + var url = 'https://sampleserver1.arcgisonline.com/ArcGIS/rest/services/' +
'Specialty/ESRI_StateCityHighway_USA/MapServer'; 'Specialty/ESRI_StateCityHighway_USA/MapServer';
var layers = [ var layers = [
new ol.layer.Tile({ new _ol_layer_Tile_({
source: new ol.source.OSM() source: new _ol_source_OSM_()
}), }),
new ol.layer.Image({ new _ol_layer_Image_({
source: new ol.source.ImageArcGISRest({ source: new _ol_source_ImageArcGISRest_({
ratio: 1, ratio: 1,
params: {}, params: {},
url: url url: url
}) })
}) })
]; ];
var map = new ol.Map({ var map = new _ol_Map_({
layers: layers, layers: layers,
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: [-10997148, 4569099], center: [-10997148, 4569099],
zoom: 4 zoom: 4
}) })

View File

@@ -1,27 +1,27 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.source.OSM'); import _ol_source_OSM_ from '../src/ol/source/OSM.js';
goog.require('ol.source.TileArcGISRest'); import _ol_source_TileArcGISRest_ from '../src/ol/source/TileArcGISRest.js';
var url = 'https://sampleserver1.arcgisonline.com/ArcGIS/rest/services/' + var url = 'https://sampleserver1.arcgisonline.com/ArcGIS/rest/services/' +
'Specialty/ESRI_StateCityHighway_USA/MapServer'; 'Specialty/ESRI_StateCityHighway_USA/MapServer';
var layers = [ var layers = [
new ol.layer.Tile({ new _ol_layer_Tile_({
source: new ol.source.OSM() source: new _ol_source_OSM_()
}), }),
new ol.layer.Tile({ new _ol_layer_Tile_({
extent: [-13884991, 2870341, -7455066, 6338219], extent: [-13884991, 2870341, -7455066, 6338219],
source: new ol.source.TileArcGISRest({ source: new _ol_source_TileArcGISRest_({
url: url url: url
}) })
}) })
]; ];
var map = new ol.Map({ var map = new _ol_Map_({
layers: layers, layers: layers,
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: [-10997148, 4569099], center: [-10997148, 4569099],
zoom: 4 zoom: 4
}) })

View File

@@ -1,22 +1,22 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.control'); import _ol_control_ from '../src/ol/control.js';
goog.require('ol.control.Attribution'); import _ol_control_Attribution_ from '../src/ol/control/Attribution.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.source.OSM'); import _ol_source_OSM_ from '../src/ol/source/OSM.js';
var attribution = new ol.control.Attribution({ var attribution = new _ol_control_Attribution_({
collapsible: false collapsible: false
}); });
var map = new ol.Map({ var map = new _ol_Map_({
layers: [ layers: [
new ol.layer.Tile({ new _ol_layer_Tile_({
source: new ol.source.OSM() source: new _ol_source_OSM_()
}) })
], ],
controls: ol.control.defaults({attribution: false}).extend([attribution]), controls: _ol_control_.defaults({attribution: false}).extend([attribution]),
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: [0, 0], center: [0, 0],
zoom: 2 zoom: 2
}) })

View File

@@ -1,7 +1,7 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.source.BingMaps'); import _ol_source_BingMaps_ from '../src/ol/source/BingMaps.js';
var styles = [ var styles = [
@@ -15,10 +15,10 @@ var styles = [
var layers = []; var layers = [];
var i, ii; var i, ii;
for (i = 0, ii = styles.length; i < ii; ++i) { for (i = 0, ii = styles.length; i < ii; ++i) {
layers.push(new ol.layer.Tile({ layers.push(new _ol_layer_Tile_({
visible: false, visible: false,
preload: Infinity, preload: Infinity,
source: new ol.source.BingMaps({ source: new _ol_source_BingMaps_({
key: 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5', key: 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5',
imagerySet: styles[i] imagerySet: styles[i]
// use maxZoom 19 to see stretched tiles instead of the BingMaps // use maxZoom 19 to see stretched tiles instead of the BingMaps
@@ -27,13 +27,13 @@ for (i = 0, ii = styles.length; i < ii; ++i) {
}) })
})); }));
} }
var map = new ol.Map({ var map = new _ol_Map_({
layers: layers, layers: layers,
// Improve user experience by loading tiles while dragging/zooming. Will make // Improve user experience by loading tiles while dragging/zooming. Will make
// zooming choppy on mobile or slow devices. // zooming choppy on mobile or slow devices.
loadTilesWhileInteracting: true, loadTilesWhileInteracting: true,
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: [-6655.5402445057125, 6709968.258934638], center: [-6655.5402445057125, 6709968.258934638],
zoom: 13 zoom: 13
}) })

View File

@@ -1,29 +1,29 @@
goog.require('ol.Feature'); import _ol_Feature_ from '../src/ol/Feature.js';
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.geom.Point'); import _ol_geom_Point_ from '../src/ol/geom/Point.js';
goog.require('ol.layer.Vector'); import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
goog.require('ol.source.Vector'); import _ol_source_Vector_ from '../src/ol/source/Vector.js';
goog.require('ol.style.Circle'); import _ol_style_Circle_ from '../src/ol/style/Circle.js';
goog.require('ol.style.Fill'); import _ol_style_Fill_ from '../src/ol/style/Fill.js';
goog.require('ol.style.Stroke'); import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
goog.require('ol.style.Style'); import _ol_style_Style_ from '../src/ol/style/Style.js';
// Create separate layers for red, green an blue circles. // Create separate layers for red, green an blue circles.
// //
// Every layer has one feature that is styled with a circle, together the // Every layer has one feature that is styled with a circle, together the
// features form the corners of an equilateral triangle and their styles overlap // features form the corners of an equilateral triangle and their styles overlap
var redLayer = new ol.layer.Vector({ var redLayer = new _ol_layer_Vector_({
source: new ol.source.Vector({ source: new _ol_source_Vector_({
features: [new ol.Feature(new ol.geom.Point([0, 0]))] features: [new _ol_Feature_(new _ol_geom_Point_([0, 0]))]
}), }),
style: new ol.style.Style({ style: new _ol_style_Style_({
image: new ol.style.Circle({ image: new _ol_style_Circle_({
fill: new ol.style.Fill({ fill: new _ol_style_Fill_({
color: 'rgba(255,0,0,0.8)' color: 'rgba(255,0,0,0.8)'
}), }),
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
color: 'rgb(255,0,0)', color: 'rgb(255,0,0)',
width: 15 width: 15
}), }),
@@ -31,17 +31,17 @@ var redLayer = new ol.layer.Vector({
}) })
}) })
}); });
var greenLayer = new ol.layer.Vector({ var greenLayer = new _ol_layer_Vector_({
source: new ol.source.Vector({ source: new _ol_source_Vector_({
// 433.013 is roughly 250 * Math.sqrt(3) // 433.013 is roughly 250 * Math.sqrt(3)
features: [new ol.Feature(new ol.geom.Point([250, 433.013]))] features: [new _ol_Feature_(new _ol_geom_Point_([250, 433.013]))]
}), }),
style: new ol.style.Style({ style: new _ol_style_Style_({
image: new ol.style.Circle({ image: new _ol_style_Circle_({
fill: new ol.style.Fill({ fill: new _ol_style_Fill_({
color: 'rgba(0,255,0,0.8)' color: 'rgba(0,255,0,0.8)'
}), }),
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
color: 'rgb(0,255,0)', color: 'rgb(0,255,0)',
width: 15 width: 15
}), }),
@@ -49,16 +49,16 @@ var greenLayer = new ol.layer.Vector({
}) })
}) })
}); });
var blueLayer = new ol.layer.Vector({ var blueLayer = new _ol_layer_Vector_({
source: new ol.source.Vector({ source: new _ol_source_Vector_({
features: [new ol.Feature(new ol.geom.Point([500, 0]))] features: [new _ol_Feature_(new _ol_geom_Point_([500, 0]))]
}), }),
style: new ol.style.Style({ style: new _ol_style_Style_({
image: new ol.style.Circle({ image: new _ol_style_Circle_({
fill: new ol.style.Fill({ fill: new _ol_style_Fill_({
color: 'rgba(0,0,255,0.8)' color: 'rgba(0,0,255,0.8)'
}), }),
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
color: 'rgb(0,0,255)', color: 'rgb(0,0,255)',
width: 15 width: 15
}), }),
@@ -69,14 +69,14 @@ var blueLayer = new ol.layer.Vector({
// Create the map, the view is centered on the triangle. Zooming and panning is // Create the map, the view is centered on the triangle. Zooming and panning is
// restricted to a sane area // restricted to a sane area
var map = new ol.Map({ var map = new _ol_Map_({
layers: [ layers: [
redLayer, redLayer,
greenLayer, greenLayer,
blueLayer blueLayer
], ],
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: [250, 220], center: [250, 220],
extent: [0, 0, 500, 500], extent: [0, 0, 500, 500],
resolution: 4, resolution: 4,

View File

@@ -1,46 +1,46 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.events.condition'); import _ol_events_condition_ from '../src/ol/events/condition.js';
goog.require('ol.format.GeoJSON'); import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js';
goog.require('ol.interaction.DragBox'); import _ol_interaction_DragBox_ from '../src/ol/interaction/DragBox.js';
goog.require('ol.interaction.Select'); import _ol_interaction_Select_ from '../src/ol/interaction/Select.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.layer.Vector'); import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
goog.require('ol.source.OSM'); import _ol_source_OSM_ from '../src/ol/source/OSM.js';
goog.require('ol.source.Vector'); import _ol_source_Vector_ from '../src/ol/source/Vector.js';
var vectorSource = new ol.source.Vector({ var vectorSource = new _ol_source_Vector_({
url: 'data/geojson/countries.geojson', url: 'data/geojson/countries.geojson',
format: new ol.format.GeoJSON() format: new _ol_format_GeoJSON_()
}); });
var map = new ol.Map({ var map = new _ol_Map_({
layers: [ layers: [
new ol.layer.Tile({ new _ol_layer_Tile_({
source: new ol.source.OSM() source: new _ol_source_OSM_()
}), }),
new ol.layer.Vector({ new _ol_layer_Vector_({
source: vectorSource source: vectorSource
}) })
], ],
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: [0, 0], center: [0, 0],
zoom: 2 zoom: 2
}) })
}); });
// a normal select interaction to handle click // a normal select interaction to handle click
var select = new ol.interaction.Select(); var select = new _ol_interaction_Select_();
map.addInteraction(select); map.addInteraction(select);
var selectedFeatures = select.getFeatures(); var selectedFeatures = select.getFeatures();
// a DragBox interaction used to select features by drawing boxes // a DragBox interaction used to select features by drawing boxes
var dragBox = new ol.interaction.DragBox({ var dragBox = new _ol_interaction_DragBox_({
condition: ol.events.condition.platformModifierKeyOnly condition: _ol_events_condition_.platformModifierKeyOnly
}); });
map.addInteraction(dragBox); map.addInteraction(dragBox);

View File

@@ -1,16 +1,16 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.source.OSM'); import _ol_source_OSM_ from '../src/ol/source/OSM.js';
var map = new ol.Map({ var map = new _ol_Map_({
layers: [ layers: [
new ol.layer.Tile({ new _ol_layer_Tile_({
source: new ol.source.OSM() source: new _ol_source_OSM_()
}) })
], ],
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: [-8730000, 5930000], center: [-8730000, 5930000],
rotation: Math.PI / 5, rotation: Math.PI / 5,
zoom: 8 zoom: 8

View File

@@ -1,21 +1,21 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.extent'); import _ol_extent_ from '../src/ol/extent.js';
goog.require('ol.format.GeoJSON'); import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js';
goog.require('ol.has'); import _ol_has_ from '../src/ol/has.js';
goog.require('ol.layer.Vector'); import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
goog.require('ol.proj'); import _ol_proj_ from '../src/ol/proj.js';
goog.require('ol.source.Vector'); import _ol_source_Vector_ from '../src/ol/source/Vector.js';
goog.require('ol.style.Fill'); import _ol_style_Fill_ from '../src/ol/style/Fill.js';
goog.require('ol.style.Stroke'); import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
goog.require('ol.style.Style'); import _ol_style_Style_ from '../src/ol/style/Style.js';
var canvas = document.createElement('canvas'); var canvas = document.createElement('canvas');
var context = canvas.getContext('2d'); var context = canvas.getContext('2d');
// Gradient and pattern are in canvas pixel space, so we adjust for the // Gradient and pattern are in canvas pixel space, so we adjust for the
// renderer's pixel ratio // renderer's pixel ratio
var pixelRatio = ol.has.DEVICE_PIXEL_RATIO; var pixelRatio = _ol_has_.DEVICE_PIXEL_RATIO;
// Generate a rainbow gradient // Generate a rainbow gradient
function gradient(feature, resolution) { function gradient(feature, resolution) {
@@ -25,7 +25,7 @@ function gradient(feature, resolution) {
// we just divide the geometry's extent width by resolution and multiply with // we just divide the geometry's extent width by resolution and multiply with
// pixelRatio to match the renderer's pixel coordinate system. // pixelRatio to match the renderer's pixel coordinate system.
var grad = context.createLinearGradient(0, 0, var grad = context.createLinearGradient(0, 0,
ol.extent.getWidth(extent) / resolution * pixelRatio, 0); _ol_extent_.getWidth(extent) / resolution * pixelRatio, 0);
grad.addColorStop(0, 'red'); grad.addColorStop(0, 'red');
grad.addColorStop(1 / 6, 'orange'); grad.addColorStop(1 / 6, 'orange');
grad.addColorStop(2 / 6, 'yellow'); grad.addColorStop(2 / 6, 'yellow');
@@ -57,10 +57,10 @@ var pattern = (function() {
}()); }());
// Generate style for gradient or pattern fill // Generate style for gradient or pattern fill
var fill = new ol.style.Fill(); var fill = new _ol_style_Fill_();
var style = new ol.style.Style({ var style = new _ol_style_Style_({
fill: fill, fill: fill,
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
color: '#333', color: '#333',
width: 2 width: 2
}) })
@@ -81,22 +81,22 @@ var getStackedStyle = function(feature, resolution) {
}; };
// Create a vector layer that makes use of the style function above… // Create a vector layer that makes use of the style function above…
var vectorLayer = new ol.layer.Vector({ var vectorLayer = new _ol_layer_Vector_({
source: new ol.source.Vector({ source: new _ol_source_Vector_({
url: 'data/geojson/countries.geojson', url: 'data/geojson/countries.geojson',
format: new ol.format.GeoJSON() format: new _ol_format_GeoJSON_()
}), }),
style: getStackedStyle style: getStackedStyle
}); });
// … finally create a map with that layer. // … finally create a map with that layer.
var map = new ol.Map({ var map = new _ol_Map_({
layers: [ layers: [
vectorLayer vectorLayer
], ],
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: ol.proj.fromLonLat([7, 52]), center: _ol_proj_.fromLonLat([7, 52]),
zoom: 3 zoom: 3
}) })
}); });

View File

@@ -1,33 +1,33 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.control'); import _ol_control_ from '../src/ol/control.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.proj'); import _ol_proj_ from '../src/ol/proj.js';
goog.require('ol.source.OSM'); import _ol_source_OSM_ from '../src/ol/source/OSM.js';
goog.require('ol.source.TileDebug'); import _ol_source_TileDebug_ from '../src/ol/source/TileDebug.js';
var osmSource = new ol.source.OSM(); var osmSource = new _ol_source_OSM_();
var map = new ol.Map({ var map = new _ol_Map_({
layers: [ layers: [
new ol.layer.Tile({ new _ol_layer_Tile_({
source: osmSource source: osmSource
}), }),
new ol.layer.Tile({ new _ol_layer_Tile_({
source: new ol.source.TileDebug({ source: new _ol_source_TileDebug_({
projection: 'EPSG:3857', projection: 'EPSG:3857',
tileGrid: osmSource.getTileGrid() tileGrid: osmSource.getTileGrid()
}) })
}) })
], ],
target: 'map', target: 'map',
controls: ol.control.defaults({ controls: _ol_control_.defaults({
attributionOptions: { attributionOptions: {
collapsible: false collapsible: false
} }
}), }),
view: new ol.View({ view: new _ol_View_({
center: ol.proj.transform( center: _ol_proj_.transform(
[-0.1275, 51.507222], 'EPSG:4326', 'EPSG:3857'), [-0.1275, 51.507222], 'EPSG:4326', 'EPSG:3857'),
zoom: 10 zoom: 10
}) })

View File

@@ -1,8 +1,8 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.source.CartoDB'); import _ol_source_CartoDB_ from '../src/ol/source/CartoDB.js';
goog.require('ol.source.OSM'); import _ol_source_OSM_ from '../src/ol/source/OSM.js';
var mapConfig = { var mapConfig = {
'layers': [{ 'layers': [{
@@ -15,22 +15,22 @@ var mapConfig = {
}] }]
}; };
var cartoDBSource = new ol.source.CartoDB({ var cartoDBSource = new _ol_source_CartoDB_({
account: 'documentation', account: 'documentation',
config: mapConfig config: mapConfig
}); });
var map = new ol.Map({ var map = new _ol_Map_({
layers: [ layers: [
new ol.layer.Tile({ new _ol_layer_Tile_({
source: new ol.source.OSM() source: new _ol_source_OSM_()
}), }),
new ol.layer.Tile({ new _ol_layer_Tile_({
source: cartoDBSource source: cartoDBSource
}) })
], ],
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: [0, 0], center: [0, 0],
zoom: 2 zoom: 2
}) })

View File

@@ -1,56 +1,56 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.control'); import _ol_control_ from '../src/ol/control.js';
goog.require('ol.format.GeoJSON'); import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.layer.Vector'); import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
goog.require('ol.source.OSM'); import _ol_source_OSM_ from '../src/ol/source/OSM.js';
goog.require('ol.source.Vector'); import _ol_source_Vector_ from '../src/ol/source/Vector.js';
goog.require('ol.style.Circle'); import _ol_style_Circle_ from '../src/ol/style/Circle.js';
goog.require('ol.style.Fill'); import _ol_style_Fill_ from '../src/ol/style/Fill.js';
goog.require('ol.style.Stroke'); import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
goog.require('ol.style.Style'); import _ol_style_Style_ from '../src/ol/style/Style.js';
var source = new ol.source.Vector({ var source = new _ol_source_Vector_({
url: 'data/geojson/switzerland.geojson', url: 'data/geojson/switzerland.geojson',
format: new ol.format.GeoJSON() format: new _ol_format_GeoJSON_()
}); });
var style = new ol.style.Style({ var style = new _ol_style_Style_({
fill: new ol.style.Fill({ fill: new _ol_style_Fill_({
color: 'rgba(255, 255, 255, 0.6)' color: 'rgba(255, 255, 255, 0.6)'
}), }),
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
color: '#319FD3', color: '#319FD3',
width: 1 width: 1
}), }),
image: new ol.style.Circle({ image: new _ol_style_Circle_({
radius: 5, radius: 5,
fill: new ol.style.Fill({ fill: new _ol_style_Fill_({
color: 'rgba(255, 255, 255, 0.6)' color: 'rgba(255, 255, 255, 0.6)'
}), }),
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
color: '#319FD3', color: '#319FD3',
width: 1 width: 1
}) })
}) })
}); });
var vectorLayer = new ol.layer.Vector({ var vectorLayer = new _ol_layer_Vector_({
source: source, source: source,
style: style style: style
}); });
var view = new ol.View({ var view = new _ol_View_({
center: [0, 0], center: [0, 0],
zoom: 1 zoom: 1
}); });
var map = new ol.Map({ var map = new _ol_Map_({
layers: [ layers: [
new ol.layer.Tile({ new _ol_layer_Tile_({
source: new ol.source.OSM() source: new _ol_source_OSM_()
}), }),
vectorLayer vectorLayer
], ],
target: 'map', target: 'map',
controls: ol.control.defaults({ controls: _ol_control_.defaults({
attributionOptions: { attributionOptions: {
collapsible: false collapsible: false
} }

View File

@@ -1,17 +1,17 @@
goog.require('ol.Feature'); import _ol_Feature_ from '../src/ol/Feature.js';
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.geom.Point'); import _ol_geom_Point_ from '../src/ol/geom/Point.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.layer.Vector'); import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
goog.require('ol.source.Cluster'); import _ol_source_Cluster_ from '../src/ol/source/Cluster.js';
goog.require('ol.source.OSM'); import _ol_source_OSM_ from '../src/ol/source/OSM.js';
goog.require('ol.source.Vector'); import _ol_source_Vector_ from '../src/ol/source/Vector.js';
goog.require('ol.style.Circle'); import _ol_style_Circle_ from '../src/ol/style/Circle.js';
goog.require('ol.style.Fill'); import _ol_style_Fill_ from '../src/ol/style/Fill.js';
goog.require('ol.style.Stroke'); import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
goog.require('ol.style.Style'); import _ol_style_Style_ from '../src/ol/style/Style.js';
goog.require('ol.style.Text'); import _ol_style_Text_ from '../src/ol/style/Text.js';
var distance = document.getElementById('distance'); var distance = document.getElementById('distance');
@@ -21,38 +21,38 @@ var features = new Array(count);
var e = 4500000; var e = 4500000;
for (var i = 0; i < count; ++i) { for (var i = 0; i < count; ++i) {
var coordinates = [2 * e * Math.random() - e, 2 * e * Math.random() - e]; var coordinates = [2 * e * Math.random() - e, 2 * e * Math.random() - e];
features[i] = new ol.Feature(new ol.geom.Point(coordinates)); features[i] = new _ol_Feature_(new _ol_geom_Point_(coordinates));
} }
var source = new ol.source.Vector({ var source = new _ol_source_Vector_({
features: features features: features
}); });
var clusterSource = new ol.source.Cluster({ var clusterSource = new _ol_source_Cluster_({
distance: parseInt(distance.value, 10), distance: parseInt(distance.value, 10),
source: source source: source
}); });
var styleCache = {}; var styleCache = {};
var clusters = new ol.layer.Vector({ var clusters = new _ol_layer_Vector_({
source: clusterSource, source: clusterSource,
style: function(feature) { style: function(feature) {
var size = feature.get('features').length; var size = feature.get('features').length;
var style = styleCache[size]; var style = styleCache[size];
if (!style) { if (!style) {
style = new ol.style.Style({ style = new _ol_style_Style_({
image: new ol.style.Circle({ image: new _ol_style_Circle_({
radius: 10, radius: 10,
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
color: '#fff' color: '#fff'
}), }),
fill: new ol.style.Fill({ fill: new _ol_style_Fill_({
color: '#3399CC' color: '#3399CC'
}) })
}), }),
text: new ol.style.Text({ text: new _ol_style_Text_({
text: size.toString(), text: size.toString(),
fill: new ol.style.Fill({ fill: new _ol_style_Fill_({
color: '#fff' color: '#fff'
}) })
}) })
@@ -63,14 +63,14 @@ var clusters = new ol.layer.Vector({
} }
}); });
var raster = new ol.layer.Tile({ var raster = new _ol_layer_Tile_({
source: new ol.source.OSM() source: new _ol_source_OSM_()
}); });
var map = new ol.Map({ var map = new _ol_Map_({
layers: [raster, clusters], layers: [raster, clusters],
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: [0, 0], center: [0, 0],
zoom: 2 zoom: 2
}) })

View File

@@ -1,9 +1,9 @@
// NOCOMPILE // NOCOMPILE
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.layer.Image'); import _ol_layer_Image_ from '../src/ol/layer/Image.js';
goog.require('ol.source.Raster'); import _ol_source_Raster_ from '../src/ol/source/Raster.js';
goog.require('ol.source.Stamen'); import _ol_source_Stamen_ from '../src/ol/source/Stamen.js';
/** /**
@@ -100,8 +100,8 @@ function xyz2rgb(x) {
12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055); 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055);
} }
var raster = new ol.source.Raster({ var raster = new _ol_source_Raster_({
sources: [new ol.source.Stamen({ sources: [new _ol_source_Stamen_({
layer: 'watercolor', layer: 'watercolor',
transition: 0 transition: 0
})], })],
@@ -148,14 +148,14 @@ raster.on('beforeoperations', function(event) {
} }
}); });
var map = new ol.Map({ var map = new _ol_Map_({
layers: [ layers: [
new ol.layer.Image({ new _ol_layer_Image_({
source: raster source: raster
}) })
], ],
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: [0, 2500000], center: [0, 2500000],
zoom: 2, zoom: 2,
maxZoom: 18 maxZoom: 18

View File

@@ -1,10 +1,10 @@
goog.require('ol'); import _ol_ from '../src/ol.js';
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.control'); import _ol_control_ from '../src/ol/control.js';
goog.require('ol.control.Control'); import _ol_control_Control_ from '../src/ol/control/Control.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.source.OSM'); import _ol_source_OSM_ from '../src/ol/source/OSM.js';
/** /**
@@ -43,13 +43,13 @@ app.RotateNorthControl = function(opt_options) {
element.className = 'rotate-north ol-unselectable ol-control'; element.className = 'rotate-north ol-unselectable ol-control';
element.appendChild(button); element.appendChild(button);
ol.control.Control.call(this, { _ol_control_Control_.call(this, {
element: element, element: element,
target: options.target target: options.target
}); });
}; };
ol.inherits(app.RotateNorthControl, ol.control.Control); _ol_.inherits(app.RotateNorthControl, _ol_control_Control_);
// //
@@ -57,8 +57,8 @@ ol.inherits(app.RotateNorthControl, ol.control.Control);
// //
var map = new ol.Map({ var map = new _ol_Map_({
controls: ol.control.defaults({ controls: _ol_control_.defaults({
attributionOptions: { attributionOptions: {
collapsible: false collapsible: false
} }
@@ -66,12 +66,12 @@ var map = new ol.Map({
new app.RotateNorthControl() new app.RotateNorthControl()
]), ]),
layers: [ layers: [
new ol.layer.Tile({ new _ol_layer_Tile_({
source: new ol.source.OSM() source: new _ol_source_OSM_()
}) })
], ],
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: [0, 0], center: [0, 0],
zoom: 3, zoom: 3,
rotation: 1 rotation: 1

View File

@@ -1,7 +1,7 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.source.OSM'); import _ol_source_OSM_ from '../src/ol/source/OSM.js';
var logoElement = document.createElement('a'); var logoElement = document.createElement('a');
logoElement.href = 'https://www.osgeo.org/'; logoElement.href = 'https://www.osgeo.org/';
@@ -12,14 +12,14 @@ logoImage.src = 'https://www.osgeo.org/sites/all/themes/osgeo/logo.png';
logoElement.appendChild(logoImage); logoElement.appendChild(logoImage);
var map = new ol.Map({ var map = new _ol_Map_({
layers: [ layers: [
new ol.layer.Tile({ new _ol_layer_Tile_({
source: new ol.source.OSM() source: new _ol_source_OSM_()
}) })
], ],
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: [0, 0], center: [0, 0],
zoom: 2 zoom: 2
}), }),

View File

@@ -1,20 +1,20 @@
goog.require('ol'); import _ol_ from '../src/ol.js';
goog.require('ol.Feature'); import _ol_Feature_ from '../src/ol/Feature.js';
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.geom.LineString'); import _ol_geom_LineString_ from '../src/ol/geom/LineString.js';
goog.require('ol.geom.Point'); import _ol_geom_Point_ from '../src/ol/geom/Point.js';
goog.require('ol.geom.Polygon'); import _ol_geom_Polygon_ from '../src/ol/geom/Polygon.js';
goog.require('ol.interaction'); import _ol_interaction_ from '../src/ol/interaction.js';
goog.require('ol.interaction.Pointer'); import _ol_interaction_Pointer_ from '../src/ol/interaction/Pointer.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.layer.Vector'); import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
goog.require('ol.source.TileJSON'); import _ol_source_TileJSON_ from '../src/ol/source/TileJSON.js';
goog.require('ol.source.Vector'); import _ol_source_Vector_ from '../src/ol/source/Vector.js';
goog.require('ol.style.Fill'); import _ol_style_Fill_ from '../src/ol/style/Fill.js';
goog.require('ol.style.Icon'); import _ol_style_Icon_ from '../src/ol/style/Icon.js';
goog.require('ol.style.Stroke'); import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
goog.require('ol.style.Style'); import _ol_style_Style_ from '../src/ol/style/Style.js';
/** /**
@@ -29,7 +29,7 @@ var app = {};
*/ */
app.Drag = function() { app.Drag = function() {
ol.interaction.Pointer.call(this, { _ol_interaction_Pointer_.call(this, {
handleDownEvent: app.Drag.prototype.handleDownEvent, handleDownEvent: app.Drag.prototype.handleDownEvent,
handleDragEvent: app.Drag.prototype.handleDragEvent, handleDragEvent: app.Drag.prototype.handleDragEvent,
handleMoveEvent: app.Drag.prototype.handleMoveEvent, handleMoveEvent: app.Drag.prototype.handleMoveEvent,
@@ -61,7 +61,7 @@ app.Drag = function() {
this.previousCursor_ = undefined; this.previousCursor_ = undefined;
}; };
ol.inherits(app.Drag, ol.interaction.Pointer); _ol_.inherits(app.Drag, _ol_interaction_Pointer_);
/** /**
@@ -134,48 +134,48 @@ app.Drag.prototype.handleUpEvent = function() {
}; };
var pointFeature = new ol.Feature(new ol.geom.Point([0, 0])); var pointFeature = new _ol_Feature_(new _ol_geom_Point_([0, 0]));
var lineFeature = new ol.Feature( var lineFeature = new _ol_Feature_(
new ol.geom.LineString([[-1e7, 1e6], [-1e6, 3e6]])); new _ol_geom_LineString_([[-1e7, 1e6], [-1e6, 3e6]]));
var polygonFeature = new ol.Feature( var polygonFeature = new _ol_Feature_(
new ol.geom.Polygon([[[-3e6, -1e6], [-3e6, 1e6], new _ol_geom_Polygon_([[[-3e6, -1e6], [-3e6, 1e6],
[-1e6, 1e6], [-1e6, -1e6], [-3e6, -1e6]]])); [-1e6, 1e6], [-1e6, -1e6], [-3e6, -1e6]]]));
var map = new ol.Map({ var map = new _ol_Map_({
interactions: ol.interaction.defaults().extend([new app.Drag()]), interactions: _ol_interaction_.defaults().extend([new app.Drag()]),
layers: [ layers: [
new ol.layer.Tile({ new _ol_layer_Tile_({
source: new ol.source.TileJSON({ source: new _ol_source_TileJSON_({
url: 'https://api.tiles.mapbox.com/v3/mapbox.geography-class.json?secure' url: 'https://api.tiles.mapbox.com/v3/mapbox.geography-class.json?secure'
}) })
}), }),
new ol.layer.Vector({ new _ol_layer_Vector_({
source: new ol.source.Vector({ source: new _ol_source_Vector_({
features: [pointFeature, lineFeature, polygonFeature] features: [pointFeature, lineFeature, polygonFeature]
}), }),
style: new ol.style.Style({ style: new _ol_style_Style_({
image: new ol.style.Icon(/** @type {olx.style.IconOptions} */ ({ image: new _ol_style_Icon_(/** @type {olx.style.IconOptions} */ ({
anchor: [0.5, 46], anchor: [0.5, 46],
anchorXUnits: 'fraction', anchorXUnits: 'fraction',
anchorYUnits: 'pixels', anchorYUnits: 'pixels',
opacity: 0.95, opacity: 0.95,
src: 'data/icon.png' src: 'data/icon.png'
})), })),
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
width: 3, width: 3,
color: [255, 0, 0, 1] color: [255, 0, 0, 1]
}), }),
fill: new ol.style.Fill({ fill: new _ol_style_Fill_({
color: [0, 0, 255, 0.6] color: [0, 0, 255, 0.6]
}) })
}) })
}) })
], ],
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: [0, 0], center: [0, 0],
zoom: 2 zoom: 2
}) })

38
examples/d3.js vendored
View File

@@ -1,25 +1,25 @@
// NOCOMPILE // NOCOMPILE
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.extent'); import _ol_extent_ from '../src/ol/extent.js';
goog.require('ol.layer.Image'); import _ol_layer_Image_ from '../src/ol/layer/Image.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.proj'); import _ol_proj_ from '../src/ol/proj.js';
goog.require('ol.source.ImageCanvas'); import _ol_source_ImageCanvas_ from '../src/ol/source/ImageCanvas.js';
goog.require('ol.source.Stamen'); import _ol_source_Stamen_ from '../src/ol/source/Stamen.js';
var map = new ol.Map({ var map = new _ol_Map_({
layers: [ layers: [
new ol.layer.Tile({ new _ol_layer_Tile_({
source: new ol.source.Stamen({ source: new _ol_source_Stamen_({
layer: 'watercolor' layer: 'watercolor'
}) })
}) })
], ],
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: ol.proj.fromLonLat([-97, 38]), center: _ol_proj_.fromLonLat([-97, 38]),
zoom: 4 zoom: 4
}) })
}); });
@@ -57,13 +57,13 @@ d3.json('data/topojson/us.json', function(error, us) {
var pixelBoundsHeight = pixelBounds[1][1] - pixelBounds[0][1]; var pixelBoundsHeight = pixelBounds[1][1] - pixelBounds[0][1];
var geoBounds = d3.geoBounds(features); var geoBounds = d3.geoBounds(features);
var geoBoundsLeftBottom = ol.proj.transform( var geoBoundsLeftBottom = _ol_proj_.transform(
geoBounds[0], 'EPSG:4326', projection); geoBounds[0], 'EPSG:4326', projection);
var geoBoundsRightTop = ol.proj.transform( var geoBoundsRightTop = _ol_proj_.transform(
geoBounds[1], 'EPSG:4326', projection); geoBounds[1], 'EPSG:4326', projection);
var geoBoundsWidth = geoBoundsRightTop[0] - geoBoundsLeftBottom[0]; var geoBoundsWidth = geoBoundsRightTop[0] - geoBoundsLeftBottom[0];
if (geoBoundsWidth < 0) { if (geoBoundsWidth < 0) {
geoBoundsWidth += ol.extent.getWidth(projection.getExtent()); geoBoundsWidth += _ol_extent_.getWidth(projection.getExtent());
} }
var geoBoundsHeight = geoBoundsRightTop[1] - geoBoundsLeftBottom[1]; var geoBoundsHeight = geoBoundsRightTop[1] - geoBoundsLeftBottom[1];
@@ -72,7 +72,7 @@ d3.json('data/topojson/us.json', function(error, us) {
var r = Math.max(widthResolution, heightResolution); var r = Math.max(widthResolution, heightResolution);
var scale = r / (resolution / pixelRatio); var scale = r / (resolution / pixelRatio);
var center = ol.proj.transform(ol.extent.getCenter(extent), var center = _ol_proj_.transform(_ol_extent_.getCenter(extent),
projection, 'EPSG:4326'); projection, 'EPSG:4326');
d3Projection.scale(scale).center(center) d3Projection.scale(scale).center(center)
.translate([canvasWidth / 2, canvasHeight / 2]); .translate([canvasWidth / 2, canvasHeight / 2]);
@@ -83,8 +83,8 @@ d3.json('data/topojson/us.json', function(error, us) {
return canvas.node(); return canvas.node();
}; };
var layer = new ol.layer.Image({ var layer = new _ol_layer_Image_({
source: new ol.source.ImageCanvas({ source: new _ol_source_ImageCanvas_({
canvasFunction: canvasFunction, canvasFunction: canvasFunction,
projection: 'EPSG:3857' projection: 'EPSG:3857'
}) })

View File

@@ -1,27 +1,27 @@
// NOCOMPILE // NOCOMPILE
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.control'); import _ol_control_ from '../src/ol/control.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.math'); import _ol_math_ from '../src/ol/math.js';
goog.require('ol.proj'); import _ol_proj_ from '../src/ol/proj.js';
goog.require('ol.source.OSM'); import _ol_source_OSM_ from '../src/ol/source/OSM.js';
var projection = ol.proj.get('EPSG:3857'); var projection = _ol_proj_.get('EPSG:3857');
var view = new ol.View({ var view = new _ol_View_({
center: [0, 0], center: [0, 0],
projection: projection, projection: projection,
extent: projection.getExtent(), extent: projection.getExtent(),
zoom: 2 zoom: 2
}); });
var map = new ol.Map({ var map = new _ol_Map_({
layers: [ layers: [
new ol.layer.Tile({ new _ol_layer_Tile_({
source: new ol.source.OSM() source: new _ol_source_OSM_()
}) })
], ],
target: 'map', target: 'map',
controls: ol.control.defaults({ controls: _ol_control_.defaults({
attributionOptions: { attributionOptions: {
collapsible: false collapsible: false
} }
@@ -40,9 +40,9 @@ gn.init().then(function() {
gn.start(function(event) { gn.start(function(event) {
var center = view.getCenter(); var center = view.getCenter();
var resolution = view.getResolution(); var resolution = view.getResolution();
var alpha = ol.math.toRadians(event.do.beta); var alpha = _ol_math_.toRadians(event.do.beta);
var beta = ol.math.toRadians(event.do.beta); var beta = _ol_math_.toRadians(event.do.beta);
var gamma = ol.math.toRadians(event.do.gamma); var gamma = _ol_math_.toRadians(event.do.gamma);
el('alpha').innerText = alpha + ' [rad]'; el('alpha').innerText = alpha + ' [rad]';
el('beta').innerText = beta + ' [rad]'; el('beta').innerText = beta + ' [rad]';

View File

@@ -1,73 +1,73 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.format.GPX'); import _ol_format_GPX_ from '../src/ol/format/GPX.js';
goog.require('ol.format.GeoJSON'); import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js';
goog.require('ol.format.IGC'); import _ol_format_IGC_ from '../src/ol/format/IGC.js';
goog.require('ol.format.KML'); import _ol_format_KML_ from '../src/ol/format/KML.js';
goog.require('ol.format.TopoJSON'); import _ol_format_TopoJSON_ from '../src/ol/format/TopoJSON.js';
goog.require('ol.interaction'); import _ol_interaction_ from '../src/ol/interaction.js';
goog.require('ol.interaction.DragAndDrop'); import _ol_interaction_DragAndDrop_ from '../src/ol/interaction/DragAndDrop.js';
goog.require('ol.layer.Vector'); import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.source.BingMaps'); import _ol_source_BingMaps_ from '../src/ol/source/BingMaps.js';
goog.require('ol.source.Vector'); import _ol_source_Vector_ from '../src/ol/source/Vector.js';
goog.require('ol.style.Circle'); import _ol_style_Circle_ from '../src/ol/style/Circle.js';
goog.require('ol.style.Fill'); import _ol_style_Fill_ from '../src/ol/style/Fill.js';
goog.require('ol.style.Stroke'); import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
goog.require('ol.style.Style'); import _ol_style_Style_ from '../src/ol/style/Style.js';
var defaultStyle = { var defaultStyle = {
'Point': new ol.style.Style({ 'Point': new _ol_style_Style_({
image: new ol.style.Circle({ image: new _ol_style_Circle_({
fill: new ol.style.Fill({ fill: new _ol_style_Fill_({
color: 'rgba(255,255,0,0.5)' color: 'rgba(255,255,0,0.5)'
}), }),
radius: 5, radius: 5,
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
color: '#ff0', color: '#ff0',
width: 1 width: 1
}) })
}) })
}), }),
'LineString': new ol.style.Style({ 'LineString': new _ol_style_Style_({
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
color: '#f00', color: '#f00',
width: 3 width: 3
}) })
}), }),
'Polygon': new ol.style.Style({ 'Polygon': new _ol_style_Style_({
fill: new ol.style.Fill({ fill: new _ol_style_Fill_({
color: 'rgba(0,255,255,0.5)' color: 'rgba(0,255,255,0.5)'
}), }),
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
color: '#0ff', color: '#0ff',
width: 1 width: 1
}) })
}), }),
'MultiPoint': new ol.style.Style({ 'MultiPoint': new _ol_style_Style_({
image: new ol.style.Circle({ image: new _ol_style_Circle_({
fill: new ol.style.Fill({ fill: new _ol_style_Fill_({
color: 'rgba(255,0,255,0.5)' color: 'rgba(255,0,255,0.5)'
}), }),
radius: 5, radius: 5,
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
color: '#f0f', color: '#f0f',
width: 1 width: 1
}) })
}) })
}), }),
'MultiLineString': new ol.style.Style({ 'MultiLineString': new _ol_style_Style_({
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
color: '#0f0', color: '#0f0',
width: 3 width: 3
}) })
}), }),
'MultiPolygon': new ol.style.Style({ 'MultiPolygon': new _ol_style_Style_({
fill: new ol.style.Fill({ fill: new _ol_style_Fill_({
color: 'rgba(0,0,255,0.5)' color: 'rgba(0,0,255,0.5)'
}), }),
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
color: '#00f', color: '#00f',
width: 1 width: 1
}) })
@@ -83,38 +83,38 @@ var styleFunction = function(feature, resolution) {
} }
}; };
var dragAndDropInteraction = new ol.interaction.DragAndDrop({ var dragAndDropInteraction = new _ol_interaction_DragAndDrop_({
formatConstructors: [ formatConstructors: [
ol.format.GPX, _ol_format_GPX_,
ol.format.GeoJSON, _ol_format_GeoJSON_,
ol.format.IGC, _ol_format_IGC_,
ol.format.KML, _ol_format_KML_,
ol.format.TopoJSON _ol_format_TopoJSON_
] ]
}); });
var map = new ol.Map({ var map = new _ol_Map_({
interactions: ol.interaction.defaults().extend([dragAndDropInteraction]), interactions: _ol_interaction_.defaults().extend([dragAndDropInteraction]),
layers: [ layers: [
new ol.layer.Tile({ new _ol_layer_Tile_({
source: new ol.source.BingMaps({ source: new _ol_source_BingMaps_({
imagerySet: 'Aerial', imagerySet: 'Aerial',
key: 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5' key: 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5'
}) })
}) })
], ],
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: [0, 0], center: [0, 0],
zoom: 2 zoom: 2
}) })
}); });
dragAndDropInteraction.on('addfeatures', function(event) { dragAndDropInteraction.on('addfeatures', function(event) {
var vectorSource = new ol.source.Vector({ var vectorSource = new _ol_source_Vector_({
features: event.features features: event.features
}); });
map.addLayer(new ol.layer.Vector({ map.addLayer(new _ol_layer_Vector_({
renderMode: 'image', renderMode: 'image',
source: vectorSource, source: vectorSource,
style: styleFunction style: styleFunction

View File

@@ -1,73 +1,73 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.format.GPX'); import _ol_format_GPX_ from '../src/ol/format/GPX.js';
goog.require('ol.format.GeoJSON'); import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js';
goog.require('ol.format.IGC'); import _ol_format_IGC_ from '../src/ol/format/IGC.js';
goog.require('ol.format.KML'); import _ol_format_KML_ from '../src/ol/format/KML.js';
goog.require('ol.format.TopoJSON'); import _ol_format_TopoJSON_ from '../src/ol/format/TopoJSON.js';
goog.require('ol.interaction'); import _ol_interaction_ from '../src/ol/interaction.js';
goog.require('ol.interaction.DragAndDrop'); import _ol_interaction_DragAndDrop_ from '../src/ol/interaction/DragAndDrop.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.layer.Vector'); import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
goog.require('ol.source.BingMaps'); import _ol_source_BingMaps_ from '../src/ol/source/BingMaps.js';
goog.require('ol.source.Vector'); import _ol_source_Vector_ from '../src/ol/source/Vector.js';
goog.require('ol.style.Circle'); import _ol_style_Circle_ from '../src/ol/style/Circle.js';
goog.require('ol.style.Fill'); import _ol_style_Fill_ from '../src/ol/style/Fill.js';
goog.require('ol.style.Stroke'); import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
goog.require('ol.style.Style'); import _ol_style_Style_ from '../src/ol/style/Style.js';
var defaultStyle = { var defaultStyle = {
'Point': new ol.style.Style({ 'Point': new _ol_style_Style_({
image: new ol.style.Circle({ image: new _ol_style_Circle_({
fill: new ol.style.Fill({ fill: new _ol_style_Fill_({
color: 'rgba(255,255,0,0.5)' color: 'rgba(255,255,0,0.5)'
}), }),
radius: 5, radius: 5,
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
color: '#ff0', color: '#ff0',
width: 1 width: 1
}) })
}) })
}), }),
'LineString': new ol.style.Style({ 'LineString': new _ol_style_Style_({
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
color: '#f00', color: '#f00',
width: 3 width: 3
}) })
}), }),
'Polygon': new ol.style.Style({ 'Polygon': new _ol_style_Style_({
fill: new ol.style.Fill({ fill: new _ol_style_Fill_({
color: 'rgba(0,255,255,0.5)' color: 'rgba(0,255,255,0.5)'
}), }),
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
color: '#0ff', color: '#0ff',
width: 1 width: 1
}) })
}), }),
'MultiPoint': new ol.style.Style({ 'MultiPoint': new _ol_style_Style_({
image: new ol.style.Circle({ image: new _ol_style_Circle_({
fill: new ol.style.Fill({ fill: new _ol_style_Fill_({
color: 'rgba(255,0,255,0.5)' color: 'rgba(255,0,255,0.5)'
}), }),
radius: 5, radius: 5,
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
color: '#f0f', color: '#f0f',
width: 1 width: 1
}) })
}) })
}), }),
'MultiLineString': new ol.style.Style({ 'MultiLineString': new _ol_style_Style_({
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
color: '#0f0', color: '#0f0',
width: 3 width: 3
}) })
}), }),
'MultiPolygon': new ol.style.Style({ 'MultiPolygon': new _ol_style_Style_({
fill: new ol.style.Fill({ fill: new _ol_style_Fill_({
color: 'rgba(0,0,255,0.5)' color: 'rgba(0,0,255,0.5)'
}), }),
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
color: '#00f', color: '#00f',
width: 1 width: 1
}) })
@@ -83,38 +83,38 @@ var styleFunction = function(feature, resolution) {
} }
}; };
var dragAndDropInteraction = new ol.interaction.DragAndDrop({ var dragAndDropInteraction = new _ol_interaction_DragAndDrop_({
formatConstructors: [ formatConstructors: [
ol.format.GPX, _ol_format_GPX_,
ol.format.GeoJSON, _ol_format_GeoJSON_,
ol.format.IGC, _ol_format_IGC_,
ol.format.KML, _ol_format_KML_,
ol.format.TopoJSON _ol_format_TopoJSON_
] ]
}); });
var map = new ol.Map({ var map = new _ol_Map_({
interactions: ol.interaction.defaults().extend([dragAndDropInteraction]), interactions: _ol_interaction_.defaults().extend([dragAndDropInteraction]),
layers: [ layers: [
new ol.layer.Tile({ new _ol_layer_Tile_({
source: new ol.source.BingMaps({ source: new _ol_source_BingMaps_({
imagerySet: 'Aerial', imagerySet: 'Aerial',
key: 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5' key: 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5'
}) })
}) })
], ],
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: [0, 0], center: [0, 0],
zoom: 2 zoom: 2
}) })
}); });
dragAndDropInteraction.on('addfeatures', function(event) { dragAndDropInteraction.on('addfeatures', function(event) {
var vectorSource = new ol.source.Vector({ var vectorSource = new _ol_source_Vector_({
features: event.features features: event.features
}); });
map.addLayer(new ol.layer.Vector({ map.addLayer(new _ol_layer_Vector_({
source: vectorSource, source: vectorSource,
style: styleFunction style: styleFunction
})); }));

View File

@@ -1,22 +1,22 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.interaction'); import _ol_interaction_ from '../src/ol/interaction.js';
goog.require('ol.interaction.DragRotateAndZoom'); import _ol_interaction_DragRotateAndZoom_ from '../src/ol/interaction/DragRotateAndZoom.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.source.OSM'); import _ol_source_OSM_ from '../src/ol/source/OSM.js';
var map = new ol.Map({ var map = new _ol_Map_({
interactions: ol.interaction.defaults().extend([ interactions: _ol_interaction_.defaults().extend([
new ol.interaction.DragRotateAndZoom() new _ol_interaction_DragRotateAndZoom_()
]), ]),
layers: [ layers: [
new ol.layer.Tile({ new _ol_layer_Tile_({
source: new ol.source.OSM() source: new _ol_source_OSM_()
}) })
], ],
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: [0, 0], center: [0, 0],
zoom: 2 zoom: 2
}) })

View File

@@ -1,63 +1,63 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.interaction.Draw'); import _ol_interaction_Draw_ from '../src/ol/interaction/Draw.js';
goog.require('ol.interaction.Modify'); import _ol_interaction_Modify_ from '../src/ol/interaction/Modify.js';
goog.require('ol.interaction.Snap'); import _ol_interaction_Snap_ from '../src/ol/interaction/Snap.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.layer.Vector'); import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
goog.require('ol.source.OSM'); import _ol_source_OSM_ from '../src/ol/source/OSM.js';
goog.require('ol.source.Vector'); import _ol_source_Vector_ from '../src/ol/source/Vector.js';
goog.require('ol.style.Circle'); import _ol_style_Circle_ from '../src/ol/style/Circle.js';
goog.require('ol.style.Fill'); import _ol_style_Fill_ from '../src/ol/style/Fill.js';
goog.require('ol.style.Stroke'); import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
goog.require('ol.style.Style'); import _ol_style_Style_ from '../src/ol/style/Style.js';
var raster = new ol.layer.Tile({ var raster = new _ol_layer_Tile_({
source: new ol.source.OSM() source: new _ol_source_OSM_()
}); });
var source = new ol.source.Vector(); var source = new _ol_source_Vector_();
var vector = new ol.layer.Vector({ var vector = new _ol_layer_Vector_({
source: source, source: source,
style: new ol.style.Style({ style: new _ol_style_Style_({
fill: new ol.style.Fill({ fill: new _ol_style_Fill_({
color: 'rgba(255, 255, 255, 0.2)' color: 'rgba(255, 255, 255, 0.2)'
}), }),
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
color: '#ffcc33', color: '#ffcc33',
width: 2 width: 2
}), }),
image: new ol.style.Circle({ image: new _ol_style_Circle_({
radius: 7, radius: 7,
fill: new ol.style.Fill({ fill: new _ol_style_Fill_({
color: '#ffcc33' color: '#ffcc33'
}) })
}) })
}) })
}); });
var map = new ol.Map({ var map = new _ol_Map_({
layers: [raster, vector], layers: [raster, vector],
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: [-11000000, 4600000], center: [-11000000, 4600000],
zoom: 4 zoom: 4
}) })
}); });
var modify = new ol.interaction.Modify({source: source}); var modify = new _ol_interaction_Modify_({source: source});
map.addInteraction(modify); map.addInteraction(modify);
var draw, snap; // global so we can remove them later var draw, snap; // global so we can remove them later
var typeSelect = document.getElementById('type'); var typeSelect = document.getElementById('type');
function addInteractions() { function addInteractions() {
draw = new ol.interaction.Draw({ draw = new _ol_interaction_Draw_({
source: source, source: source,
type: typeSelect.value type: typeSelect.value
}); });
map.addInteraction(draw); map.addInteraction(draw);
snap = new ol.interaction.Snap({source: source}); snap = new _ol_interaction_Snap_({source: source});
map.addInteraction(snap); map.addInteraction(snap);
} }

View File

@@ -1,25 +1,25 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.interaction.Draw'); import _ol_interaction_Draw_ from '../src/ol/interaction/Draw.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.layer.Vector'); import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
goog.require('ol.source.OSM'); import _ol_source_OSM_ from '../src/ol/source/OSM.js';
goog.require('ol.source.Vector'); import _ol_source_Vector_ from '../src/ol/source/Vector.js';
var raster = new ol.layer.Tile({ var raster = new _ol_layer_Tile_({
source: new ol.source.OSM() source: new _ol_source_OSM_()
}); });
var source = new ol.source.Vector({wrapX: false}); var source = new _ol_source_Vector_({wrapX: false});
var vector = new ol.layer.Vector({ var vector = new _ol_layer_Vector_({
source: source source: source
}); });
var map = new ol.Map({ var map = new _ol_Map_({
layers: [raster, vector], layers: [raster, vector],
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: [-11000000, 4600000], center: [-11000000, 4600000],
zoom: 4 zoom: 4
}) })
@@ -31,7 +31,7 @@ var draw; // global so we can remove it later
function addInteraction() { function addInteraction() {
var value = typeSelect.value; var value = typeSelect.value;
if (value !== 'None') { if (value !== 'None') {
draw = new ol.interaction.Draw({ draw = new _ol_interaction_Draw_({
source: source, source: source,
type: typeSelect.value type: typeSelect.value
}); });

View File

@@ -1,25 +1,25 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.interaction.Draw'); import _ol_interaction_Draw_ from '../src/ol/interaction/Draw.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.layer.Vector'); import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
goog.require('ol.source.OSM'); import _ol_source_OSM_ from '../src/ol/source/OSM.js';
goog.require('ol.source.Vector'); import _ol_source_Vector_ from '../src/ol/source/Vector.js';
var raster = new ol.layer.Tile({ var raster = new _ol_layer_Tile_({
source: new ol.source.OSM() source: new _ol_source_OSM_()
}); });
var source = new ol.source.Vector({wrapX: false}); var source = new _ol_source_Vector_({wrapX: false});
var vector = new ol.layer.Vector({ var vector = new _ol_layer_Vector_({
source: source source: source
}); });
var map = new ol.Map({ var map = new _ol_Map_({
layers: [raster, vector], layers: [raster, vector],
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: [-11000000, 4600000], center: [-11000000, 4600000],
zoom: 4 zoom: 4
}) })
@@ -31,7 +31,7 @@ var draw; // global so we can remove it later
function addInteraction() { function addInteraction() {
var value = typeSelect.value; var value = typeSelect.value;
if (value !== 'None') { if (value !== 'None') {
draw = new ol.interaction.Draw({ draw = new _ol_interaction_Draw_({
source: source, source: source,
type: typeSelect.value, type: typeSelect.value,
freehand: true freehand: true

View File

@@ -1,26 +1,26 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.geom.Polygon'); import _ol_geom_Polygon_ from '../src/ol/geom/Polygon.js';
goog.require('ol.interaction.Draw'); import _ol_interaction_Draw_ from '../src/ol/interaction/Draw.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.layer.Vector'); import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
goog.require('ol.source.OSM'); import _ol_source_OSM_ from '../src/ol/source/OSM.js';
goog.require('ol.source.Vector'); import _ol_source_Vector_ from '../src/ol/source/Vector.js';
var raster = new ol.layer.Tile({ var raster = new _ol_layer_Tile_({
source: new ol.source.OSM() source: new _ol_source_OSM_()
}); });
var source = new ol.source.Vector({wrapX: false}); var source = new _ol_source_Vector_({wrapX: false});
var vector = new ol.layer.Vector({ var vector = new _ol_layer_Vector_({
source: source source: source
}); });
var map = new ol.Map({ var map = new _ol_Map_({
layers: [raster, vector], layers: [raster, vector],
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: [-11000000, 4600000], center: [-11000000, 4600000],
zoom: 4 zoom: 4
}) })
@@ -35,15 +35,15 @@ function addInteraction() {
var geometryFunction; var geometryFunction;
if (value === 'Square') { if (value === 'Square') {
value = 'Circle'; value = 'Circle';
geometryFunction = ol.interaction.Draw.createRegularPolygon(4); geometryFunction = _ol_interaction_Draw_.createRegularPolygon(4);
} else if (value === 'Box') { } else if (value === 'Box') {
value = 'Circle'; value = 'Circle';
geometryFunction = ol.interaction.Draw.createBox(); geometryFunction = _ol_interaction_Draw_.createBox();
} else if (value === 'Star') { } else if (value === 'Star') {
value = 'Circle'; value = 'Circle';
geometryFunction = function(coordinates, geometry) { geometryFunction = function(coordinates, geometry) {
if (!geometry) { if (!geometry) {
geometry = new ol.geom.Polygon(null); geometry = new _ol_geom_Polygon_(null);
} }
var center = coordinates[0]; var center = coordinates[0];
var last = coordinates[1]; var last = coordinates[1];
@@ -65,7 +65,7 @@ function addInteraction() {
return geometry; return geometry;
}; };
} }
draw = new ol.interaction.Draw({ draw = new _ol_interaction_Draw_({
source: source, source: source,
type: value, type: value,
geometryFunction: geometryFunction geometryFunction: geometryFunction

View File

@@ -1,50 +1,50 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.geom.MultiPoint'); import _ol_geom_MultiPoint_ from '../src/ol/geom/MultiPoint.js';
goog.require('ol.geom.Point'); import _ol_geom_Point_ from '../src/ol/geom/Point.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.source.OSM'); import _ol_source_OSM_ from '../src/ol/source/OSM.js';
goog.require('ol.style.Circle'); import _ol_style_Circle_ from '../src/ol/style/Circle.js';
goog.require('ol.style.Fill'); import _ol_style_Fill_ from '../src/ol/style/Fill.js';
goog.require('ol.style.Stroke'); import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
goog.require('ol.style.Style'); import _ol_style_Style_ from '../src/ol/style/Style.js';
var map = new ol.Map({ var map = new _ol_Map_({
layers: [ layers: [
new ol.layer.Tile({ new _ol_layer_Tile_({
source: new ol.source.OSM() source: new _ol_source_OSM_()
}) })
], ],
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: [0, 0], center: [0, 0],
zoom: 2 zoom: 2
}) })
}); });
var imageStyle = new ol.style.Style({ var imageStyle = new _ol_style_Style_({
image: new ol.style.Circle({ image: new _ol_style_Circle_({
radius: 5, radius: 5,
snapToPixel: false, snapToPixel: false,
fill: new ol.style.Fill({color: 'yellow'}), fill: new _ol_style_Fill_({color: 'yellow'}),
stroke: new ol.style.Stroke({color: 'red', width: 1}) stroke: new _ol_style_Stroke_({color: 'red', width: 1})
}) })
}); });
var headInnerImageStyle = new ol.style.Style({ var headInnerImageStyle = new _ol_style_Style_({
image: new ol.style.Circle({ image: new _ol_style_Circle_({
radius: 2, radius: 2,
snapToPixel: false, snapToPixel: false,
fill: new ol.style.Fill({color: 'blue'}) fill: new _ol_style_Fill_({color: 'blue'})
}) })
}); });
var headOuterImageStyle = new ol.style.Style({ var headOuterImageStyle = new _ol_style_Style_({
image: new ol.style.Circle({ image: new _ol_style_Circle_({
radius: 5, radius: 5,
snapToPixel: false, snapToPixel: false,
fill: new ol.style.Fill({color: 'black'}) fill: new _ol_style_Fill_({color: 'black'})
}) })
}); });
@@ -66,9 +66,9 @@ map.on('postcompose', function(event) {
coordinates.push([x, y]); coordinates.push([x, y]);
} }
vectorContext.setStyle(imageStyle); vectorContext.setStyle(imageStyle);
vectorContext.drawGeometry(new ol.geom.MultiPoint(coordinates)); vectorContext.drawGeometry(new _ol_geom_MultiPoint_(coordinates));
var headPoint = new ol.geom.Point(coordinates[coordinates.length - 1]); var headPoint = new _ol_geom_Point_(coordinates[coordinates.length - 1]);
vectorContext.setStyle(headOuterImageStyle); vectorContext.setStyle(headOuterImageStyle);
vectorContext.drawGeometry(headPoint); vectorContext.drawGeometry(headPoint);

View File

@@ -1,37 +1,37 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.extent'); import _ol_extent_ from '../src/ol/extent.js';
goog.require('ol.format.KML'); import _ol_format_KML_ from '../src/ol/format/KML.js';
goog.require('ol.interaction'); import _ol_interaction_ from '../src/ol/interaction.js';
goog.require('ol.interaction.Select'); import _ol_interaction_Select_ from '../src/ol/interaction/Select.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.layer.Vector'); import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
goog.require('ol.source.Cluster'); import _ol_source_Cluster_ from '../src/ol/source/Cluster.js';
goog.require('ol.source.Stamen'); import _ol_source_Stamen_ from '../src/ol/source/Stamen.js';
goog.require('ol.source.Vector'); import _ol_source_Vector_ from '../src/ol/source/Vector.js';
goog.require('ol.style.Circle'); import _ol_style_Circle_ from '../src/ol/style/Circle.js';
goog.require('ol.style.Fill'); import _ol_style_Fill_ from '../src/ol/style/Fill.js';
goog.require('ol.style.RegularShape'); import _ol_style_RegularShape_ from '../src/ol/style/RegularShape.js';
goog.require('ol.style.Stroke'); import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
goog.require('ol.style.Style'); import _ol_style_Style_ from '../src/ol/style/Style.js';
goog.require('ol.style.Text'); import _ol_style_Text_ from '../src/ol/style/Text.js';
var earthquakeFill = new ol.style.Fill({ var earthquakeFill = new _ol_style_Fill_({
color: 'rgba(255, 153, 0, 0.8)' color: 'rgba(255, 153, 0, 0.8)'
}); });
var earthquakeStroke = new ol.style.Stroke({ var earthquakeStroke = new _ol_style_Stroke_({
color: 'rgba(255, 204, 0, 0.2)', color: 'rgba(255, 204, 0, 0.2)',
width: 1 width: 1
}); });
var textFill = new ol.style.Fill({ var textFill = new _ol_style_Fill_({
color: '#fff' color: '#fff'
}); });
var textStroke = new ol.style.Stroke({ var textStroke = new _ol_style_Stroke_({
color: 'rgba(0, 0, 0, 0.6)', color: 'rgba(0, 0, 0, 0.6)',
width: 3 width: 3
}); });
var invisibleFill = new ol.style.Fill({ var invisibleFill = new _ol_style_Fill_({
color: 'rgba(255, 255, 255, 0.01)' color: 'rgba(255, 255, 255, 0.01)'
}); });
@@ -43,9 +43,9 @@ function createEarthquakeStyle(feature) {
var magnitude = parseFloat(name.substr(2)); var magnitude = parseFloat(name.substr(2));
var radius = 5 + 20 * (magnitude - 5); var radius = 5 + 20 * (magnitude - 5);
return new ol.style.Style({ return new _ol_style_Style_({
geometry: feature.getGeometry(), geometry: feature.getGeometry(),
image: new ol.style.RegularShape({ image: new _ol_style_RegularShape_({
radius1: radius, radius1: radius,
radius2: 3, radius2: 3,
points: 5, points: 5,
@@ -64,13 +64,13 @@ function calculateClusterInfo(resolution) {
for (var i = features.length - 1; i >= 0; --i) { for (var i = features.length - 1; i >= 0; --i) {
feature = features[i]; feature = features[i];
var originalFeatures = feature.get('features'); var originalFeatures = feature.get('features');
var extent = ol.extent.createEmpty(); var extent = _ol_extent_.createEmpty();
var j, jj; var j, jj;
for (j = 0, jj = originalFeatures.length; j < jj; ++j) { for (j = 0, jj = originalFeatures.length; j < jj; ++j) {
ol.extent.extend(extent, originalFeatures[j].getGeometry().getExtent()); _ol_extent_.extend(extent, originalFeatures[j].getGeometry().getExtent());
} }
maxFeatureCount = Math.max(maxFeatureCount, jj); maxFeatureCount = Math.max(maxFeatureCount, jj);
radius = 0.25 * (ol.extent.getWidth(extent) + ol.extent.getHeight(extent)) / radius = 0.25 * (_ol_extent_.getWidth(extent) + _ol_extent_.getHeight(extent)) /
resolution; resolution;
feature.set('radius', radius); feature.set('radius', radius);
} }
@@ -85,14 +85,14 @@ function styleFunction(feature, resolution) {
var style; var style;
var size = feature.get('features').length; var size = feature.get('features').length;
if (size > 1) { if (size > 1) {
style = new ol.style.Style({ style = new _ol_style_Style_({
image: new ol.style.Circle({ image: new _ol_style_Circle_({
radius: feature.get('radius'), radius: feature.get('radius'),
fill: new ol.style.Fill({ fill: new _ol_style_Fill_({
color: [255, 153, 0, Math.min(0.8, 0.4 + (size / maxFeatureCount))] color: [255, 153, 0, Math.min(0.8, 0.4 + (size / maxFeatureCount))]
}) })
}), }),
text: new ol.style.Text({ text: new _ol_style_Text_({
text: size.toString(), text: size.toString(),
fill: textFill, fill: textFill,
stroke: textStroke stroke: textStroke
@@ -106,8 +106,8 @@ function styleFunction(feature, resolution) {
} }
function selectStyleFunction(feature) { function selectStyleFunction(feature) {
var styles = [new ol.style.Style({ var styles = [new _ol_style_Style_({
image: new ol.style.Circle({ image: new _ol_style_Circle_({
radius: feature.get('radius'), radius: feature.get('radius'),
fill: invisibleFill fill: invisibleFill
}) })
@@ -121,12 +121,12 @@ function selectStyleFunction(feature) {
return styles; return styles;
} }
vector = new ol.layer.Vector({ vector = new _ol_layer_Vector_({
source: new ol.source.Cluster({ source: new _ol_source_Cluster_({
distance: 40, distance: 40,
source: new ol.source.Vector({ source: new _ol_source_Vector_({
url: 'data/kml/2012_Earthquakes_Mag5.kml', url: 'data/kml/2012_Earthquakes_Mag5.kml',
format: new ol.format.KML({ format: new _ol_format_KML_({
extractStyles: false extractStyles: false
}) })
}) })
@@ -134,15 +134,15 @@ vector = new ol.layer.Vector({
style: styleFunction style: styleFunction
}); });
var raster = new ol.layer.Tile({ var raster = new _ol_layer_Tile_({
source: new ol.source.Stamen({ source: new _ol_source_Stamen_({
layer: 'toner' layer: 'toner'
}) })
}); });
var map = new ol.Map({ var map = new _ol_Map_({
layers: [raster, vector], layers: [raster, vector],
interactions: ol.interaction.defaults().extend([new ol.interaction.Select({ interactions: _ol_interaction_.defaults().extend([new _ol_interaction_Select_({
condition: function(evt) { condition: function(evt) {
return evt.type == 'pointermove' || return evt.type == 'pointermove' ||
evt.type == 'singleclick'; evt.type == 'singleclick';
@@ -150,7 +150,7 @@ var map = new ol.Map({
style: selectStyleFunction style: selectStyleFunction
})]), })]),
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: [0, 0], center: [0, 0],
zoom: 2 zoom: 2
}) })

View File

@@ -1,16 +1,16 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.format.KML'); import _ol_format_KML_ from '../src/ol/format/KML.js';
goog.require('ol.geom.Polygon'); import _ol_geom_Polygon_ from '../src/ol/geom/Polygon.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.layer.Vector'); import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
goog.require('ol.render'); import _ol_render_ from '../src/ol/render.js';
goog.require('ol.source.Stamen'); import _ol_source_Stamen_ from '../src/ol/source/Stamen.js';
goog.require('ol.source.Vector'); import _ol_source_Vector_ from '../src/ol/source/Vector.js';
goog.require('ol.style.Fill'); import _ol_style_Fill_ from '../src/ol/style/Fill.js';
goog.require('ol.style.Icon'); import _ol_style_Icon_ from '../src/ol/style/Icon.js';
goog.require('ol.style.Stroke'); import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
goog.require('ol.style.Style'); import _ol_style_Style_ from '../src/ol/style/Style.js';
var symbol = [[0, 0], [4, 2], [6, 0], [10, 5], [6, 3], [4, 5], [0, 0]]; var symbol = [[0, 0], [4, 2], [6, 0], [10, 5], [6, 3], [4, 5], [0, 0]];
@@ -32,16 +32,16 @@ var styleFunction = function(feature) {
if (!style) { if (!style) {
var canvas = var canvas =
/** @type {HTMLCanvasElement} */ (document.createElement('canvas')); /** @type {HTMLCanvasElement} */ (document.createElement('canvas'));
var vectorContext = ol.render.toContext( var vectorContext = _ol_render_.toContext(
/** @type {CanvasRenderingContext2D} */ (canvas.getContext('2d')), /** @type {CanvasRenderingContext2D} */ (canvas.getContext('2d')),
{size: [size, size], pixelRatio: 1}); {size: [size, size], pixelRatio: 1});
vectorContext.setStyle(new ol.style.Style({ vectorContext.setStyle(new _ol_style_Style_({
fill: new ol.style.Fill({color: 'rgba(255, 153, 0, 0.4)'}), fill: new _ol_style_Fill_({color: 'rgba(255, 153, 0, 0.4)'}),
stroke: new ol.style.Stroke({color: 'rgba(255, 204, 0, 0.2)', width: 2}) stroke: new _ol_style_Stroke_({color: 'rgba(255, 204, 0, 0.2)', width: 2})
})); }));
vectorContext.drawGeometry(new ol.geom.Polygon([symbol.map(scaleFunction)])); vectorContext.drawGeometry(new _ol_geom_Polygon_([symbol.map(scaleFunction)]));
style = new ol.style.Style({ style = new _ol_style_Style_({
image: new ol.style.Icon({ image: new _ol_style_Icon_({
img: canvas, img: canvas,
imgSize: [size, size], imgSize: [size, size],
rotation: 1.2 rotation: 1.2
@@ -52,26 +52,26 @@ var styleFunction = function(feature) {
return style; return style;
}; };
var vector = new ol.layer.Vector({ var vector = new _ol_layer_Vector_({
source: new ol.source.Vector({ source: new _ol_source_Vector_({
url: 'data/kml/2012_Earthquakes_Mag5.kml', url: 'data/kml/2012_Earthquakes_Mag5.kml',
format: new ol.format.KML({ format: new _ol_format_KML_({
extractStyles: false extractStyles: false
}) })
}), }),
style: styleFunction style: styleFunction
}); });
var raster = new ol.layer.Tile({ var raster = new _ol_layer_Tile_({
source: new ol.source.Stamen({ source: new _ol_source_Stamen_({
layer: 'toner' layer: 'toner'
}) })
}); });
var map = new ol.Map({ var map = new _ol_Map_({
layers: [raster, vector], layers: [raster, vector],
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: [0, 0], center: [0, 0],
zoom: 2 zoom: 2
}) })

View File

@@ -1,14 +1,14 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.control'); import _ol_control_ from '../src/ol/control.js';
goog.require('ol.control.ScaleLine'); import _ol_control_ScaleLine_ from '../src/ol/control/ScaleLine.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.source.TileWMS'); import _ol_source_TileWMS_ from '../src/ol/source/TileWMS.js';
var layers = [ var layers = [
new ol.layer.Tile({ new _ol_layer_Tile_({
source: new ol.source.TileWMS({ source: new _ol_source_TileWMS_({
url: 'https://ahocevar.com/geoserver/wms', url: 'https://ahocevar.com/geoserver/wms',
params: { params: {
'LAYERS': 'ne:NE1_HR_LC_SR_W_DR', 'LAYERS': 'ne:NE1_HR_LC_SR_W_DR',
@@ -18,15 +18,15 @@ var layers = [
}) })
]; ];
var map = new ol.Map({ var map = new _ol_Map_({
controls: ol.control.defaults().extend([ controls: _ol_control_.defaults().extend([
new ol.control.ScaleLine({ new _ol_control_ScaleLine_({
units: 'degrees' units: 'degrees'
}) })
]), ]),
layers: layers, layers: layers,
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
projection: 'EPSG:4326', projection: 'EPSG:4326',
center: [0, 0], center: [0, 0],
zoom: 2 zoom: 2

View File

@@ -1,33 +1,33 @@
// NOCOMPILE // NOCOMPILE
// this example uses FileSaver.js for which we don't have an externs file. // this example uses FileSaver.js for which we don't have an externs file.
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.control'); import _ol_control_ from '../src/ol/control.js';
goog.require('ol.format.GeoJSON'); import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.layer.Vector'); import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
goog.require('ol.source.OSM'); import _ol_source_OSM_ from '../src/ol/source/OSM.js';
goog.require('ol.source.Vector'); import _ol_source_Vector_ from '../src/ol/source/Vector.js';
var map = new ol.Map({ var map = new _ol_Map_({
layers: [ layers: [
new ol.layer.Tile({ new _ol_layer_Tile_({
source: new ol.source.OSM() source: new _ol_source_OSM_()
}), }),
new ol.layer.Vector({ new _ol_layer_Vector_({
source: new ol.source.Vector({ source: new _ol_source_Vector_({
url: 'data/geojson/countries.geojson', url: 'data/geojson/countries.geojson',
format: new ol.format.GeoJSON() format: new _ol_format_GeoJSON_()
}) })
}) })
], ],
target: 'map', target: 'map',
controls: ol.control.defaults({ controls: _ol_control_.defaults({
attributionOptions: { attributionOptions: {
collapsible: false collapsible: false
} }
}), }),
view: new ol.View({ view: new _ol_View_({
center: [0, 0], center: [0, 0],
zoom: 2 zoom: 2
}) })

View File

@@ -1,40 +1,40 @@
// NOCOMPILE // NOCOMPILE
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.control'); import _ol_control_ from '../src/ol/control.js';
goog.require('ol.format.WKT'); import _ol_format_WKT_ from '../src/ol/format/WKT.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.layer.Vector'); import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
goog.require('ol.source.OSM'); import _ol_source_OSM_ from '../src/ol/source/OSM.js';
goog.require('ol.source.Vector'); import _ol_source_Vector_ from '../src/ol/source/Vector.js';
var raster = new ol.layer.Tile({ var raster = new _ol_layer_Tile_({
source: new ol.source.OSM() source: new _ol_source_OSM_()
}); });
var format = new ol.format.WKT(); var format = new _ol_format_WKT_();
var feature = format.readFeature( var feature = format.readFeature(
'POLYGON((10.689697265625 -25.0927734375, 34.595947265625 ' + 'POLYGON((10.689697265625 -25.0927734375, 34.595947265625 ' +
'-20.1708984375, 38.814697265625 -35.6396484375, 13.502197265625 ' + '-20.1708984375, 38.814697265625 -35.6396484375, 13.502197265625 ' +
'-39.1552734375, 10.689697265625 -25.0927734375))'); '-39.1552734375, 10.689697265625 -25.0927734375))');
feature.getGeometry().transform('EPSG:4326', 'EPSG:3857'); feature.getGeometry().transform('EPSG:4326', 'EPSG:3857');
var vector = new ol.layer.Vector({ var vector = new _ol_layer_Vector_({
source: new ol.source.Vector({ source: new _ol_source_Vector_({
features: [feature] features: [feature]
}) })
}); });
var map = new ol.Map({ var map = new _ol_Map_({
layers: [raster, vector], layers: [raster, vector],
target: 'map', target: 'map',
controls: ol.control.defaults({ controls: _ol_control_.defaults({
attributionOptions: { attributionOptions: {
collapsible: false collapsible: false
} }
}), }),
view: new ol.View({ view: new _ol_View_({
center: [0, 0], center: [0, 0],
zoom: 2 zoom: 2
}) })

View File

@@ -1,36 +1,36 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.events.condition'); import _ol_events_condition_ from '../src/ol/events/condition.js';
goog.require('ol.format.GeoJSON'); import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js';
goog.require('ol.interaction.Extent'); import _ol_interaction_Extent_ from '../src/ol/interaction/Extent.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.layer.Vector'); import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
goog.require('ol.source.OSM'); import _ol_source_OSM_ from '../src/ol/source/OSM.js';
goog.require('ol.source.Vector'); import _ol_source_Vector_ from '../src/ol/source/Vector.js';
var vectorSource = new ol.source.Vector({ var vectorSource = new _ol_source_Vector_({
url: 'data/geojson/countries.geojson', url: 'data/geojson/countries.geojson',
format: new ol.format.GeoJSON() format: new _ol_format_GeoJSON_()
}); });
var map = new ol.Map({ var map = new _ol_Map_({
layers: [ layers: [
new ol.layer.Tile({ new _ol_layer_Tile_({
source: new ol.source.OSM() source: new _ol_source_OSM_()
}), }),
new ol.layer.Vector({ new _ol_layer_Vector_({
source: vectorSource source: vectorSource
}) })
], ],
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: [0, 0], center: [0, 0],
zoom: 2 zoom: 2
}) })
}); });
var extent = new ol.interaction.Extent({ var extent = new _ol_interaction_Extent_({
condition: ol.events.condition.platformModifierKeyOnly condition: _ol_events_condition_.platformModifierKeyOnly
}); });
map.addInteraction(extent); map.addInteraction(extent);
extent.setActive(false); extent.setActive(false);

View File

@@ -1,44 +1,44 @@
goog.require('ol.Feature'); import _ol_Feature_ from '../src/ol/Feature.js';
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.Observable'); import _ol_Observable_ from '../src/ol/Observable.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.control'); import _ol_control_ from '../src/ol/control.js';
goog.require('ol.easing'); import _ol_easing_ from '../src/ol/easing.js';
goog.require('ol.geom.Point'); import _ol_geom_Point_ from '../src/ol/geom/Point.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.layer.Vector'); import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
goog.require('ol.proj'); import _ol_proj_ from '../src/ol/proj.js';
goog.require('ol.source.OSM'); import _ol_source_OSM_ from '../src/ol/source/OSM.js';
goog.require('ol.source.Vector'); import _ol_source_Vector_ from '../src/ol/source/Vector.js';
goog.require('ol.style.Circle'); import _ol_style_Circle_ from '../src/ol/style/Circle.js';
goog.require('ol.style.Stroke'); import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
goog.require('ol.style.Style'); import _ol_style_Style_ from '../src/ol/style/Style.js';
var map = new ol.Map({ var map = new _ol_Map_({
layers: [ layers: [
new ol.layer.Tile({ new _ol_layer_Tile_({
source: new ol.source.OSM({ source: new _ol_source_OSM_({
wrapX: false wrapX: false
}) })
}) })
], ],
controls: ol.control.defaults({ controls: _ol_control_.defaults({
attributionOptions: { attributionOptions: {
collapsible: false collapsible: false
} }
}), }),
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: [0, 0], center: [0, 0],
zoom: 1 zoom: 1
}) })
}); });
var source = new ol.source.Vector({ var source = new _ol_source_Vector_({
wrapX: false wrapX: false
}); });
var vector = new ol.layer.Vector({ var vector = new _ol_layer_Vector_({
source: source source: source
}); });
map.addLayer(vector); map.addLayer(vector);
@@ -46,9 +46,9 @@ map.addLayer(vector);
function addRandomFeature() { function addRandomFeature() {
var x = Math.random() * 360 - 180; var x = Math.random() * 360 - 180;
var y = Math.random() * 180 - 90; var y = Math.random() * 180 - 90;
var geom = new ol.geom.Point(ol.proj.transform([x, y], var geom = new _ol_geom_Point_(_ol_proj_.transform([x, y],
'EPSG:4326', 'EPSG:3857')); 'EPSG:4326', 'EPSG:3857'));
var feature = new ol.Feature(geom); var feature = new _ol_Feature_(geom);
source.addFeature(feature); source.addFeature(feature);
} }
@@ -64,14 +64,14 @@ function flash(feature) {
var elapsed = frameState.time - start; var elapsed = frameState.time - start;
var elapsedRatio = elapsed / duration; var elapsedRatio = elapsed / duration;
// radius will be 5 at start and 30 at end. // radius will be 5 at start and 30 at end.
var radius = ol.easing.easeOut(elapsedRatio) * 25 + 5; var radius = _ol_easing_.easeOut(elapsedRatio) * 25 + 5;
var opacity = ol.easing.easeOut(1 - elapsedRatio); var opacity = _ol_easing_.easeOut(1 - elapsedRatio);
var style = new ol.style.Style({ var style = new _ol_style_Style_({
image: new ol.style.Circle({ image: new _ol_style_Circle_({
radius: radius, radius: radius,
snapToPixel: false, snapToPixel: false,
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
color: 'rgba(255, 0, 0, ' + opacity + ')', color: 'rgba(255, 0, 0, ' + opacity + ')',
width: 0.25 + opacity width: 0.25 + opacity
}) })
@@ -81,7 +81,7 @@ function flash(feature) {
vectorContext.setStyle(style); vectorContext.setStyle(style);
vectorContext.drawGeometry(flashGeom); vectorContext.drawGeometry(flashGeom);
if (elapsed > duration) { if (elapsed > duration) {
ol.Observable.unByKey(listenerKey); _ol_Observable_.unByKey(listenerKey);
return; return;
} }
// tell OpenLayers to continue postcompose animation // tell OpenLayers to continue postcompose animation

View File

@@ -1,17 +1,17 @@
goog.require('ol.Feature'); import _ol_Feature_ from '../src/ol/Feature.js';
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.format.Polyline'); import _ol_format_Polyline_ from '../src/ol/format/Polyline.js';
goog.require('ol.geom.Point'); import _ol_geom_Point_ from '../src/ol/geom/Point.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.layer.Vector'); import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
goog.require('ol.source.BingMaps'); import _ol_source_BingMaps_ from '../src/ol/source/BingMaps.js';
goog.require('ol.source.Vector'); import _ol_source_Vector_ from '../src/ol/source/Vector.js';
goog.require('ol.style.Circle'); import _ol_style_Circle_ from '../src/ol/style/Circle.js';
goog.require('ol.style.Fill'); import _ol_style_Fill_ from '../src/ol/style/Fill.js';
goog.require('ol.style.Icon'); import _ol_style_Icon_ from '../src/ol/style/Icon.js';
goog.require('ol.style.Stroke'); import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
goog.require('ol.style.Style'); import _ol_style_Style_ from '../src/ol/style/Style.js';
// This long string is placed here due to jsFiddle limitations. // This long string is placed here due to jsFiddle limitations.
// It is usually loaded with AJAX. // It is usually loaded with AJAX.
@@ -57,7 +57,7 @@ var polyline = [
'~@ym@yjA??a@cFd@kBrCgDbAUnAcBhAyAdk@et@??kF}D??OL' '~@ym@yjA??a@cFd@kBrCgDbAUnAcBhAyAdk@et@??kF}D??OL'
].join(''); ].join('');
var route = /** @type {ol.geom.LineString} */ (new ol.format.Polyline({ var route = /** @type {ol.geom.LineString} */ (new _ol_format_Polyline_({
factor: 1e6 factor: 1e6
}).readGeometry(polyline, { }).readGeometry(polyline, {
dataProjection: 'EPSG:4326', dataProjection: 'EPSG:4326',
@@ -67,41 +67,41 @@ var route = /** @type {ol.geom.LineString} */ (new ol.format.Polyline({
var routeCoords = route.getCoordinates(); var routeCoords = route.getCoordinates();
var routeLength = routeCoords.length; var routeLength = routeCoords.length;
var routeFeature = new ol.Feature({ var routeFeature = new _ol_Feature_({
type: 'route', type: 'route',
geometry: route geometry: route
}); });
var geoMarker = new ol.Feature({ var geoMarker = new _ol_Feature_({
type: 'geoMarker', type: 'geoMarker',
geometry: new ol.geom.Point(routeCoords[0]) geometry: new _ol_geom_Point_(routeCoords[0])
}); });
var startMarker = new ol.Feature({ var startMarker = new _ol_Feature_({
type: 'icon', type: 'icon',
geometry: new ol.geom.Point(routeCoords[0]) geometry: new _ol_geom_Point_(routeCoords[0])
}); });
var endMarker = new ol.Feature({ var endMarker = new _ol_Feature_({
type: 'icon', type: 'icon',
geometry: new ol.geom.Point(routeCoords[routeLength - 1]) geometry: new _ol_geom_Point_(routeCoords[routeLength - 1])
}); });
var styles = { var styles = {
'route': new ol.style.Style({ 'route': new _ol_style_Style_({
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
width: 6, color: [237, 212, 0, 0.8] width: 6, color: [237, 212, 0, 0.8]
}) })
}), }),
'icon': new ol.style.Style({ 'icon': new _ol_style_Style_({
image: new ol.style.Icon({ image: new _ol_style_Icon_({
anchor: [0.5, 1], anchor: [0.5, 1],
src: 'data/icon.png' src: 'data/icon.png'
}) })
}), }),
'geoMarker': new ol.style.Style({ 'geoMarker': new _ol_style_Style_({
image: new ol.style.Circle({ image: new _ol_style_Circle_({
radius: 7, radius: 7,
snapToPixel: false, snapToPixel: false,
fill: new ol.style.Fill({color: 'black'}), fill: new _ol_style_Fill_({color: 'black'}),
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
color: 'white', width: 2 color: 'white', width: 2
}) })
}) })
@@ -113,8 +113,8 @@ var speed, now;
var speedInput = document.getElementById('speed'); var speedInput = document.getElementById('speed');
var startButton = document.getElementById('start-animation'); var startButton = document.getElementById('start-animation');
var vectorLayer = new ol.layer.Vector({ var vectorLayer = new _ol_layer_Vector_({
source: new ol.source.Vector({ source: new _ol_source_Vector_({
features: [routeFeature, geoMarker, startMarker, endMarker] features: [routeFeature, geoMarker, startMarker, endMarker]
}), }),
style: function(feature) { style: function(feature) {
@@ -127,18 +127,18 @@ var vectorLayer = new ol.layer.Vector({
}); });
var center = [-5639523.95, -3501274.52]; var center = [-5639523.95, -3501274.52];
var map = new ol.Map({ var map = new _ol_Map_({
target: document.getElementById('map'), target: document.getElementById('map'),
loadTilesWhileAnimating: true, loadTilesWhileAnimating: true,
view: new ol.View({ view: new _ol_View_({
center: center, center: center,
zoom: 10, zoom: 10,
minZoom: 2, minZoom: 2,
maxZoom: 19 maxZoom: 19
}), }),
layers: [ layers: [
new ol.layer.Tile({ new _ol_layer_Tile_({
source: new ol.source.BingMaps({ source: new _ol_source_BingMaps_({
imagerySet: 'AerialWithLabels', imagerySet: 'AerialWithLabels',
key: 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5' key: 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5'
}) })
@@ -162,8 +162,8 @@ var moveFeature = function(event) {
return; return;
} }
var currentPoint = new ol.geom.Point(routeCoords[index]); var currentPoint = new _ol_geom_Point_(routeCoords[index]);
var feature = new ol.Feature(currentPoint); var feature = new _ol_Feature_(currentPoint);
vectorContext.drawFeature(feature, styles.geoMarker); vectorContext.drawFeature(feature, styles.geoMarker);
} }
// tell OpenLayers to continue the postcompose animation // tell OpenLayers to continue the postcompose animation

View File

@@ -1,33 +1,33 @@
// NOCOMPILE // NOCOMPILE
goog.require('ol.Feature'); import _ol_Feature_ from '../src/ol/Feature.js';
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.geom.LineString'); import _ol_geom_LineString_ from '../src/ol/geom/LineString.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.layer.Vector'); import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
goog.require('ol.proj'); import _ol_proj_ from '../src/ol/proj.js';
goog.require('ol.source.Stamen'); import _ol_source_Stamen_ from '../src/ol/source/Stamen.js';
goog.require('ol.source.Vector'); import _ol_source_Vector_ from '../src/ol/source/Vector.js';
goog.require('ol.style.Stroke'); import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
goog.require('ol.style.Style'); import _ol_style_Style_ from '../src/ol/style/Style.js';
var map = new ol.Map({ var map = new _ol_Map_({
layers: [ layers: [
new ol.layer.Tile({ new _ol_layer_Tile_({
source: new ol.source.Stamen({ source: new _ol_source_Stamen_({
layer: 'toner' layer: 'toner'
}) })
}) })
], ],
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: [0, 0], center: [0, 0],
zoom: 2 zoom: 2
}) })
}); });
var style = new ol.style.Style({ var style = new _ol_style_Style_({
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
color: '#EAE911', color: '#EAE911',
width: 2 width: 2
}) })
@@ -61,7 +61,7 @@ var animateFlights = function(event) {
} }
var maxIndex = Math.min(elapsedPoints, coords.length); var maxIndex = Math.min(elapsedPoints, coords.length);
var currentLine = new ol.geom.LineString(coords.slice(0, maxIndex)); var currentLine = new _ol_geom_LineString_(coords.slice(0, maxIndex));
// directly draw the line with the vector context // directly draw the line with the vector context
vectorContext.drawGeometry(currentLine); vectorContext.drawGeometry(currentLine);
@@ -71,7 +71,7 @@ var animateFlights = function(event) {
map.render(); map.render();
}; };
flightsSource = new ol.source.Vector({ flightsSource = new _ol_source_Vector_({
wrapX: false, wrapX: false,
attributions: 'Flight data by ' + attributions: 'Flight data by ' +
'<a href="http://openflights.org/data.html">OpenFlights</a>,', '<a href="http://openflights.org/data.html">OpenFlights</a>,',
@@ -93,10 +93,10 @@ flightsSource = new ol.source.Vector({
var arcLine = arcGenerator.Arc(100, {offset: 10}); var arcLine = arcGenerator.Arc(100, {offset: 10});
if (arcLine.geometries.length === 1) { if (arcLine.geometries.length === 1) {
var line = new ol.geom.LineString(arcLine.geometries[0].coords); var line = new _ol_geom_LineString_(arcLine.geometries[0].coords);
line.transform(ol.proj.get('EPSG:4326'), ol.proj.get('EPSG:3857')); line.transform(_ol_proj_.get('EPSG:4326'), _ol_proj_.get('EPSG:3857'));
var feature = new ol.Feature({ var feature = new _ol_Feature_({
geometry: line, geometry: line,
finished: false finished: false
}); });
@@ -110,7 +110,7 @@ flightsSource = new ol.source.Vector({
} }
}); });
var flightsLayer = new ol.layer.Vector({ var flightsLayer = new _ol_layer_Vector_({
source: flightsSource, source: flightsSource,
style: function(feature) { style: function(feature) {
// if the animation is still active for a feature, do not // if the animation is still active for a feature, do not

View File

@@ -1,9 +1,9 @@
goog.require('ol.Feature'); import _ol_Feature_ from '../src/ol/Feature.js';
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.geom.LineString'); import _ol_geom_LineString_ from '../src/ol/geom/LineString.js';
goog.require('ol.layer.Vector'); import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
goog.require('ol.source.Vector'); import _ol_source_Vector_ from '../src/ol/source/Vector.js';
var radius = 10e6; var radius = 10e6;
var cos30 = Math.cos(Math.PI / 6); var cos30 = Math.cos(Math.PI / 6);
@@ -11,22 +11,22 @@ var sin30 = Math.sin(Math.PI / 6);
var rise = radius * sin30; var rise = radius * sin30;
var run = radius * cos30; var run = radius * cos30;
var triangle = new ol.geom.LineString([ var triangle = new _ol_geom_LineString_([
[0, radius], [run, -rise], [-run, -rise], [0, radius] [0, radius], [run, -rise], [-run, -rise], [0, radius]
]); ]);
var feature = new ol.Feature(triangle); var feature = new _ol_Feature_(triangle);
var layer = new ol.layer.Vector({ var layer = new _ol_layer_Vector_({
source: new ol.source.Vector({ source: new _ol_source_Vector_({
features: [feature] features: [feature]
}) })
}); });
var map = new ol.Map({ var map = new _ol_Map_({
layers: [layer], layers: [layer],
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: [0, 0], center: [0, 0],
zoom: 1 zoom: 1
}) })

View File

@@ -1,23 +1,23 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.control'); import _ol_control_ from '../src/ol/control.js';
goog.require('ol.control.FullScreen'); import _ol_control_FullScreen_ from '../src/ol/control/FullScreen.js';
goog.require('ol.interaction'); import _ol_interaction_ from '../src/ol/interaction.js';
goog.require('ol.interaction.DragRotateAndZoom'); import _ol_interaction_DragRotateAndZoom_ from '../src/ol/interaction/DragRotateAndZoom.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.source.BingMaps'); import _ol_source_BingMaps_ from '../src/ol/source/BingMaps.js';
var map = new ol.Map({ var map = new _ol_Map_({
controls: ol.control.defaults().extend([ controls: _ol_control_.defaults().extend([
new ol.control.FullScreen() new _ol_control_FullScreen_()
]), ]),
interactions: ol.interaction.defaults().extend([ interactions: _ol_interaction_.defaults().extend([
new ol.interaction.DragRotateAndZoom() new _ol_interaction_DragRotateAndZoom_()
]), ]),
layers: [ layers: [
new ol.layer.Tile({ new _ol_layer_Tile_({
source: new ol.source.BingMaps({ source: new _ol_source_BingMaps_({
key: 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5', key: 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5',
imagerySet: 'Aerial' imagerySet: 'Aerial'
}) })
@@ -25,7 +25,7 @@ var map = new ol.Map({
], ],
// Use the canvas renderer because it's currently the fastest // Use the canvas renderer because it's currently the fastest
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: [-33519607, 5616436], center: [-33519607, 5616436],
rotation: -Math.PI / 8, rotation: -Math.PI / 8,
zoom: 8 zoom: 8

View File

@@ -1,25 +1,25 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.control'); import _ol_control_ from '../src/ol/control.js';
goog.require('ol.control.FullScreen'); import _ol_control_FullScreen_ from '../src/ol/control/FullScreen.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.source.OSM'); import _ol_source_OSM_ from '../src/ol/source/OSM.js';
var view = new ol.View({ var view = new _ol_View_({
center: [-9101767, 2822912], center: [-9101767, 2822912],
zoom: 14 zoom: 14
}); });
var map = new ol.Map({ var map = new _ol_Map_({
controls: ol.control.defaults().extend([ controls: _ol_control_.defaults().extend([
new ol.control.FullScreen({ new _ol_control_FullScreen_({
source: 'fullscreen' source: 'fullscreen'
}) })
]), ]),
layers: [ layers: [
new ol.layer.Tile({ new _ol_layer_Tile_({
source: new ol.source.OSM() source: new _ol_source_OSM_()
}) })
], ],
target: 'map', target: 'map',

View File

@@ -1,23 +1,23 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.control'); import _ol_control_ from '../src/ol/control.js';
goog.require('ol.control.FullScreen'); import _ol_control_FullScreen_ from '../src/ol/control/FullScreen.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.source.BingMaps'); import _ol_source_BingMaps_ from '../src/ol/source/BingMaps.js';
var view = new ol.View({ var view = new _ol_View_({
center: [-9101767, 2822912], center: [-9101767, 2822912],
zoom: 14 zoom: 14
}); });
var map = new ol.Map({ var map = new _ol_Map_({
controls: ol.control.defaults().extend([ controls: _ol_control_.defaults().extend([
new ol.control.FullScreen() new _ol_control_FullScreen_()
]), ]),
layers: [ layers: [
new ol.layer.Tile({ new _ol_layer_Tile_({
source: new ol.source.BingMaps({ source: new _ol_source_BingMaps_({
key: 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5', key: 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5',
imagerySet: 'Aerial' imagerySet: 'Aerial'
}) })

View File

@@ -1,12 +1,12 @@
// NOCOMPILE // NOCOMPILE
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.format.GeoJSON'); import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js';
goog.require('ol.source.OSM'); import _ol_source_OSM_ from '../src/ol/source/OSM.js';
goog.require('ol.source.VectorTile'); import _ol_source_VectorTile_ from '../src/ol/source/VectorTile.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.layer.VectorTile'); import _ol_layer_VectorTile_ from '../src/ol/layer/VectorTile.js';
goog.require('ol.proj.Projection'); import _ol_proj_Projection_ from '../src/ol/proj/Projection.js';
var replacer = function(key, value) { var replacer = function(key, value) {
@@ -48,19 +48,19 @@ var replacer = function(key, value) {
} }
}; };
var tilePixels = new ol.proj.Projection({ var tilePixels = new _ol_proj_Projection_({
code: 'TILE_PIXELS', code: 'TILE_PIXELS',
units: 'tile-pixels' units: 'tile-pixels'
}); });
var map = new ol.Map({ var map = new _ol_Map_({
layers: [ layers: [
new ol.layer.Tile({ new _ol_layer_Tile_({
source: new ol.source.OSM() source: new _ol_source_OSM_()
}) })
], ],
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: [0, 0], center: [0, 0],
zoom: 2 zoom: 2
}) })
@@ -74,8 +74,8 @@ fetch(url).then(function(response) {
extent: 4096, extent: 4096,
debug: 1 debug: 1
}); });
var vectorSource = new ol.source.VectorTile({ var vectorSource = new _ol_source_VectorTile_({
format: new ol.format.GeoJSON(), format: new _ol_format_GeoJSON_(),
tileLoadFunction: function(tile) { tileLoadFunction: function(tile) {
var format = tile.getFormat(); var format = tile.getFormat();
var tileCoord = tile.getTileCoord(); var tileCoord = tile.getTileCoord();
@@ -93,7 +93,7 @@ fetch(url).then(function(response) {
}, },
url: 'data:' // arbitrary url, we don't use it in the tileLoadFunction url: 'data:' // arbitrary url, we don't use it in the tileLoadFunction
}); });
var vectorLayer = new ol.layer.VectorTile({ var vectorLayer = new _ol_layer_VectorTile_({
source: vectorSource source: vectorSource
}); });
map.addLayer(vectorLayer); map.addLayer(vectorLayer);

View File

@@ -1,85 +1,85 @@
goog.require('ol.Feature'); import _ol_Feature_ from '../src/ol/Feature.js';
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.control'); import _ol_control_ from '../src/ol/control.js';
goog.require('ol.format.GeoJSON'); import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js';
goog.require('ol.geom.Circle'); import _ol_geom_Circle_ from '../src/ol/geom/Circle.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.layer.Vector'); import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
goog.require('ol.source.OSM'); import _ol_source_OSM_ from '../src/ol/source/OSM.js';
goog.require('ol.source.Vector'); import _ol_source_Vector_ from '../src/ol/source/Vector.js';
goog.require('ol.style.Circle'); import _ol_style_Circle_ from '../src/ol/style/Circle.js';
goog.require('ol.style.Fill'); import _ol_style_Fill_ from '../src/ol/style/Fill.js';
goog.require('ol.style.Stroke'); import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
goog.require('ol.style.Style'); import _ol_style_Style_ from '../src/ol/style/Style.js';
var image = new ol.style.Circle({ var image = new _ol_style_Circle_({
radius: 5, radius: 5,
fill: null, fill: null,
stroke: new ol.style.Stroke({color: 'red', width: 1}) stroke: new _ol_style_Stroke_({color: 'red', width: 1})
}); });
var styles = { var styles = {
'Point': new ol.style.Style({ 'Point': new _ol_style_Style_({
image: image image: image
}), }),
'LineString': new ol.style.Style({ 'LineString': new _ol_style_Style_({
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
color: 'green', color: 'green',
width: 1 width: 1
}) })
}), }),
'MultiLineString': new ol.style.Style({ 'MultiLineString': new _ol_style_Style_({
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
color: 'green', color: 'green',
width: 1 width: 1
}) })
}), }),
'MultiPoint': new ol.style.Style({ 'MultiPoint': new _ol_style_Style_({
image: image image: image
}), }),
'MultiPolygon': new ol.style.Style({ 'MultiPolygon': new _ol_style_Style_({
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
color: 'yellow', color: 'yellow',
width: 1 width: 1
}), }),
fill: new ol.style.Fill({ fill: new _ol_style_Fill_({
color: 'rgba(255, 255, 0, 0.1)' color: 'rgba(255, 255, 0, 0.1)'
}) })
}), }),
'Polygon': new ol.style.Style({ 'Polygon': new _ol_style_Style_({
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
color: 'blue', color: 'blue',
lineDash: [4], lineDash: [4],
width: 3 width: 3
}), }),
fill: new ol.style.Fill({ fill: new _ol_style_Fill_({
color: 'rgba(0, 0, 255, 0.1)' color: 'rgba(0, 0, 255, 0.1)'
}) })
}), }),
'GeometryCollection': new ol.style.Style({ 'GeometryCollection': new _ol_style_Style_({
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
color: 'magenta', color: 'magenta',
width: 2 width: 2
}), }),
fill: new ol.style.Fill({ fill: new _ol_style_Fill_({
color: 'magenta' color: 'magenta'
}), }),
image: new ol.style.Circle({ image: new _ol_style_Circle_({
radius: 10, radius: 10,
fill: null, fill: null,
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
color: 'magenta' color: 'magenta'
}) })
}) })
}), }),
'Circle': new ol.style.Style({ 'Circle': new _ol_style_Style_({
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
color: 'red', color: 'red',
width: 2 width: 2
}), }),
fill: new ol.style.Fill({ fill: new _ol_style_Fill_({
color: 'rgba(255,0,0,0.2)' color: 'rgba(255,0,0,0.2)'
}) })
}) })
@@ -160,31 +160,31 @@ var geojsonObject = {
}] }]
}; };
var vectorSource = new ol.source.Vector({ var vectorSource = new _ol_source_Vector_({
features: (new ol.format.GeoJSON()).readFeatures(geojsonObject) features: (new _ol_format_GeoJSON_()).readFeatures(geojsonObject)
}); });
vectorSource.addFeature(new ol.Feature(new ol.geom.Circle([5e6, 7e6], 1e6))); vectorSource.addFeature(new _ol_Feature_(new _ol_geom_Circle_([5e6, 7e6], 1e6)));
var vectorLayer = new ol.layer.Vector({ var vectorLayer = new _ol_layer_Vector_({
source: vectorSource, source: vectorSource,
style: styleFunction style: styleFunction
}); });
var map = new ol.Map({ var map = new _ol_Map_({
layers: [ layers: [
new ol.layer.Tile({ new _ol_layer_Tile_({
source: new ol.source.OSM() source: new _ol_source_OSM_()
}), }),
vectorLayer vectorLayer
], ],
target: 'map', target: 'map',
controls: ol.control.defaults({ controls: _ol_control_.defaults({
attributionOptions: { attributionOptions: {
collapsible: false collapsible: false
} }
}), }),
view: new ol.View({ view: new _ol_View_({
center: [0, 0], center: [0, 0],
zoom: 2 zoom: 2
}) })

View File

@@ -1,28 +1,28 @@
goog.require('ol.Geolocation'); import _ol_Geolocation_ from '../src/ol/Geolocation.js';
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.Overlay'); import _ol_Overlay_ from '../src/ol/Overlay.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.control'); import _ol_control_ from '../src/ol/control.js';
goog.require('ol.geom.LineString'); import _ol_geom_LineString_ from '../src/ol/geom/LineString.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.proj'); import _ol_proj_ from '../src/ol/proj.js';
goog.require('ol.source.OSM'); import _ol_source_OSM_ from '../src/ol/source/OSM.js';
// creating the view // creating the view
var view = new ol.View({ var view = new _ol_View_({
center: ol.proj.fromLonLat([5.8713, 45.6452]), center: _ol_proj_.fromLonLat([5.8713, 45.6452]),
zoom: 19 zoom: 19
}); });
// creating the map // creating the map
var map = new ol.Map({ var map = new _ol_Map_({
layers: [ layers: [
new ol.layer.Tile({ new _ol_layer_Tile_({
source: new ol.source.OSM() source: new _ol_source_OSM_()
}) })
], ],
target: 'map', target: 'map',
controls: ol.control.defaults({ controls: _ol_control_.defaults({
attributionOptions: { attributionOptions: {
collapsible: false collapsible: false
} }
@@ -32,7 +32,7 @@ var map = new ol.Map({
// Geolocation marker // Geolocation marker
var markerEl = document.getElementById('geolocation_marker'); var markerEl = document.getElementById('geolocation_marker');
var marker = new ol.Overlay({ var marker = new _ol_Overlay_({
positioning: 'center-center', positioning: 'center-center',
element: markerEl, element: markerEl,
stopEvent: false stopEvent: false
@@ -42,11 +42,11 @@ map.addOverlay(marker);
// LineString to store the different geolocation positions. This LineString // LineString to store the different geolocation positions. This LineString
// is time aware. // is time aware.
// The Z dimension is actually used to store the rotation (heading). // The Z dimension is actually used to store the rotation (heading).
var positions = new ol.geom.LineString([], var positions = new _ol_geom_LineString_([],
/** @type {ol.geom.GeometryLayout} */ ('XYZM')); /** @type {ol.geom.GeometryLayout} */ ('XYZM'));
// Geolocation Control // Geolocation Control
var geolocation = new ol.Geolocation({ var geolocation = new _ol_Geolocation_({
projection: view.getProjection(), projection: view.getProjection(),
trackingOptions: { trackingOptions: {
maximumAge: 10000, maximumAge: 10000,
@@ -215,7 +215,7 @@ function simulatePositionChange(position) {
geolocation.set('accuracy', coords.accuracy); geolocation.set('accuracy', coords.accuracy);
geolocation.set('heading', degToRad(coords.heading)); geolocation.set('heading', degToRad(coords.heading));
var position_ = [coords.longitude, coords.latitude]; var position_ = [coords.longitude, coords.latitude];
var projectedPosition = ol.proj.transform(position_, 'EPSG:4326', var projectedPosition = _ol_proj_.transform(position_, 'EPSG:4326',
'EPSG:3857'); 'EPSG:3857');
geolocation.set('position', projectedPosition); geolocation.set('position', projectedPosition);
geolocation.set('speed', coords.speed); geolocation.set('speed', coords.speed);

View File

@@ -1,31 +1,31 @@
goog.require('ol.Feature'); import _ol_Feature_ from '../src/ol/Feature.js';
goog.require('ol.Geolocation'); import _ol_Geolocation_ from '../src/ol/Geolocation.js';
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.control'); import _ol_control_ from '../src/ol/control.js';
goog.require('ol.geom.Point'); import _ol_geom_Point_ from '../src/ol/geom/Point.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.layer.Vector'); import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
goog.require('ol.source.OSM'); import _ol_source_OSM_ from '../src/ol/source/OSM.js';
goog.require('ol.source.Vector'); import _ol_source_Vector_ from '../src/ol/source/Vector.js';
goog.require('ol.style.Circle'); import _ol_style_Circle_ from '../src/ol/style/Circle.js';
goog.require('ol.style.Fill'); import _ol_style_Fill_ from '../src/ol/style/Fill.js';
goog.require('ol.style.Stroke'); import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
goog.require('ol.style.Style'); import _ol_style_Style_ from '../src/ol/style/Style.js';
var view = new ol.View({ var view = new _ol_View_({
center: [0, 0], center: [0, 0],
zoom: 2 zoom: 2
}); });
var map = new ol.Map({ var map = new _ol_Map_({
layers: [ layers: [
new ol.layer.Tile({ new _ol_layer_Tile_({
source: new ol.source.OSM() source: new _ol_source_OSM_()
}) })
], ],
target: 'map', target: 'map',
controls: ol.control.defaults({ controls: _ol_control_.defaults({
attributionOptions: { attributionOptions: {
collapsible: false collapsible: false
} }
@@ -33,7 +33,7 @@ var map = new ol.Map({
view: view view: view
}); });
var geolocation = new ol.Geolocation({ var geolocation = new _ol_Geolocation_({
projection: view.getProjection() projection: view.getProjection()
}); });
@@ -61,19 +61,19 @@ geolocation.on('error', function(error) {
info.style.display = ''; info.style.display = '';
}); });
var accuracyFeature = new ol.Feature(); var accuracyFeature = new _ol_Feature_();
geolocation.on('change:accuracyGeometry', function() { geolocation.on('change:accuracyGeometry', function() {
accuracyFeature.setGeometry(geolocation.getAccuracyGeometry()); accuracyFeature.setGeometry(geolocation.getAccuracyGeometry());
}); });
var positionFeature = new ol.Feature(); var positionFeature = new _ol_Feature_();
positionFeature.setStyle(new ol.style.Style({ positionFeature.setStyle(new _ol_style_Style_({
image: new ol.style.Circle({ image: new _ol_style_Circle_({
radius: 6, radius: 6,
fill: new ol.style.Fill({ fill: new _ol_style_Fill_({
color: '#3399CC' color: '#3399CC'
}), }),
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
color: '#fff', color: '#fff',
width: 2 width: 2
}) })
@@ -83,12 +83,12 @@ positionFeature.setStyle(new ol.style.Style({
geolocation.on('change:position', function() { geolocation.on('change:position', function() {
var coordinates = geolocation.getPosition(); var coordinates = geolocation.getPosition();
positionFeature.setGeometry(coordinates ? positionFeature.setGeometry(coordinates ?
new ol.geom.Point(coordinates) : null); new _ol_geom_Point_(coordinates) : null);
}); });
new ol.layer.Vector({ new _ol_layer_Vector_({
map: map, map: map,
source: new ol.source.Vector({ source: new _ol_source_Vector_({
features: [accuracyFeature, positionFeature] features: [accuracyFeature, positionFeature]
}) })
}); });

View File

@@ -1,26 +1,26 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.layer.Image'); import _ol_layer_Image_ from '../src/ol/layer/Image.js';
goog.require('ol.source.ImageWMS'); import _ol_source_ImageWMS_ from '../src/ol/source/ImageWMS.js';
var wmsSource = new ol.source.ImageWMS({ var wmsSource = new _ol_source_ImageWMS_({
url: 'https://ahocevar.com/geoserver/wms', url: 'https://ahocevar.com/geoserver/wms',
params: {'LAYERS': 'ne:ne'}, params: {'LAYERS': 'ne:ne'},
serverType: 'geoserver', serverType: 'geoserver',
crossOrigin: 'anonymous' crossOrigin: 'anonymous'
}); });
var wmsLayer = new ol.layer.Image({ var wmsLayer = new _ol_layer_Image_({
source: wmsSource source: wmsSource
}); });
var view = new ol.View({ var view = new _ol_View_({
center: [0, 0], center: [0, 0],
zoom: 1 zoom: 1
}); });
var map = new ol.Map({ var map = new _ol_Map_({
layers: [wmsLayer], layers: [wmsLayer],
target: 'map', target: 'map',
view: view view: view

View File

@@ -1,21 +1,21 @@
goog.require('ol.format.WMSGetFeatureInfo'); import _ol_format_WMSGetFeatureInfo_ from '../src/ol/format/WMSGetFeatureInfo.js';
fetch('data/wmsgetfeatureinfo/osm-restaurant-hotel.xml').then(function(response) { fetch('data/wmsgetfeatureinfo/osm-restaurant-hotel.xml').then(function(response) {
return response.text(); return response.text();
}).then(function(response) { }).then(function(response) {
// this is the standard way to read the features // this is the standard way to read the features
var allFeatures = new ol.format.WMSGetFeatureInfo().readFeatures(response); var allFeatures = new _ol_format_WMSGetFeatureInfo_().readFeatures(response);
document.getElementById('all').innerText = allFeatures.length.toString(); document.getElementById('all').innerText = allFeatures.length.toString();
// when specifying the 'layers' options, only the features of those // when specifying the 'layers' options, only the features of those
// layers are returned by the format // layers are returned by the format
var hotelFeatures = new ol.format.WMSGetFeatureInfo({ var hotelFeatures = new _ol_format_WMSGetFeatureInfo_({
layers: ['hotel'] layers: ['hotel']
}).readFeatures(response); }).readFeatures(response);
document.getElementById('hotel').innerText = hotelFeatures.length.toString(); document.getElementById('hotel').innerText = hotelFeatures.length.toString();
var restaurantFeatures = new ol.format.WMSGetFeatureInfo({ var restaurantFeatures = new _ol_format_WMSGetFeatureInfo_({
layers: ['restaurant'] layers: ['restaurant']
}).readFeatures(response); }).readFeatures(response);
document.getElementById('restaurant').innerText = restaurantFeatures.length.toString(); document.getElementById('restaurant').innerText = restaurantFeatures.length.toString();

View File

@@ -1,26 +1,26 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.source.TileWMS'); import _ol_source_TileWMS_ from '../src/ol/source/TileWMS.js';
var wmsSource = new ol.source.TileWMS({ var wmsSource = new _ol_source_TileWMS_({
url: 'https://ahocevar.com/geoserver/wms', url: 'https://ahocevar.com/geoserver/wms',
params: {'LAYERS': 'ne:ne', 'TILED': true}, params: {'LAYERS': 'ne:ne', 'TILED': true},
serverType: 'geoserver', serverType: 'geoserver',
crossOrigin: 'anonymous' crossOrigin: 'anonymous'
}); });
var wmsLayer = new ol.layer.Tile({ var wmsLayer = new _ol_layer_Tile_({
source: wmsSource source: wmsSource
}); });
var view = new ol.View({ var view = new _ol_View_({
center: [0, 0], center: [0, 0],
zoom: 1 zoom: 1
}); });
var map = new ol.Map({ var map = new _ol_Map_({
layers: [wmsLayer], layers: [wmsLayer],
target: 'map', target: 'map',
view: view view: view

View File

@@ -1,63 +1,63 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.format.GPX'); import _ol_format_GPX_ from '../src/ol/format/GPX.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.layer.Vector'); import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
goog.require('ol.source.BingMaps'); import _ol_source_BingMaps_ from '../src/ol/source/BingMaps.js';
goog.require('ol.source.Vector'); import _ol_source_Vector_ from '../src/ol/source/Vector.js';
goog.require('ol.style.Circle'); import _ol_style_Circle_ from '../src/ol/style/Circle.js';
goog.require('ol.style.Fill'); import _ol_style_Fill_ from '../src/ol/style/Fill.js';
goog.require('ol.style.Stroke'); import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
goog.require('ol.style.Style'); import _ol_style_Style_ from '../src/ol/style/Style.js';
var raster = new ol.layer.Tile({ var raster = new _ol_layer_Tile_({
source: new ol.source.BingMaps({ source: new _ol_source_BingMaps_({
imagerySet: 'Aerial', imagerySet: 'Aerial',
key: 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5' key: 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5'
}) })
}); });
var style = { var style = {
'Point': new ol.style.Style({ 'Point': new _ol_style_Style_({
image: new ol.style.Circle({ image: new _ol_style_Circle_({
fill: new ol.style.Fill({ fill: new _ol_style_Fill_({
color: 'rgba(255,255,0,0.4)' color: 'rgba(255,255,0,0.4)'
}), }),
radius: 5, radius: 5,
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
color: '#ff0', color: '#ff0',
width: 1 width: 1
}) })
}) })
}), }),
'LineString': new ol.style.Style({ 'LineString': new _ol_style_Style_({
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
color: '#f00', color: '#f00',
width: 3 width: 3
}) })
}), }),
'MultiLineString': new ol.style.Style({ 'MultiLineString': new _ol_style_Style_({
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
color: '#0f0', color: '#0f0',
width: 3 width: 3
}) })
}) })
}; };
var vector = new ol.layer.Vector({ var vector = new _ol_layer_Vector_({
source: new ol.source.Vector({ source: new _ol_source_Vector_({
url: 'data/gpx/fells_loop.gpx', url: 'data/gpx/fells_loop.gpx',
format: new ol.format.GPX() format: new _ol_format_GPX_()
}), }),
style: function(feature) { style: function(feature) {
return style[feature.getGeometry().getType()]; return style[feature.getGeometry().getType()];
} }
}); });
var map = new ol.Map({ var map = new _ol_Map_({
layers: [raster, vector], layers: [raster, vector],
target: document.getElementById('map'), target: document.getElementById('map'),
view: new ol.View({ view: new _ol_View_({
center: [-7916041.528716288, 5228379.045749711], center: [-7916041.528716288, 5228379.045749711],
zoom: 12 zoom: 12
}) })

View File

@@ -1,32 +1,32 @@
goog.require('ol.Graticule'); import _ol_Graticule_ from '../src/ol/Graticule.js';
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.proj'); import _ol_proj_ from '../src/ol/proj.js';
goog.require('ol.source.OSM'); import _ol_source_OSM_ from '../src/ol/source/OSM.js';
goog.require('ol.style.Stroke'); import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
var map = new ol.Map({ var map = new _ol_Map_({
layers: [ layers: [
new ol.layer.Tile({ new _ol_layer_Tile_({
source: new ol.source.OSM({ source: new _ol_source_OSM_({
wrapX: false wrapX: false
}) })
}) })
], ],
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: ol.proj.fromLonLat([4.8, 47.75]), center: _ol_proj_.fromLonLat([4.8, 47.75]),
extent: ol.proj.get('EPSG:3857').getExtent(), extent: _ol_proj_.get('EPSG:3857').getExtent(),
zoom: 5 zoom: 5
}) })
}); });
// Create the graticule component // Create the graticule component
var graticule = new ol.Graticule({ var graticule = new _ol_Graticule_({
// the style to use for the lines, optional. // the style to use for the lines, optional.
strokeStyle: new ol.style.Stroke({ strokeStyle: new _ol_style_Stroke_({
color: 'rgba(255,120,0,0.9)', color: 'rgba(255,120,0,0.9)',
width: 2, width: 2,
lineDash: [0.5, 4] lineDash: [0.5, 4]

View File

@@ -1,18 +1,18 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.format.KML'); import _ol_format_KML_ from '../src/ol/format/KML.js';
goog.require('ol.layer.Heatmap'); import _ol_layer_Heatmap_ from '../src/ol/layer/Heatmap.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.source.Stamen'); import _ol_source_Stamen_ from '../src/ol/source/Stamen.js';
goog.require('ol.source.Vector'); import _ol_source_Vector_ from '../src/ol/source/Vector.js';
var blur = document.getElementById('blur'); var blur = document.getElementById('blur');
var radius = document.getElementById('radius'); var radius = document.getElementById('radius');
var vector = new ol.layer.Heatmap({ var vector = new _ol_layer_Heatmap_({
source: new ol.source.Vector({ source: new _ol_source_Vector_({
url: 'data/kml/2012_Earthquakes_Mag5.kml', url: 'data/kml/2012_Earthquakes_Mag5.kml',
format: new ol.format.KML({ format: new _ol_format_KML_({
extractStyles: false extractStyles: false
}) })
}), }),
@@ -29,16 +29,16 @@ vector.getSource().on('addfeature', function(event) {
event.feature.set('weight', magnitude - 5); event.feature.set('weight', magnitude - 5);
}); });
var raster = new ol.layer.Tile({ var raster = new _ol_layer_Tile_({
source: new ol.source.Stamen({ source: new _ol_source_Stamen_({
layer: 'toner' layer: 'toner'
}) })
}); });
var map = new ol.Map({ var map = new _ol_Map_({
layers: [raster, vector], layers: [raster, vector],
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: [0, 0], center: [0, 0],
zoom: 2 zoom: 2
}) })

View File

@@ -1,7 +1,7 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.source.XYZ'); import _ol_source_XYZ_ from '../src/ol/source/XYZ.js';
var appId = 'kDm0Jq1K4Ak7Bwtn8uvk'; var appId = 'kDm0Jq1K4Ak7Bwtn8uvk';
var appCode = 'xnmvc4dKZrDfGlvQHXSvwQ'; var appCode = 'xnmvc4dKZrDfGlvQHXSvwQ';
@@ -56,10 +56,10 @@ var layers = [];
var i, ii; var i, ii;
for (i = 0, ii = hereLayers.length; i < ii; ++i) { for (i = 0, ii = hereLayers.length; i < ii; ++i) {
var layerDesc = hereLayers[i]; var layerDesc = hereLayers[i];
layers.push(new ol.layer.Tile({ layers.push(new _ol_layer_Tile_({
visible: false, visible: false,
preload: Infinity, preload: Infinity,
source: new ol.source.XYZ({ source: new _ol_source_XYZ_({
url: createUrl(urlTpl, layerDesc), url: createUrl(urlTpl, layerDesc),
attributions: 'Map Tiles &copy; ' + new Date().getFullYear() + ' ' + attributions: 'Map Tiles &copy; ' + new Date().getFullYear() + ' ' +
'<a href="http://developer.here.com">HERE</a>' '<a href="http://developer.here.com">HERE</a>'
@@ -67,13 +67,13 @@ for (i = 0, ii = hereLayers.length; i < ii; ++i) {
})); }));
} }
var map = new ol.Map({ var map = new _ol_Map_({
layers: layers, layers: layers,
// Improve user experience by loading tiles while dragging/zooming. Will make // Improve user experience by loading tiles while dragging/zooming. Will make
// zooming choppy on mobile or slow devices. // zooming choppy on mobile or slow devices.
loadTilesWhileInteracting: true, loadTilesWhileInteracting: true,
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: [921371.9389, 6358337.7609], center: [921371.9389, 6358337.7609],
zoom: 10 zoom: 10
}) })

View File

@@ -1,38 +1,38 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.layer.Vector'); import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
goog.require('ol.source.OSM'); import _ol_source_OSM_ from '../src/ol/source/OSM.js';
goog.require('ol.source.Vector'); import _ol_source_Vector_ from '../src/ol/source/Vector.js';
goog.require('ol.Feature'); import _ol_Feature_ from '../src/ol/Feature.js';
goog.require('ol.geom.LineString'); import _ol_geom_LineString_ from '../src/ol/geom/LineString.js';
goog.require('ol.style.Style'); import _ol_style_Style_ from '../src/ol/style/Style.js';
goog.require('ol.style.Stroke'); import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
var raster = new ol.layer.Tile({ var raster = new _ol_layer_Tile_({
source: new ol.source.OSM() source: new _ol_source_OSM_()
}); });
var style = new ol.style.Style({ var style = new _ol_style_Style_({
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
color: 'black', color: 'black',
width: 1 width: 1
}) })
}); });
var feature = new ol.Feature(new ol.geom.LineString([[-4000000, 0], [4000000, 0]])); var feature = new _ol_Feature_(new _ol_geom_LineString_([[-4000000, 0], [4000000, 0]]));
var vector = new ol.layer.Vector({ var vector = new _ol_layer_Vector_({
source: new ol.source.Vector({ source: new _ol_source_Vector_({
features: [feature] features: [feature]
}), }),
style: style style: style
}); });
var map = new ol.Map({ var map = new _ol_Map_({
layers: [raster, vector], layers: [raster, vector],
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: [0, 0], center: [0, 0],
zoom: 2 zoom: 2
}) })

View File

@@ -1,46 +1,46 @@
goog.require('ol.Feature'); import _ol_Feature_ from '../src/ol/Feature.js';
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.geom.Point'); import _ol_geom_Point_ from '../src/ol/geom/Point.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.layer.Vector'); import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
goog.require('ol.proj'); import _ol_proj_ from '../src/ol/proj.js';
goog.require('ol.source.TileJSON'); import _ol_source_TileJSON_ from '../src/ol/source/TileJSON.js';
goog.require('ol.source.Vector'); import _ol_source_Vector_ from '../src/ol/source/Vector.js';
goog.require('ol.style.Icon'); import _ol_style_Icon_ from '../src/ol/style/Icon.js';
goog.require('ol.style.Style'); import _ol_style_Style_ from '../src/ol/style/Style.js';
var rome = new ol.Feature({ var rome = new _ol_Feature_({
geometry: new ol.geom.Point(ol.proj.fromLonLat([12.5, 41.9])) geometry: new _ol_geom_Point_(_ol_proj_.fromLonLat([12.5, 41.9]))
}); });
var london = new ol.Feature({ var london = new _ol_Feature_({
geometry: new ol.geom.Point(ol.proj.fromLonLat([-0.12755, 51.507222])) geometry: new _ol_geom_Point_(_ol_proj_.fromLonLat([-0.12755, 51.507222]))
}); });
var madrid = new ol.Feature({ var madrid = new _ol_Feature_({
geometry: new ol.geom.Point(ol.proj.fromLonLat([-3.683333, 40.4])) geometry: new _ol_geom_Point_(_ol_proj_.fromLonLat([-3.683333, 40.4]))
}); });
rome.setStyle(new ol.style.Style({ rome.setStyle(new _ol_style_Style_({
image: new ol.style.Icon(/** @type {olx.style.IconOptions} */ ({ image: new _ol_style_Icon_(/** @type {olx.style.IconOptions} */ ({
color: '#8959A8', color: '#8959A8',
crossOrigin: 'anonymous', crossOrigin: 'anonymous',
src: 'data/dot.png' src: 'data/dot.png'
})) }))
})); }));
london.setStyle(new ol.style.Style({ london.setStyle(new _ol_style_Style_({
image: new ol.style.Icon(/** @type {olx.style.IconOptions} */ ({ image: new _ol_style_Icon_(/** @type {olx.style.IconOptions} */ ({
color: '#4271AE', color: '#4271AE',
crossOrigin: 'anonymous', crossOrigin: 'anonymous',
src: 'data/dot.png' src: 'data/dot.png'
})) }))
})); }));
madrid.setStyle(new ol.style.Style({ madrid.setStyle(new _ol_style_Style_({
image: new ol.style.Icon(/** @type {olx.style.IconOptions} */ ({ image: new _ol_style_Icon_(/** @type {olx.style.IconOptions} */ ({
color: [113, 140, 0], color: [113, 140, 0],
crossOrigin: 'anonymous', crossOrigin: 'anonymous',
src: 'data/dot.png' src: 'data/dot.png'
@@ -48,26 +48,26 @@ madrid.setStyle(new ol.style.Style({
})); }));
var vectorSource = new ol.source.Vector({ var vectorSource = new _ol_source_Vector_({
features: [rome, london, madrid] features: [rome, london, madrid]
}); });
var vectorLayer = new ol.layer.Vector({ var vectorLayer = new _ol_layer_Vector_({
source: vectorSource source: vectorSource
}); });
var rasterLayer = new ol.layer.Tile({ var rasterLayer = new _ol_layer_Tile_({
source: new ol.source.TileJSON({ source: new _ol_source_TileJSON_({
url: 'https://api.tiles.mapbox.com/v3/mapbox.geography-class.json?secure', url: 'https://api.tiles.mapbox.com/v3/mapbox.geography-class.json?secure',
crossOrigin: '' crossOrigin: ''
}) })
}); });
var map = new ol.Map({ var map = new _ol_Map_({
layers: [rasterLayer, vectorLayer], layers: [rasterLayer, vectorLayer],
target: document.getElementById('map'), target: document.getElementById('map'),
view: new ol.View({ view: new _ol_View_({
center: ol.proj.fromLonLat([2.896372, 44.60240]), center: _ol_proj_.fromLonLat([2.896372, 44.60240]),
zoom: 3 zoom: 3
}) })
}); });

View File

@@ -1,19 +1,19 @@
goog.require('ol.Feature'); import _ol_Feature_ from '../src/ol/Feature.js';
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.geom.Point'); import _ol_geom_Point_ from '../src/ol/geom/Point.js';
goog.require('ol.interaction.Select'); import _ol_interaction_Select_ from '../src/ol/interaction/Select.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.layer.Vector'); import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
goog.require('ol.source.Stamen'); import _ol_source_Stamen_ from '../src/ol/source/Stamen.js';
goog.require('ol.source.Vector'); import _ol_source_Vector_ from '../src/ol/source/Vector.js';
goog.require('ol.style.Icon'); import _ol_style_Icon_ from '../src/ol/style/Icon.js';
goog.require('ol.style.Style'); import _ol_style_Style_ from '../src/ol/style/Style.js';
function createStyle(src, img) { function createStyle(src, img) {
return new ol.style.Style({ return new _ol_style_Style_({
image: new ol.style.Icon(/** @type {olx.style.IconOptions} */ ({ image: new _ol_style_Icon_(/** @type {olx.style.IconOptions} */ ({
anchor: [0.5, 0.96], anchor: [0.5, 0.96],
crossOrigin: 'anonymous', crossOrigin: 'anonymous',
src: src, src: src,
@@ -23,30 +23,30 @@ function createStyle(src, img) {
}); });
} }
var iconFeature = new ol.Feature(new ol.geom.Point([0, 0])); var iconFeature = new _ol_Feature_(new _ol_geom_Point_([0, 0]));
iconFeature.set('style', createStyle('data/icon.png', undefined)); iconFeature.set('style', createStyle('data/icon.png', undefined));
var map = new ol.Map({ var map = new _ol_Map_({
layers: [ layers: [
new ol.layer.Tile({ new _ol_layer_Tile_({
source: new ol.source.Stamen({layer: 'watercolor'}) source: new _ol_source_Stamen_({layer: 'watercolor'})
}), }),
new ol.layer.Vector({ new _ol_layer_Vector_({
style: function(feature) { style: function(feature) {
return feature.get('style'); return feature.get('style');
}, },
source: new ol.source.Vector({features: [iconFeature]}) source: new _ol_source_Vector_({features: [iconFeature]})
}) })
], ],
target: document.getElementById('map'), target: document.getElementById('map'),
view: new ol.View({ view: new _ol_View_({
center: [0, 0], center: [0, 0],
zoom: 3 zoom: 3
}) })
}); });
var selectStyle = {}; var selectStyle = {};
var select = new ol.interaction.Select({ var select = new _ol_interaction_Select_({
style: function(feature) { style: function(feature) {
var image = feature.get('style').getImage().getImage(); var image = feature.get('style').getImage().getImage();
if (!selectStyle[image.src]) { if (!selectStyle[image.src]) {

View File

@@ -1,11 +1,11 @@
goog.require('ol.Feature'); import _ol_Feature_ from '../src/ol/Feature.js';
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.geom.Point'); import _ol_geom_Point_ from '../src/ol/geom/Point.js';
goog.require('ol.layer.Vector'); import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
goog.require('ol.source.Vector'); import _ol_source_Vector_ from '../src/ol/source/Vector.js';
goog.require('ol.style.Icon'); import _ol_style_Icon_ from '../src/ol/style/Icon.js';
goog.require('ol.style.Style'); import _ol_style_Style_ from '../src/ol/style/Style.js';
var iconInfo = [{ var iconInfo = [{
@@ -44,7 +44,7 @@ var iconCount = iconInfo.length;
var icons = new Array(iconCount); var icons = new Array(iconCount);
for (i = 0; i < iconCount; ++i) { for (i = 0; i < iconCount; ++i) {
var info = iconInfo[i]; var info = iconInfo[i];
icons[i] = new ol.style.Icon({ icons[i] = new _ol_style_Icon_({
offset: info.offset, offset: info.offset,
opacity: info.opacity, opacity: info.opacity,
rotateWithView: info.rotateWithView, rotateWithView: info.rotateWithView,
@@ -61,29 +61,29 @@ var features = new Array(featureCount);
var feature, geometry; var feature, geometry;
var e = 25000000; var e = 25000000;
for (i = 0; i < featureCount; ++i) { for (i = 0; i < featureCount; ++i) {
geometry = new ol.geom.Point( geometry = new _ol_geom_Point_(
[2 * e * Math.random() - e, 2 * e * Math.random() - e]); [2 * e * Math.random() - e, 2 * e * Math.random() - e]);
feature = new ol.Feature(geometry); feature = new _ol_Feature_(geometry);
feature.setStyle( feature.setStyle(
new ol.style.Style({ new _ol_style_Style_({
image: icons[i % (iconCount - 1)] image: icons[i % (iconCount - 1)]
}) })
); );
features[i] = feature; features[i] = feature;
} }
var vectorSource = new ol.source.Vector({ var vectorSource = new _ol_source_Vector_({
features: features features: features
}); });
var vector = new ol.layer.Vector({ var vector = new _ol_layer_Vector_({
source: vectorSource source: vectorSource
}); });
var map = new ol.Map({ var map = new _ol_Map_({
renderer: /** @type {Array<ol.renderer.Type>} */ (['webgl', 'canvas']), renderer: /** @type {Array<ol.renderer.Type>} */ (['webgl', 'canvas']),
layers: [vector], layers: [vector],
target: document.getElementById('map'), target: document.getElementById('map'),
view: new ol.View({ view: new _ol_View_({
center: [0, 0], center: [0, 0],
zoom: 5 zoom: 5
}) })
@@ -96,12 +96,12 @@ for (i = 0; i < featureCount; i += 30) {
overlayFeatures.push(clone); overlayFeatures.push(clone);
} }
new ol.layer.Vector({ new _ol_layer_Vector_({
map: map, map: map,
source: new ol.source.Vector({ source: new _ol_source_Vector_({
features: overlayFeatures features: overlayFeatures
}), }),
style: new ol.style.Style({ style: new _ol_style_Style_({
image: icons[iconCount - 1] image: icons[iconCount - 1]
}) })
}); });

View File

@@ -1,25 +1,25 @@
goog.require('ol.Feature'); import _ol_Feature_ from '../src/ol/Feature.js';
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.Overlay'); import _ol_Overlay_ from '../src/ol/Overlay.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.geom.Point'); import _ol_geom_Point_ from '../src/ol/geom/Point.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.layer.Vector'); import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
goog.require('ol.source.TileJSON'); import _ol_source_TileJSON_ from '../src/ol/source/TileJSON.js';
goog.require('ol.source.Vector'); import _ol_source_Vector_ from '../src/ol/source/Vector.js';
goog.require('ol.style.Icon'); import _ol_style_Icon_ from '../src/ol/style/Icon.js';
goog.require('ol.style.Style'); import _ol_style_Style_ from '../src/ol/style/Style.js';
var iconFeature = new ol.Feature({ var iconFeature = new _ol_Feature_({
geometry: new ol.geom.Point([0, 0]), geometry: new _ol_geom_Point_([0, 0]),
name: 'Null Island', name: 'Null Island',
population: 4000, population: 4000,
rainfall: 500 rainfall: 500
}); });
var iconStyle = new ol.style.Style({ var iconStyle = new _ol_style_Style_({
image: new ol.style.Icon(/** @type {olx.style.IconOptions} */ ({ image: new _ol_style_Icon_(/** @type {olx.style.IconOptions} */ ({
anchor: [0.5, 46], anchor: [0.5, 46],
anchorXUnits: 'fraction', anchorXUnits: 'fraction',
anchorYUnits: 'pixels', anchorYUnits: 'pixels',
@@ -29,25 +29,25 @@ var iconStyle = new ol.style.Style({
iconFeature.setStyle(iconStyle); iconFeature.setStyle(iconStyle);
var vectorSource = new ol.source.Vector({ var vectorSource = new _ol_source_Vector_({
features: [iconFeature] features: [iconFeature]
}); });
var vectorLayer = new ol.layer.Vector({ var vectorLayer = new _ol_layer_Vector_({
source: vectorSource source: vectorSource
}); });
var rasterLayer = new ol.layer.Tile({ var rasterLayer = new _ol_layer_Tile_({
source: new ol.source.TileJSON({ source: new _ol_source_TileJSON_({
url: 'https://api.tiles.mapbox.com/v3/mapbox.geography-class.json?secure', url: 'https://api.tiles.mapbox.com/v3/mapbox.geography-class.json?secure',
crossOrigin: '' crossOrigin: ''
}) })
}); });
var map = new ol.Map({ var map = new _ol_Map_({
layers: [rasterLayer, vectorLayer], layers: [rasterLayer, vectorLayer],
target: document.getElementById('map'), target: document.getElementById('map'),
view: new ol.View({ view: new _ol_View_({
center: [0, 0], center: [0, 0],
zoom: 3 zoom: 3
}) })
@@ -55,7 +55,7 @@ var map = new ol.Map({
var element = document.getElementById('popup'); var element = document.getElementById('popup');
var popup = new ol.Overlay({ var popup = new _ol_Overlay_({
element: element, element: element,
positioning: 'bottom-center', positioning: 'bottom-center',
stopEvent: false, stopEvent: false,

View File

@@ -1,18 +1,18 @@
goog.require('ol.Feature'); import _ol_Feature_ from '../src/ol/Feature.js';
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.control'); import _ol_control_ from '../src/ol/control.js';
goog.require('ol.format.IGC'); import _ol_format_IGC_ from '../src/ol/format/IGC.js';
goog.require('ol.geom.LineString'); import _ol_geom_LineString_ from '../src/ol/geom/LineString.js';
goog.require('ol.geom.Point'); import _ol_geom_Point_ from '../src/ol/geom/Point.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.layer.Vector'); import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
goog.require('ol.source.OSM'); import _ol_source_OSM_ from '../src/ol/source/OSM.js';
goog.require('ol.source.Vector'); import _ol_source_Vector_ from '../src/ol/source/Vector.js';
goog.require('ol.style.Circle'); import _ol_style_Circle_ from '../src/ol/style/Circle.js';
goog.require('ol.style.Fill'); import _ol_style_Fill_ from '../src/ol/style/Fill.js';
goog.require('ol.style.Stroke'); import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
goog.require('ol.style.Style'); import _ol_style_Style_ from '../src/ol/style/Style.js';
var colors = { var colors = {
@@ -28,8 +28,8 @@ var styleFunction = function(feature) {
var color = colors[feature.get('PLT')]; var color = colors[feature.get('PLT')];
var style = styleCache[color]; var style = styleCache[color];
if (!style) { if (!style) {
style = new ol.style.Style({ style = new _ol_style_Style_({
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
color: color, color: color,
width: 3 width: 3
}) })
@@ -39,7 +39,7 @@ var styleFunction = function(feature) {
return style; return style;
}; };
var vectorSource = new ol.source.Vector(); var vectorSource = new _ol_source_Vector_();
var igcUrls = [ var igcUrls = [
'data/igc/Clement-Latour.igc', 'data/igc/Clement-Latour.igc',
@@ -58,7 +58,7 @@ function get(url, callback) {
client.send(); client.send();
} }
var igcFormat = new ol.format.IGC(); var igcFormat = new _ol_format_IGC_();
for (var i = 0; i < igcUrls.length; ++i) { for (var i = 0; i < igcUrls.length; ++i) {
get(igcUrls[i], function(data) { get(igcUrls[i], function(data) {
var features = igcFormat.readFeatures(data, var features = igcFormat.readFeatures(data,
@@ -80,30 +80,30 @@ vectorSource.on('addfeature', function(event) {
}); });
var map = new ol.Map({ var map = new _ol_Map_({
layers: [ layers: [
new ol.layer.Tile({ new _ol_layer_Tile_({
source: new ol.source.OSM({ source: new _ol_source_OSM_({
attributions: [ attributions: [
'All maps © <a href="https://www.opencyclemap.org/">OpenCycleMap</a>', 'All maps © <a href="https://www.opencyclemap.org/">OpenCycleMap</a>',
ol.source.OSM.ATTRIBUTION _ol_source_OSM_.ATTRIBUTION
], ],
url: 'https://{a-c}.tile.thunderforest.com/cycle/{z}/{x}/{y}.png' + url: 'https://{a-c}.tile.thunderforest.com/cycle/{z}/{x}/{y}.png' +
'?apikey=0e6fc415256d4fbb9b5166a718591d71' '?apikey=0e6fc415256d4fbb9b5166a718591d71'
}) })
}), }),
new ol.layer.Vector({ new _ol_layer_Vector_({
source: vectorSource, source: vectorSource,
style: styleFunction style: styleFunction
}) })
], ],
target: 'map', target: 'map',
controls: ol.control.defaults({ controls: _ol_control_.defaults({
attributionOptions: { attributionOptions: {
collapsible: false collapsible: false
} }
}), }),
view: new ol.View({ view: new _ol_View_({
center: [703365.7089403362, 5714629.865071137], center: [703365.7089403362, 5714629.865071137],
zoom: 9 zoom: 9
}) })
@@ -123,7 +123,7 @@ var displaySnap = function(coordinate) {
var geometry = closestFeature.getGeometry(); var geometry = closestFeature.getGeometry();
var closestPoint = geometry.getClosestPoint(coordinate); var closestPoint = geometry.getClosestPoint(coordinate);
if (point === null) { if (point === null) {
point = new ol.geom.Point(closestPoint); point = new _ol_geom_Point_(closestPoint);
} else { } else {
point.setCoordinates(closestPoint); point.setCoordinates(closestPoint);
} }
@@ -132,7 +132,7 @@ var displaySnap = function(coordinate) {
closestFeature.get('PLT') + ' (' + date.toUTCString() + ')'; closestFeature.get('PLT') + ' (' + date.toUTCString() + ')';
var coordinates = [coordinate, [closestPoint[0], closestPoint[1]]]; var coordinates = [coordinate, [closestPoint[0], closestPoint[1]]];
if (line === null) { if (line === null) {
line = new ol.geom.LineString(coordinates); line = new _ol_geom_LineString_(coordinates);
} else { } else {
line.setCoordinates(coordinates); line.setCoordinates(coordinates);
} }
@@ -152,13 +152,13 @@ map.on('click', function(evt) {
displaySnap(evt.coordinate); displaySnap(evt.coordinate);
}); });
var stroke = new ol.style.Stroke({ var stroke = new _ol_style_Stroke_({
color: 'rgba(255,0,0,0.9)', color: 'rgba(255,0,0,0.9)',
width: 1 width: 1
}); });
var style = new ol.style.Style({ var style = new _ol_style_Style_({
stroke: stroke, stroke: stroke,
image: new ol.style.Circle({ image: new _ol_style_Circle_({
radius: 5, radius: 5,
fill: null, fill: null,
stroke: stroke stroke: stroke
@@ -175,13 +175,13 @@ map.on('postcompose', function(evt) {
} }
}); });
var featureOverlay = new ol.layer.Vector({ var featureOverlay = new _ol_layer_Vector_({
source: new ol.source.Vector(), source: new _ol_source_Vector_(),
map: map, map: map,
style: new ol.style.Style({ style: new _ol_style_Style_({
image: new ol.style.Circle({ image: new _ol_style_Circle_({
radius: 5, radius: 5,
fill: new ol.style.Fill({ fill: new _ol_style_Fill_({
color: 'rgba(255,0,0,0.9)' color: 'rgba(255,0,0,0.9)'
}) })
}) })
@@ -196,7 +196,7 @@ document.getElementById('time').addEventListener('input', function() {
var coordinate = geometry.getCoordinateAtM(m, true); var coordinate = geometry.getCoordinateAtM(m, true);
var highlight = feature.get('highlight'); var highlight = feature.get('highlight');
if (highlight === undefined) { if (highlight === undefined) {
highlight = new ol.Feature(new ol.geom.Point(coordinate)); highlight = new _ol_Feature_(new _ol_geom_Point_(coordinate));
feature.set('highlight', highlight); feature.set('highlight', highlight);
featureOverlay.getSource().addFeature(highlight); featureOverlay.getSource().addFeature(highlight);
} else { } else {

View File

@@ -1,20 +1,20 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.proj'); import _ol_proj_ from '../src/ol/proj.js';
goog.require('ol.source.BingMaps'); import _ol_source_BingMaps_ from '../src/ol/source/BingMaps.js';
var key = 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5'; var key = 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5';
var imagery = new ol.layer.Tile({ 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 map = new ol.Map({ var map = new _ol_Map_({
layers: [imagery], layers: [imagery],
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: ol.proj.fromLonLat([-120, 50]), center: _ol_proj_.fromLonLat([-120, 50]),
zoom: 6 zoom: 6
}) })
}); });

View File

@@ -1,7 +1,7 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.layer.Image'); import _ol_layer_Image_ from '../src/ol/layer/Image.js';
goog.require('ol.source.ImageWMS'); import _ol_source_ImageWMS_ from '../src/ol/source/ImageWMS.js';
/** /**
@@ -77,7 +77,7 @@ Progress.prototype.hide = function() {
var progress = new Progress(document.getElementById('progress')); var progress = new Progress(document.getElementById('progress'));
var source = new ol.source.ImageWMS({ var source = new _ol_source_ImageWMS_({
url: 'https://ahocevar.com/geoserver/wms', url: 'https://ahocevar.com/geoserver/wms',
params: {'LAYERS': 'topp:states'}, params: {'LAYERS': 'topp:states'},
serverType: 'geoserver' serverType: 'geoserver'
@@ -94,13 +94,13 @@ source.on('imageloaderror', function() {
progress.addLoaded(); progress.addLoaded();
}); });
var map = new ol.Map({ var map = new _ol_Map_({
logo: false, logo: false,
layers: [ layers: [
new ol.layer.Image({source: source}) new _ol_layer_Image_({source: source})
], ],
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: [-10997148, 4569099], center: [-10997148, 4569099],
zoom: 4 zoom: 4
}) })

View File

@@ -1,32 +1,32 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.format.GeoJSON'); import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js';
goog.require('ol.layer.Vector'); import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
goog.require('ol.source.Vector'); import _ol_source_Vector_ from '../src/ol/source/Vector.js';
goog.require('ol.style.Fill'); import _ol_style_Fill_ from '../src/ol/style/Fill.js';
goog.require('ol.style.Stroke'); import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
goog.require('ol.style.Style'); import _ol_style_Style_ from '../src/ol/style/Style.js';
goog.require('ol.style.Text'); import _ol_style_Text_ from '../src/ol/style/Text.js';
var style = new ol.style.Style({ var style = new _ol_style_Style_({
fill: new ol.style.Fill({ fill: new _ol_style_Fill_({
color: 'rgba(255, 255, 255, 0.6)' color: 'rgba(255, 255, 255, 0.6)'
}), }),
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
color: '#319FD3', color: '#319FD3',
width: 1 width: 1
}), }),
text: new ol.style.Text() text: new _ol_style_Text_()
}); });
var map = new ol.Map({ var map = new _ol_Map_({
layers: [ layers: [
new ol.layer.Vector({ new _ol_layer_Vector_({
renderMode: 'image', renderMode: 'image',
source: new ol.source.Vector({ source: new _ol_source_Vector_({
url: 'data/geojson/countries.geojson', url: 'data/geojson/countries.geojson',
format: new ol.format.GeoJSON() format: new _ol_format_GeoJSON_()
}), }),
style: function(feature) { style: function(feature) {
style.getText().setText(feature.get('name')); style.getText().setText(feature.get('name'));
@@ -35,21 +35,21 @@ var map = new ol.Map({
}) })
], ],
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: [0, 0], center: [0, 0],
zoom: 1 zoom: 1
}) })
}); });
var featureOverlay = new ol.layer.Vector({ var featureOverlay = new _ol_layer_Vector_({
source: new ol.source.Vector(), source: new _ol_source_Vector_(),
map: map, map: map,
style: new ol.style.Style({ style: new _ol_style_Style_({
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
color: '#f00', color: '#f00',
width: 1 width: 1
}), }),
fill: new ol.style.Fill({ fill: new _ol_style_Fill_({
color: 'rgba(255,0,0,0.1)' color: 'rgba(255,0,0,0.1)'
}) })
}) })

View File

@@ -1,20 +1,20 @@
// NOCOMPILE // NOCOMPILE
// this example uses JSTS for which we don't have an externs file. // this example uses JSTS for which we don't have an externs file.
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.format.GeoJSON'); import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.layer.Vector'); import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
goog.require('ol.proj'); import _ol_proj_ from '../src/ol/proj.js';
goog.require('ol.source.OSM'); import _ol_source_OSM_ from '../src/ol/source/OSM.js';
goog.require('ol.source.Vector'); import _ol_source_Vector_ from '../src/ol/source/Vector.js';
var source = new ol.source.Vector(); var source = new _ol_source_Vector_();
fetch('data/geojson/roads-seoul.geojson').then(function(response) { fetch('data/geojson/roads-seoul.geojson').then(function(response) {
return response.json(); return response.json();
}).then(function(json) { }).then(function(json) {
var format = new ol.format.GeoJSON(); var format = new _ol_format_GeoJSON_();
var features = format.readFeatures(json, {featureProjection: 'EPSG:3857'}); var features = format.readFeatures(json, {featureProjection: 'EPSG:3857'});
var parser = new jsts.io.OL3Parser(); var parser = new jsts.io.OL3Parser();
@@ -33,19 +33,19 @@ fetch('data/geojson/roads-seoul.geojson').then(function(response) {
source.addFeatures(features); source.addFeatures(features);
}); });
var vectorLayer = new ol.layer.Vector({ var vectorLayer = new _ol_layer_Vector_({
source: source source: source
}); });
var rasterLayer = new ol.layer.Tile({ var rasterLayer = new _ol_layer_Tile_({
source: new ol.source.OSM() source: new _ol_source_OSM_()
}); });
var map = new ol.Map({ var map = new _ol_Map_({
layers: [rasterLayer, vectorLayer], layers: [rasterLayer, vectorLayer],
target: document.getElementById('map'), target: document.getElementById('map'),
view: new ol.View({ view: new _ol_View_({
center: ol.proj.fromLonLat([126.979293, 37.528787]), center: _ol_proj_.fromLonLat([126.979293, 37.528787]),
zoom: 15 zoom: 15
}) })
}); });

View File

@@ -1,14 +1,14 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.format.KML'); import _ol_format_KML_ from '../src/ol/format/KML.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.layer.Vector'); import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
goog.require('ol.source.Stamen'); import _ol_source_Stamen_ from '../src/ol/source/Stamen.js';
goog.require('ol.source.Vector'); import _ol_source_Vector_ from '../src/ol/source/Vector.js';
goog.require('ol.style.Circle'); import _ol_style_Circle_ from '../src/ol/style/Circle.js';
goog.require('ol.style.Fill'); import _ol_style_Fill_ from '../src/ol/style/Fill.js';
goog.require('ol.style.Stroke'); import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
goog.require('ol.style.Style'); import _ol_style_Style_ from '../src/ol/style/Style.js';
var styleCache = {}; var styleCache = {};
@@ -21,13 +21,13 @@ var styleFunction = function(feature) {
var radius = 5 + 20 * (magnitude - 5); var radius = 5 + 20 * (magnitude - 5);
var style = styleCache[radius]; var style = styleCache[radius];
if (!style) { if (!style) {
style = new ol.style.Style({ style = new _ol_style_Style_({
image: new ol.style.Circle({ image: new _ol_style_Circle_({
radius: radius, radius: radius,
fill: new ol.style.Fill({ fill: new _ol_style_Fill_({
color: 'rgba(255, 153, 0, 0.4)' color: 'rgba(255, 153, 0, 0.4)'
}), }),
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
color: 'rgba(255, 204, 0, 0.2)', color: 'rgba(255, 204, 0, 0.2)',
width: 1 width: 1
}) })
@@ -38,26 +38,26 @@ var styleFunction = function(feature) {
return style; return style;
}; };
var vector = new ol.layer.Vector({ var vector = new _ol_layer_Vector_({
source: new ol.source.Vector({ source: new _ol_source_Vector_({
url: 'data/kml/2012_Earthquakes_Mag5.kml', url: 'data/kml/2012_Earthquakes_Mag5.kml',
format: new ol.format.KML({ format: new _ol_format_KML_({
extractStyles: false extractStyles: false
}) })
}), }),
style: styleFunction style: styleFunction
}); });
var raster = new ol.layer.Tile({ var raster = new _ol_layer_Tile_({
source: new ol.source.Stamen({ source: new _ol_source_Stamen_({
layer: 'toner' layer: 'toner'
}) })
}); });
var map = new ol.Map({ var map = new _ol_Map_({
layers: [raster, vector], layers: [raster, vector],
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: [0, 0], center: [0, 0],
zoom: 2 zoom: 2
}) })

View File

@@ -1,13 +1,13 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.format.KML'); import _ol_format_KML_ from '../src/ol/format/KML.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.layer.Vector'); import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
goog.require('ol.source.Stamen'); import _ol_source_Stamen_ from '../src/ol/source/Stamen.js';
goog.require('ol.source.Vector'); import _ol_source_Vector_ from '../src/ol/source/Vector.js';
goog.require('ol.style.Fill'); import _ol_style_Fill_ from '../src/ol/style/Fill.js';
goog.require('ol.style.Stroke'); import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
goog.require('ol.style.Style'); import _ol_style_Style_ from '../src/ol/style/Style.js';
/* /*
@@ -35,36 +35,36 @@ var styleFunction = function(feature) {
delta = 24 - delta; delta = 24 - delta;
} }
var opacity = 0.75 * (1 - delta / 12); var opacity = 0.75 * (1 - delta / 12);
return new ol.style.Style({ return new _ol_style_Style_({
fill: new ol.style.Fill({ fill: new _ol_style_Fill_({
color: [0xff, 0xff, 0x33, opacity] color: [0xff, 0xff, 0x33, opacity]
}), }),
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
color: '#ffffff' color: '#ffffff'
}) })
}); });
}; };
var vector = new ol.layer.Vector({ var vector = new _ol_layer_Vector_({
source: new ol.source.Vector({ source: new _ol_source_Vector_({
url: 'data/kml/timezones.kml', url: 'data/kml/timezones.kml',
format: new ol.format.KML({ format: new _ol_format_KML_({
extractStyles: false extractStyles: false
}) })
}), }),
style: styleFunction style: styleFunction
}); });
var raster = new ol.layer.Tile({ var raster = new _ol_layer_Tile_({
source: new ol.source.Stamen({ source: new _ol_source_Stamen_({
layer: 'toner' layer: 'toner'
}) })
}); });
var map = new ol.Map({ var map = new _ol_Map_({
layers: [raster, vector], layers: [raster, vector],
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: [0, 0], center: [0, 0],
zoom: 2 zoom: 2
}) })

View File

@@ -1,32 +1,32 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.format.KML'); import _ol_format_KML_ from '../src/ol/format/KML.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.layer.Vector'); import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
goog.require('ol.proj'); import _ol_proj_ from '../src/ol/proj.js';
goog.require('ol.source.BingMaps'); import _ol_source_BingMaps_ from '../src/ol/source/BingMaps.js';
goog.require('ol.source.Vector'); import _ol_source_Vector_ from '../src/ol/source/Vector.js';
var projection = ol.proj.get('EPSG:3857'); var projection = _ol_proj_.get('EPSG:3857');
var raster = new ol.layer.Tile({ var raster = new _ol_layer_Tile_({
source: new ol.source.BingMaps({ source: new _ol_source_BingMaps_({
imagerySet: 'Aerial', imagerySet: 'Aerial',
key: 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5' key: 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5'
}) })
}); });
var vector = new ol.layer.Vector({ var vector = new _ol_layer_Vector_({
source: new ol.source.Vector({ source: new _ol_source_Vector_({
url: 'data/kml/2012-02-10.kml', url: 'data/kml/2012-02-10.kml',
format: new ol.format.KML() format: new _ol_format_KML_()
}) })
}); });
var map = new ol.Map({ var map = new _ol_Map_({
layers: [raster, vector], layers: [raster, vector],
target: document.getElementById('map'), target: document.getElementById('map'),
view: new ol.View({ view: new _ol_View_({
center: [876970.8463461736, 5859807.853963373], center: [876970.8463461736, 5859807.853963373],
projection: projection, projection: projection,
zoom: 10 zoom: 10

View File

@@ -1,11 +1,11 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.control'); import _ol_control_ from '../src/ol/control.js';
goog.require('ol.has'); import _ol_has_ from '../src/ol/has.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.source.OSM'); import _ol_source_OSM_ from '../src/ol/source/OSM.js';
if (!ol.has.WEBGL) { if (!_ol_has_.WEBGL) {
var info = document.getElementById('no-webgl'); var info = document.getElementById('no-webgl');
/** /**
* display error message * display error message
@@ -13,20 +13,20 @@ if (!ol.has.WEBGL) {
info.style.display = ''; info.style.display = '';
} else { } else {
var osm = new ol.layer.Tile({ var osm = new _ol_layer_Tile_({
source: new ol.source.OSM() source: new _ol_source_OSM_()
}); });
var map = new ol.Map({ var map = new _ol_Map_({
layers: [osm], layers: [osm],
renderer: /** @type {Array<ol.renderer.Type>} */ (['webgl', 'canvas']), renderer: /** @type {Array<ol.renderer.Type>} */ (['webgl', 'canvas']),
target: 'map', target: 'map',
controls: ol.control.defaults({ controls: _ol_control_.defaults({
attributionOptions: { attributionOptions: {
collapsible: false collapsible: false
} }
}), }),
view: new ol.View({ view: new _ol_View_({
center: [0, 0], center: [0, 0],
zoom: 2 zoom: 2
}) })

View File

@@ -1,22 +1,22 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.control'); import _ol_control_ from '../src/ol/control.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.source.OSM'); import _ol_source_OSM_ from '../src/ol/source/OSM.js';
var osm = new ol.layer.Tile({ var osm = new _ol_layer_Tile_({
source: new ol.source.OSM() source: new _ol_source_OSM_()
}); });
var map = new ol.Map({ var map = new _ol_Map_({
layers: [osm], layers: [osm],
target: 'map', target: 'map',
controls: ol.control.defaults({ controls: _ol_control_.defaults({
attributionOptions: { attributionOptions: {
collapsible: false collapsible: false
} }
}), }),
view: new ol.View({ view: new _ol_View_({
center: [0, 0], center: [0, 0],
zoom: 2 zoom: 2
}) })

View File

@@ -1,11 +1,11 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.proj'); import _ol_proj_ from '../src/ol/proj.js';
goog.require('ol.source.TileJSON'); import _ol_source_TileJSON_ from '../src/ol/source/TileJSON.js';
function transform(extent) { function transform(extent) {
return ol.proj.transformExtent(extent, 'EPSG:4326', 'EPSG:3857'); return _ol_proj_.transformExtent(extent, 'EPSG:4326', 'EPSG:3857');
} }
var extents = { var extents = {
@@ -15,25 +15,25 @@ var extents = {
Sweden: transform([11.02737, 55.36174, 23.90338, 69.10625]) Sweden: transform([11.02737, 55.36174, 23.90338, 69.10625])
}; };
var base = new ol.layer.Tile({ var base = new _ol_layer_Tile_({
source: new ol.source.TileJSON({ source: new _ol_source_TileJSON_({
url: 'https://api.tiles.mapbox.com/v3/mapbox.world-light.json?secure', url: 'https://api.tiles.mapbox.com/v3/mapbox.world-light.json?secure',
crossOrigin: 'anonymous' crossOrigin: 'anonymous'
}) })
}); });
var overlay = new ol.layer.Tile({ var overlay = new _ol_layer_Tile_({
extent: extents.India, extent: extents.India,
source: new ol.source.TileJSON({ source: new _ol_source_TileJSON_({
url: 'https://api.tiles.mapbox.com/v3/mapbox.world-black.json?secure', url: 'https://api.tiles.mapbox.com/v3/mapbox.world-black.json?secure',
crossOrigin: 'anonymous' crossOrigin: 'anonymous'
}) })
}); });
var map = new ol.Map({ var map = new _ol_Map_({
layers: [base, overlay], layers: [base, overlay],
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: [0, 0], center: [0, 0],
zoom: 1 zoom: 1
}) })

View File

@@ -1,25 +1,25 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.layer.Group'); import _ol_layer_Group_ from '../src/ol/layer/Group.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.proj'); import _ol_proj_ from '../src/ol/proj.js';
goog.require('ol.source.OSM'); import _ol_source_OSM_ from '../src/ol/source/OSM.js';
goog.require('ol.source.TileJSON'); import _ol_source_TileJSON_ from '../src/ol/source/TileJSON.js';
var map = new ol.Map({ var map = new _ol_Map_({
layers: [ layers: [
new ol.layer.Tile({ new _ol_layer_Tile_({
source: new ol.source.OSM() source: new _ol_source_OSM_()
}), new ol.layer.Group({ }), new _ol_layer_Group_({
layers: [ layers: [
new ol.layer.Tile({ new _ol_layer_Tile_({
source: new ol.source.TileJSON({ source: new _ol_source_TileJSON_({
url: 'https://api.tiles.mapbox.com/v3/mapbox.20110804-hoa-foodinsecurity-3month.json?secure', url: 'https://api.tiles.mapbox.com/v3/mapbox.20110804-hoa-foodinsecurity-3month.json?secure',
crossOrigin: 'anonymous' crossOrigin: 'anonymous'
}) })
}), }),
new ol.layer.Tile({ new _ol_layer_Tile_({
source: new ol.source.TileJSON({ source: new _ol_source_TileJSON_({
url: 'https://api.tiles.mapbox.com/v3/mapbox.world-borders-light.json?secure', url: 'https://api.tiles.mapbox.com/v3/mapbox.world-borders-light.json?secure',
crossOrigin: 'anonymous' crossOrigin: 'anonymous'
}) })
@@ -28,8 +28,8 @@ var map = new ol.Map({
}) })
], ],
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: ol.proj.fromLonLat([37.40570, 8.81566]), center: _ol_proj_.fromLonLat([37.40570, 8.81566]),
zoom: 4 zoom: 4
}) })
}); });
@@ -49,7 +49,7 @@ function bindInputs(layerid, layer) {
} }
map.getLayers().forEach(function(layer, i) { map.getLayers().forEach(function(layer, i) {
bindInputs('#layer' + i, layer); bindInputs('#layer' + i, layer);
if (layer instanceof ol.layer.Group) { if (layer instanceof _ol_layer_Group_) {
layer.getLayers().forEach(function(sublayer, j) { layer.getLayers().forEach(function(sublayer, j) {
bindInputs('#layer' + i + j, sublayer); bindInputs('#layer' + i + j, sublayer);
}); });

View File

@@ -1,26 +1,26 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.proj'); import _ol_proj_ from '../src/ol/proj.js';
goog.require('ol.source.BingMaps'); import _ol_source_BingMaps_ from '../src/ol/source/BingMaps.js';
var key = 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5'; var key = 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5';
var roads = new ol.layer.Tile({ var roads = new _ol_layer_Tile_({
source: new ol.source.BingMaps({key: key, imagerySet: 'Road'}) source: new _ol_source_BingMaps_({key: key, imagerySet: 'Road'})
}); });
var imagery = new ol.layer.Tile({ 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 container = document.getElementById('map');
var map = new ol.Map({ var map = new _ol_Map_({
layers: [roads, imagery], layers: [roads, imagery],
target: container, 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
}) })
}); });

View File

@@ -1,29 +1,29 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.control'); import _ol_control_ from '../src/ol/control.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.source.BingMaps'); import _ol_source_BingMaps_ from '../src/ol/source/BingMaps.js';
goog.require('ol.source.OSM'); import _ol_source_OSM_ from '../src/ol/source/OSM.js';
var osm = new ol.layer.Tile({ var osm = new _ol_layer_Tile_({
source: new ol.source.OSM() source: new _ol_source_OSM_()
}); });
var bing = new ol.layer.Tile({ var bing = new _ol_layer_Tile_({
source: new ol.source.BingMaps({ source: new _ol_source_BingMaps_({
key: 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5', key: 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5',
imagerySet: 'Aerial' imagerySet: 'Aerial'
}) })
}); });
var map = new ol.Map({ var map = new _ol_Map_({
layers: [osm, bing], layers: [osm, bing],
target: 'map', target: 'map',
controls: ol.control.defaults({ controls: _ol_control_.defaults({
attributionOptions: { attributionOptions: {
collapsible: false collapsible: false
} }
}), }),
view: new ol.View({ view: new _ol_View_({
center: [0, 0], center: [0, 0],
zoom: 2 zoom: 2
}) })

View File

@@ -1,30 +1,30 @@
goog.require('ol.Feature'); import _ol_Feature_ from '../src/ol/Feature.js';
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.geom.Point'); import _ol_geom_Point_ from '../src/ol/geom/Point.js';
goog.require('ol.layer.Vector'); import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
goog.require('ol.source.Vector'); import _ol_source_Vector_ from '../src/ol/source/Vector.js';
goog.require('ol.style.Fill'); import _ol_style_Fill_ from '../src/ol/style/Fill.js';
goog.require('ol.style.RegularShape'); import _ol_style_RegularShape_ from '../src/ol/style/RegularShape.js';
goog.require('ol.style.Stroke'); import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
goog.require('ol.style.Style'); import _ol_style_Style_ from '../src/ol/style/Style.js';
var stroke = new ol.style.Stroke({color: 'black', width: 1}); var stroke = new _ol_style_Stroke_({color: 'black', width: 1});
var styles = { var styles = {
'square': new ol.style.Style({ 'square': new _ol_style_Style_({
image: new ol.style.RegularShape({ image: new _ol_style_RegularShape_({
fill: new ol.style.Fill({color: 'blue'}), fill: new _ol_style_Fill_({color: 'blue'}),
stroke: stroke, stroke: stroke,
points: 4, points: 4,
radius: 80, radius: 80,
angle: Math.PI / 4 angle: Math.PI / 4
}) })
}), }),
'triangle': new ol.style.Style({ 'triangle': new _ol_style_Style_({
image: new ol.style.RegularShape({ image: new _ol_style_RegularShape_({
fill: new ol.style.Fill({color: 'red'}), fill: new _ol_style_Fill_({color: 'red'}),
stroke: stroke, stroke: stroke,
points: 3, points: 3,
radius: 80, radius: 80,
@@ -32,9 +32,9 @@ var styles = {
angle: 0 angle: 0
}) })
}), }),
'star': new ol.style.Style({ 'star': new _ol_style_Style_({
image: new ol.style.RegularShape({ image: new _ol_style_RegularShape_({
fill: new ol.style.Fill({color: 'green'}), fill: new _ol_style_Fill_({color: 'green'}),
stroke: stroke, stroke: stroke,
points: 5, points: 5,
radius: 80, radius: 80,
@@ -46,14 +46,14 @@ var styles = {
function createLayer(coordinates, style, zIndex) { function createLayer(coordinates, style, zIndex) {
var feature = new ol.Feature(new ol.geom.Point(coordinates)); var feature = new _ol_Feature_(new _ol_geom_Point_(coordinates));
feature.setStyle(style); feature.setStyle(style);
var source = new ol.source.Vector({ var source = new _ol_source_Vector_({
features: [feature] features: [feature]
}); });
var vectorLayer = new ol.layer.Vector({ var vectorLayer = new _ol_layer_Vector_({
source: source source: source
}); });
vectorLayer.setZIndex(zIndex); vectorLayer.setZIndex(zIndex);
@@ -69,10 +69,10 @@ var layers = [];
layers.push(layer1); layers.push(layer1);
layers.push(layer2); layers.push(layer2);
var map = new ol.Map({ var map = new _ol_Map_({
layers: layers, layers: layers,
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: [0, 0], center: [0, 0],
zoom: 18 zoom: 18
}) })

View File

@@ -1,16 +1,16 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.source.OSM'); import _ol_source_OSM_ from '../src/ol/source/OSM.js';
var source = new ol.source.OSM(); var source = new _ol_source_OSM_();
var layer = new ol.layer.Tile(); var layer = new _ol_layer_Tile_();
var map = new ol.Map({ var map = new _ol_Map_({
layers: [layer], layers: [layer],
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: [0, 0], center: [0, 0],
zoom: 2 zoom: 2
}) })

View File

@@ -1,27 +1,27 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.geom.Point'); import _ol_geom_Point_ from '../src/ol/geom/Point.js';
goog.require('ol.interaction.Draw'); import _ol_interaction_Draw_ from '../src/ol/interaction/Draw.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.layer.Vector'); import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
goog.require('ol.source.OSM'); import _ol_source_OSM_ from '../src/ol/source/OSM.js';
goog.require('ol.source.Vector'); import _ol_source_Vector_ from '../src/ol/source/Vector.js';
goog.require('ol.style.Icon'); import _ol_style_Icon_ from '../src/ol/style/Icon.js';
goog.require('ol.style.Stroke'); import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
goog.require('ol.style.Style'); import _ol_style_Style_ from '../src/ol/style/Style.js';
var raster = new ol.layer.Tile({ var raster = new _ol_layer_Tile_({
source: new ol.source.OSM() source: new _ol_source_OSM_()
}); });
var source = new ol.source.Vector(); var source = new _ol_source_Vector_();
var styleFunction = function(feature) { var styleFunction = function(feature) {
var geometry = feature.getGeometry(); var geometry = feature.getGeometry();
var styles = [ var styles = [
// linestring // linestring
new ol.style.Style({ new _ol_style_Style_({
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
color: '#ffcc33', color: '#ffcc33',
width: 2 width: 2
}) })
@@ -33,9 +33,9 @@ var styleFunction = function(feature) {
var dy = end[1] - start[1]; var dy = end[1] - start[1];
var rotation = Math.atan2(dy, dx); var rotation = Math.atan2(dy, dx);
// arrows // arrows
styles.push(new ol.style.Style({ styles.push(new _ol_style_Style_({
geometry: new ol.geom.Point(end), geometry: new _ol_geom_Point_(end),
image: new ol.style.Icon({ image: new _ol_style_Icon_({
src: 'data/arrow.png', src: 'data/arrow.png',
anchor: [0.75, 0.5], anchor: [0.75, 0.5],
rotateWithView: true, rotateWithView: true,
@@ -46,21 +46,21 @@ var styleFunction = function(feature) {
return styles; return styles;
}; };
var vector = new ol.layer.Vector({ var vector = new _ol_layer_Vector_({
source: source, source: source,
style: styleFunction style: styleFunction
}); });
var map = new ol.Map({ var map = new _ol_Map_({
layers: [raster, vector], layers: [raster, vector],
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: [-11000000, 4600000], center: [-11000000, 4600000],
zoom: 4 zoom: 4
}) })
}); });
map.addInteraction(new ol.interaction.Draw({ map.addInteraction(new _ol_interaction_Draw_({
source: source, source: source,
type: 'LineString' type: 'LineString'
})); }));

View File

@@ -1,26 +1,26 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.control'); import _ol_control_ from '../src/ol/control.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.source.OSM'); import _ol_source_OSM_ from '../src/ol/source/OSM.js';
var openCycleMapLayer = new ol.layer.Tile({ var openCycleMapLayer = new _ol_layer_Tile_({
source: new ol.source.OSM({ source: new _ol_source_OSM_({
attributions: [ attributions: [
'All maps © <a href="https://www.opencyclemap.org/">OpenCycleMap</a>', 'All maps © <a href="https://www.opencyclemap.org/">OpenCycleMap</a>',
ol.source.OSM.ATTRIBUTION _ol_source_OSM_.ATTRIBUTION
], ],
url: 'https://{a-c}.tile.thunderforest.com/cycle/{z}/{x}/{y}.png' + url: 'https://{a-c}.tile.thunderforest.com/cycle/{z}/{x}/{y}.png' +
'?apikey=0e6fc415256d4fbb9b5166a718591d71' '?apikey=0e6fc415256d4fbb9b5166a718591d71'
}) })
}); });
var openSeaMapLayer = new ol.layer.Tile({ var openSeaMapLayer = new _ol_layer_Tile_({
source: new ol.source.OSM({ source: new _ol_source_OSM_({
attributions: [ attributions: [
'All maps © <a href="http://www.openseamap.org/">OpenSeaMap</a>', 'All maps © <a href="http://www.openseamap.org/">OpenSeaMap</a>',
ol.source.OSM.ATTRIBUTION _ol_source_OSM_.ATTRIBUTION
], ],
opaque: false, opaque: false,
url: 'https://tiles.openseamap.org/seamark/{z}/{x}/{y}.png' url: 'https://tiles.openseamap.org/seamark/{z}/{x}/{y}.png'
@@ -28,18 +28,18 @@ var openSeaMapLayer = new ol.layer.Tile({
}); });
var map = new ol.Map({ var map = new _ol_Map_({
layers: [ layers: [
openCycleMapLayer, openCycleMapLayer,
openSeaMapLayer openSeaMapLayer
], ],
target: 'map', target: 'map',
controls: ol.control.defaults({ controls: _ol_control_.defaults({
attributionOptions: { attributionOptions: {
collapsible: false collapsible: false
} }
}), }),
view: new ol.View({ view: new _ol_View_({
maxZoom: 18, maxZoom: 18,
center: [-244780.24508882355, 5986452.183179816], center: [-244780.24508882355, 5986452.183179816],
zoom: 15 zoom: 15

View File

@@ -1,22 +1,22 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.proj'); import _ol_proj_ from '../src/ol/proj.js';
goog.require('ol.source.BingMaps'); import _ol_source_BingMaps_ from '../src/ol/source/BingMaps.js';
var key = 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5'; var key = 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5';
var imagery = new ol.layer.Tile({ 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 container = document.getElementById('map');
var map = new ol.Map({ var map = new _ol_Map_({
layers: [imagery], layers: [imagery],
target: container, 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
}) })
}); });

View File

@@ -1,15 +1,15 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.format.MVT'); import _ol_format_MVT_ from '../src/ol/format/MVT.js';
goog.require('ol.layer.VectorTile'); import _ol_layer_VectorTile_ from '../src/ol/layer/VectorTile.js';
goog.require('ol.proj'); import _ol_proj_ from '../src/ol/proj.js';
goog.require('ol.source.VectorTile'); import _ol_source_VectorTile_ from '../src/ol/source/VectorTile.js';
goog.require('ol.style.Fill'); import _ol_style_Fill_ from '../src/ol/style/Fill.js';
goog.require('ol.style.Icon'); import _ol_style_Icon_ from '../src/ol/style/Icon.js';
goog.require('ol.style.Stroke'); import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
goog.require('ol.style.Style'); import _ol_style_Style_ from '../src/ol/style/Style.js';
goog.require('ol.style.Text'); import _ol_style_Text_ from '../src/ol/style/Text.js';
goog.require('ol.tilegrid.TileGrid'); import _ol_tilegrid_TileGrid_ from '../src/ol/tilegrid/TileGrid.js';
var key = 'pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiRk1kMWZaSSJ9.E5BkluenyWQMsBLsuByrmg'; var key = 'pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiRk1kMWZaSSJ9.E5BkluenyWQMsBLsuByrmg';
@@ -30,26 +30,26 @@ function tileUrlFunction(tileCoord) {
((tileCoord[1] << tileCoord[0]) + tileCoord[2]) % 4, 1)); ((tileCoord[1] << tileCoord[0]) + tileCoord[2]) % 4, 1));
} }
var map = new ol.Map({ var map = new _ol_Map_({
layers: [ layers: [
new ol.layer.VectorTile({ new _ol_layer_VectorTile_({
source: new ol.source.VectorTile({ source: new _ol_source_VectorTile_({
attributions: '© <a href="https://www.mapbox.com/map-feedback/">Mapbox</a> ' + attributions: '© <a href="https://www.mapbox.com/map-feedback/">Mapbox</a> ' +
'© <a href="https://www.openstreetmap.org/copyright">' + '© <a href="https://www.openstreetmap.org/copyright">' +
'OpenStreetMap contributors</a>', 'OpenStreetMap contributors</a>',
format: new ol.format.MVT(), format: new _ol_format_MVT_(),
tileGrid: new ol.tilegrid.TileGrid({ tileGrid: new _ol_tilegrid_TileGrid_({
extent: ol.proj.get('EPSG:3857').getExtent(), extent: _ol_proj_.get('EPSG:3857').getExtent(),
resolutions: resolutions, resolutions: resolutions,
tileSize: 512 tileSize: 512
}), }),
tileUrlFunction: tileUrlFunction tileUrlFunction: tileUrlFunction
}), }),
style: createMapboxStreetsV6Style(ol.style.Style, ol.style.Fill, ol.style.Stroke, ol.style.Icon, ol.style.Text) style: createMapboxStreetsV6Style(_ol_style_Style_, _ol_style_Fill_, _ol_style_Stroke_, _ol_style_Icon_, _ol_style_Text_)
}) })
], ],
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: [0, 0], center: [0, 0],
minZoom: 1, minZoom: 1,
zoom: 2 zoom: 2

View File

@@ -1,34 +1,34 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.format.MVT'); import _ol_format_MVT_ from '../src/ol/format/MVT.js';
goog.require('ol.layer.VectorTile'); import _ol_layer_VectorTile_ from '../src/ol/layer/VectorTile.js';
goog.require('ol.source.VectorTile'); import _ol_source_VectorTile_ from '../src/ol/source/VectorTile.js';
goog.require('ol.style.Fill'); import _ol_style_Fill_ from '../src/ol/style/Fill.js';
goog.require('ol.style.Icon'); import _ol_style_Icon_ from '../src/ol/style/Icon.js';
goog.require('ol.style.Stroke'); import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
goog.require('ol.style.Style'); import _ol_style_Style_ from '../src/ol/style/Style.js';
goog.require('ol.style.Text'); import _ol_style_Text_ from '../src/ol/style/Text.js';
var key = 'pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiRk1kMWZaSSJ9.E5BkluenyWQMsBLsuByrmg'; var key = 'pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiRk1kMWZaSSJ9.E5BkluenyWQMsBLsuByrmg';
var map = new ol.Map({ var map = new _ol_Map_({
layers: [ layers: [
new ol.layer.VectorTile({ new _ol_layer_VectorTile_({
declutter: true, declutter: true,
source: new ol.source.VectorTile({ source: new _ol_source_VectorTile_({
attributions: '© <a href="https://www.mapbox.com/map-feedback/">Mapbox</a> ' + attributions: '© <a href="https://www.mapbox.com/map-feedback/">Mapbox</a> ' +
'© <a href="https://www.openstreetmap.org/copyright">' + '© <a href="https://www.openstreetmap.org/copyright">' +
'OpenStreetMap contributors</a>', 'OpenStreetMap contributors</a>',
format: new ol.format.MVT(), format: new _ol_format_MVT_(),
url: 'https://{a-d}.tiles.mapbox.com/v4/mapbox.mapbox-streets-v6/' + url: 'https://{a-d}.tiles.mapbox.com/v4/mapbox.mapbox-streets-v6/' +
'{z}/{x}/{y}.vector.pbf?access_token=' + key '{z}/{x}/{y}.vector.pbf?access_token=' + key
}), }),
style: createMapboxStreetsV6Style(ol.style.Style, ol.style.Fill, ol.style.Stroke, ol.style.Icon, ol.style.Text) style: createMapboxStreetsV6Style(_ol_style_Style_, _ol_style_Fill_, _ol_style_Stroke_, _ol_style_Icon_, _ol_style_Text_)
}) })
], ],
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: [0, 0], center: [0, 0],
zoom: 2 zoom: 2
}) })

View File

@@ -1,7 +1,7 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.layer.Image'); import _ol_layer_Image_ from '../src/ol/layer/Image.js';
goog.require('ol.source.ImageMapGuide'); import _ol_source_ImageMapGuide_ from '../src/ol/source/ImageMapGuide.js';
var mdf = 'Library://Public/Samples/Sheboygan/Maps/Sheboygan.MapDefinition'; var mdf = 'Library://Public/Samples/Sheboygan/Maps/Sheboygan.MapDefinition';
var agentUrl = var agentUrl =
@@ -12,11 +12,11 @@ var bounds = [
-87.595394059497067, -87.595394059497067,
43.823852564430069 43.823852564430069
]; ];
var map = new ol.Map({ var map = new _ol_Map_({
layers: [ layers: [
new ol.layer.Image({ new _ol_layer_Image_({
extent: bounds, extent: bounds,
source: new ol.source.ImageMapGuide({ source: new _ol_source_ImageMapGuide_({
projection: 'EPSG:4326', projection: 'EPSG:4326',
url: agentUrl, url: agentUrl,
useOverlay: false, useOverlay: false,
@@ -32,7 +32,7 @@ var map = new ol.Map({
}) })
], ],
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: [-87.7302542509315, 43.744459064634], center: [-87.7302542509315, 43.744459064634],
projection: 'EPSG:4326', projection: 'EPSG:4326',
zoom: 12 zoom: 12

View File

@@ -1,40 +1,40 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.Observable'); import _ol_Observable_ from '../src/ol/Observable.js';
goog.require('ol.Overlay'); import _ol_Overlay_ from '../src/ol/Overlay.js';
goog.require('ol.Sphere'); import _ol_Sphere_ from '../src/ol/Sphere.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.geom.LineString'); import _ol_geom_LineString_ from '../src/ol/geom/LineString.js';
goog.require('ol.geom.Polygon'); import _ol_geom_Polygon_ from '../src/ol/geom/Polygon.js';
goog.require('ol.interaction.Draw'); import _ol_interaction_Draw_ from '../src/ol/interaction/Draw.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.layer.Vector'); import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
goog.require('ol.source.OSM'); import _ol_source_OSM_ from '../src/ol/source/OSM.js';
goog.require('ol.source.Vector'); import _ol_source_Vector_ from '../src/ol/source/Vector.js';
goog.require('ol.style.Circle'); import _ol_style_Circle_ from '../src/ol/style/Circle.js';
goog.require('ol.style.Fill'); import _ol_style_Fill_ from '../src/ol/style/Fill.js';
goog.require('ol.style.Stroke'); import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
goog.require('ol.style.Style'); import _ol_style_Style_ from '../src/ol/style/Style.js';
var raster = new ol.layer.Tile({ var raster = new _ol_layer_Tile_({
source: new ol.source.OSM() source: new _ol_source_OSM_()
}); });
var source = new ol.source.Vector(); var source = new _ol_source_Vector_();
var vector = new ol.layer.Vector({ var vector = new _ol_layer_Vector_({
source: source, source: source,
style: new ol.style.Style({ style: new _ol_style_Style_({
fill: new ol.style.Fill({ fill: new _ol_style_Fill_({
color: 'rgba(255, 255, 255, 0.2)' color: 'rgba(255, 255, 255, 0.2)'
}), }),
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
color: '#ffcc33', color: '#ffcc33',
width: 2 width: 2
}), }),
image: new ol.style.Circle({ image: new _ol_style_Circle_({
radius: 7, radius: 7,
fill: new ol.style.Fill({ fill: new _ol_style_Fill_({
color: '#ffcc33' color: '#ffcc33'
}) })
}) })
@@ -104,9 +104,9 @@ var pointerMoveHandler = function(evt) {
if (sketch) { if (sketch) {
var geom = (sketch.getGeometry()); var geom = (sketch.getGeometry());
if (geom instanceof ol.geom.Polygon) { if (geom instanceof _ol_geom_Polygon_) {
helpMsg = continuePolygonMsg; helpMsg = continuePolygonMsg;
} else if (geom instanceof ol.geom.LineString) { } else if (geom instanceof _ol_geom_LineString_) {
helpMsg = continueLineMsg; helpMsg = continueLineMsg;
} }
} }
@@ -118,10 +118,10 @@ var pointerMoveHandler = function(evt) {
}; };
var map = new ol.Map({ var map = new _ol_Map_({
layers: [raster, vector], layers: [raster, vector],
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: [-11000000, 4600000], center: [-11000000, 4600000],
zoom: 15 zoom: 15
}) })
@@ -144,7 +144,7 @@ var draw; // global so we can remove it later
* @return {string} The formatted length. * @return {string} The formatted length.
*/ */
var formatLength = function(line) { var formatLength = function(line) {
var length = ol.Sphere.getLength(line); var length = _ol_Sphere_.getLength(line);
var output; var output;
if (length > 100) { if (length > 100) {
output = (Math.round(length / 1000 * 100) / 100) + output = (Math.round(length / 1000 * 100) / 100) +
@@ -163,7 +163,7 @@ var formatLength = function(line) {
* @return {string} Formatted area. * @return {string} Formatted area.
*/ */
var formatArea = function(polygon) { var formatArea = function(polygon) {
var area = ol.Sphere.getArea(polygon); var area = _ol_Sphere_.getArea(polygon);
var output; var output;
if (area > 10000) { if (area > 10000) {
output = (Math.round(area / 1000000 * 100) / 100) + output = (Math.round(area / 1000000 * 100) / 100) +
@@ -177,24 +177,24 @@ var formatArea = function(polygon) {
function addInteraction() { function addInteraction() {
var type = (typeSelect.value == 'area' ? 'Polygon' : 'LineString'); var type = (typeSelect.value == 'area' ? 'Polygon' : 'LineString');
draw = new ol.interaction.Draw({ draw = new _ol_interaction_Draw_({
source: source, source: source,
type: type, type: type,
style: new ol.style.Style({ style: new _ol_style_Style_({
fill: new ol.style.Fill({ fill: new _ol_style_Fill_({
color: 'rgba(255, 255, 255, 0.2)' color: 'rgba(255, 255, 255, 0.2)'
}), }),
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
color: 'rgba(0, 0, 0, 0.5)', color: 'rgba(0, 0, 0, 0.5)',
lineDash: [10, 10], lineDash: [10, 10],
width: 2 width: 2
}), }),
image: new ol.style.Circle({ image: new _ol_style_Circle_({
radius: 5, radius: 5,
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
color: 'rgba(0, 0, 0, 0.7)' color: 'rgba(0, 0, 0, 0.7)'
}), }),
fill: new ol.style.Fill({ fill: new _ol_style_Fill_({
color: 'rgba(255, 255, 255, 0.2)' color: 'rgba(255, 255, 255, 0.2)'
}) })
}) })
@@ -217,10 +217,10 @@ function addInteraction() {
listener = sketch.getGeometry().on('change', function(evt) { listener = sketch.getGeometry().on('change', function(evt) {
var geom = evt.target; var geom = evt.target;
var output; var output;
if (geom instanceof ol.geom.Polygon) { if (geom instanceof _ol_geom_Polygon_) {
output = formatArea(geom); output = formatArea(geom);
tooltipCoord = geom.getInteriorPoint().getCoordinates(); tooltipCoord = geom.getInteriorPoint().getCoordinates();
} else if (geom instanceof ol.geom.LineString) { } else if (geom instanceof _ol_geom_LineString_) {
output = formatLength(geom); output = formatLength(geom);
tooltipCoord = geom.getLastCoordinate(); tooltipCoord = geom.getLastCoordinate();
} }
@@ -238,7 +238,7 @@ function addInteraction() {
// unset tooltip so that a new one can be created // unset tooltip so that a new one can be created
measureTooltipElement = null; measureTooltipElement = null;
createMeasureTooltip(); createMeasureTooltip();
ol.Observable.unByKey(listener); _ol_Observable_.unByKey(listener);
}, this); }, this);
} }
@@ -252,7 +252,7 @@ function createHelpTooltip() {
} }
helpTooltipElement = document.createElement('div'); helpTooltipElement = document.createElement('div');
helpTooltipElement.className = 'tooltip hidden'; helpTooltipElement.className = 'tooltip hidden';
helpTooltip = new ol.Overlay({ helpTooltip = new _ol_Overlay_({
element: helpTooltipElement, element: helpTooltipElement,
offset: [15, 0], offset: [15, 0],
positioning: 'center-left' positioning: 'center-left'
@@ -270,7 +270,7 @@ function createMeasureTooltip() {
} }
measureTooltipElement = document.createElement('div'); measureTooltipElement = document.createElement('div');
measureTooltipElement.className = 'tooltip tooltip-measure'; measureTooltipElement.className = 'tooltip tooltip-measure';
measureTooltip = new ol.Overlay({ measureTooltip = new _ol_Overlay_({
element: measureTooltipElement, element: measureTooltipElement,
offset: [0, -15], offset: [0, -15],
positioning: 'bottom-center' positioning: 'bottom-center'

View File

@@ -1,23 +1,23 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.control'); import _ol_control_ from '../src/ol/control.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.source.OSM'); import _ol_source_OSM_ from '../src/ol/source/OSM.js';
goog.require('ol.source.TileJSON'); import _ol_source_TileJSON_ from '../src/ol/source/TileJSON.js';
/** /**
* Create the map. * Create the map.
*/ */
var map = new ol.Map({ var map = new _ol_Map_({
layers: [ layers: [
new ol.layer.Tile({ new _ol_layer_Tile_({
source: new ol.source.OSM(), source: new _ol_source_OSM_(),
minResolution: 200, minResolution: 200,
maxResolution: 2000 maxResolution: 2000
}), }),
new ol.layer.Tile({ new _ol_layer_Tile_({
source: new ol.source.TileJSON({ source: new _ol_source_TileJSON_({
url: 'https://api.tiles.mapbox.com/v3/mapbox.natural-earth-hypso-bathy.json?secure', url: 'https://api.tiles.mapbox.com/v3/mapbox.natural-earth-hypso-bathy.json?secure',
crossOrigin: 'anonymous' crossOrigin: 'anonymous'
}), }),
@@ -26,12 +26,12 @@ var map = new ol.Map({
}) })
], ],
target: 'map', target: 'map',
controls: ol.control.defaults({ controls: _ol_control_.defaults({
attributionOptions: { attributionOptions: {
collapsible: false collapsible: false
} }
}), }),
view: new ol.View({ view: new _ol_View_({
center: [653600, 5723680], center: [653600, 5723680],
zoom: 5 zoom: 5
}) })

View File

@@ -1,7 +1,7 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.source.OSM'); import _ol_source_OSM_ from '../src/ol/source/OSM.js';
var viewport = document.getElementById('map'); var viewport = document.getElementById('map');
@@ -12,16 +12,16 @@ function getMinZoom() {
var initialZoom = getMinZoom(); var initialZoom = getMinZoom();
var view = new ol.View({ var view = new _ol_View_({
center: [0, 0], center: [0, 0],
minZoom: initialZoom, minZoom: initialZoom,
zoom: initialZoom zoom: initialZoom
}); });
var map = new ol.Map({ var map = new _ol_Map_({
layers: [ layers: [
new ol.layer.Tile({ new _ol_layer_Tile_({
source: new ol.source.OSM() source: new _ol_source_OSM_()
}) })
], ],
target: 'map', target: 'map',

View File

@@ -1,19 +1,19 @@
goog.require('ol.Geolocation'); import _ol_Geolocation_ from '../src/ol/Geolocation.js';
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.source.BingMaps'); import _ol_source_BingMaps_ from '../src/ol/source/BingMaps.js';
var view = new ol.View({ var view = new _ol_View_({
center: [0, 0], center: [0, 0],
zoom: 2 zoom: 2
}); });
var map = new ol.Map({ var map = new _ol_Map_({
layers: [ layers: [
new ol.layer.Tile({ new _ol_layer_Tile_({
source: new ol.source.BingMaps({ source: new _ol_source_BingMaps_({
key: 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5', key: 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5',
imagerySet: 'Road' imagerySet: 'Road'
}) })
@@ -23,7 +23,7 @@ var map = new ol.Map({
view: view view: view
}); });
var geolocation = new ol.Geolocation({ var geolocation = new _ol_Geolocation_({
projection: view.getProjection(), projection: view.getProjection(),
tracking: true tracking: true
}); });

View File

@@ -1,40 +1,40 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.format.GeoJSON'); import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js';
goog.require('ol.interaction'); import _ol_interaction_ from '../src/ol/interaction.js';
goog.require('ol.interaction.Modify'); import _ol_interaction_Modify_ from '../src/ol/interaction/Modify.js';
goog.require('ol.interaction.Select'); import _ol_interaction_Select_ from '../src/ol/interaction/Select.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.layer.Vector'); import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
goog.require('ol.source.OSM'); import _ol_source_OSM_ from '../src/ol/source/OSM.js';
goog.require('ol.source.Vector'); import _ol_source_Vector_ from '../src/ol/source/Vector.js';
var raster = new ol.layer.Tile({ var raster = new _ol_layer_Tile_({
source: new ol.source.OSM() source: new _ol_source_OSM_()
}); });
var vector = new ol.layer.Vector({ var vector = new _ol_layer_Vector_({
source: new ol.source.Vector({ source: new _ol_source_Vector_({
url: 'data/geojson/countries.geojson', url: 'data/geojson/countries.geojson',
format: new ol.format.GeoJSON(), format: new _ol_format_GeoJSON_(),
wrapX: false wrapX: false
}) })
}); });
var select = new ol.interaction.Select({ var select = new _ol_interaction_Select_({
wrapX: false wrapX: false
}); });
var modify = new ol.interaction.Modify({ var modify = new _ol_interaction_Modify_({
features: select.getFeatures() features: select.getFeatures()
}); });
var map = new ol.Map({ var map = new _ol_Map_({
interactions: ol.interaction.defaults().extend([select, modify]), interactions: _ol_interaction_.defaults().extend([select, modify]),
layers: [raster, vector], layers: [raster, vector],
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: [0, 0], center: [0, 0],
zoom: 2 zoom: 2
}) })

View File

@@ -1,55 +1,55 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.format.GeoJSON'); import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js';
goog.require('ol.interaction'); import _ol_interaction_ from '../src/ol/interaction.js';
goog.require('ol.interaction.Modify'); import _ol_interaction_Modify_ from '../src/ol/interaction/Modify.js';
goog.require('ol.interaction.Select'); import _ol_interaction_Select_ from '../src/ol/interaction/Select.js';
goog.require('ol.layer.Vector'); import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
goog.require('ol.source.Vector'); import _ol_source_Vector_ from '../src/ol/source/Vector.js';
goog.require('ol.style.Circle'); import _ol_style_Circle_ from '../src/ol/style/Circle.js';
goog.require('ol.style.Fill'); import _ol_style_Fill_ from '../src/ol/style/Fill.js';
goog.require('ol.style.Stroke'); import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
goog.require('ol.style.Style'); import _ol_style_Style_ from '../src/ol/style/Style.js';
var styleFunction = (function() { var styleFunction = (function() {
var styles = {}; var styles = {};
var image = new ol.style.Circle({ var image = new _ol_style_Circle_({
radius: 5, radius: 5,
fill: null, fill: null,
stroke: new ol.style.Stroke({color: 'orange', width: 2}) stroke: new _ol_style_Stroke_({color: 'orange', width: 2})
}); });
styles['Point'] = new ol.style.Style({image: image}); styles['Point'] = new _ol_style_Style_({image: image});
styles['Polygon'] = new ol.style.Style({ styles['Polygon'] = new _ol_style_Style_({
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
color: 'blue', color: 'blue',
width: 3 width: 3
}), }),
fill: new ol.style.Fill({ fill: new _ol_style_Fill_({
color: 'rgba(0, 0, 255, 0.1)' color: 'rgba(0, 0, 255, 0.1)'
}) })
}); });
styles['MultiLineString'] = new ol.style.Style({ styles['MultiLineString'] = new _ol_style_Style_({
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
color: 'green', color: 'green',
width: 3 width: 3
}) })
}); });
styles['MultiPolygon'] = new ol.style.Style({ styles['MultiPolygon'] = new _ol_style_Style_({
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
color: 'yellow', color: 'yellow',
width: 1 width: 1
}), }),
fill: new ol.style.Fill({ fill: new _ol_style_Fill_({
color: 'rgba(255, 255, 0, 0.1)' color: 'rgba(255, 255, 0, 0.1)'
}) })
}); });
styles['default'] = new ol.style.Style({ styles['default'] = new _ol_style_Style_({
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
color: 'red', color: 'red',
width: 3 width: 3
}), }),
fill: new ol.style.Fill({ fill: new _ol_style_Fill_({
color: 'rgba(255, 0, 0, 0.1)' color: 'rgba(255, 0, 0, 0.1)'
}), }),
image: image image: image
@@ -144,11 +144,11 @@ var geojsonObject = {
}] }]
}; };
var source = new ol.source.Vector({ var source = new _ol_source_Vector_({
features: (new ol.format.GeoJSON()).readFeatures(geojsonObject) features: (new _ol_format_GeoJSON_()).readFeatures(geojsonObject)
}); });
var layer = new ol.layer.Vector({ var layer = new _ol_layer_Vector_({
source: source, source: source,
style: styleFunction style: styleFunction
}); });
@@ -156,19 +156,19 @@ var layer = new ol.layer.Vector({
var overlayStyle = (function() { var overlayStyle = (function() {
var styles = {}; var styles = {};
styles['Polygon'] = [ styles['Polygon'] = [
new ol.style.Style({ new _ol_style_Style_({
fill: new ol.style.Fill({ fill: new _ol_style_Fill_({
color: [255, 255, 255, 0.5] color: [255, 255, 255, 0.5]
}) })
}), }),
new ol.style.Style({ new _ol_style_Style_({
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
color: [255, 255, 255, 1], color: [255, 255, 255, 1],
width: 5 width: 5
}) })
}), }),
new ol.style.Style({ new _ol_style_Style_({
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
color: [0, 153, 255, 1], color: [0, 153, 255, 1],
width: 3 width: 3
}) })
@@ -177,14 +177,14 @@ var overlayStyle = (function() {
styles['MultiPolygon'] = styles['Polygon']; styles['MultiPolygon'] = styles['Polygon'];
styles['LineString'] = [ styles['LineString'] = [
new ol.style.Style({ new _ol_style_Style_({
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
color: [255, 255, 255, 1], color: [255, 255, 255, 1],
width: 5 width: 5
}) })
}), }),
new ol.style.Style({ new _ol_style_Style_({
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
color: [0, 153, 255, 1], color: [0, 153, 255, 1],
width: 3 width: 3
}) })
@@ -193,13 +193,13 @@ var overlayStyle = (function() {
styles['MultiLineString'] = styles['LineString']; styles['MultiLineString'] = styles['LineString'];
styles['Point'] = [ styles['Point'] = [
new ol.style.Style({ new _ol_style_Style_({
image: new ol.style.Circle({ image: new _ol_style_Circle_({
radius: 7, radius: 7,
fill: new ol.style.Fill({ fill: new _ol_style_Fill_({
color: [0, 153, 255, 1] color: [0, 153, 255, 1]
}), }),
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
color: [255, 255, 255, 0.75], color: [255, 255, 255, 0.75],
width: 1.5 width: 1.5
}) })
@@ -216,11 +216,11 @@ var overlayStyle = (function() {
}; };
})(); })();
var select = new ol.interaction.Select({ var select = new _ol_interaction_Select_({
style: overlayStyle style: overlayStyle
}); });
var modify = new ol.interaction.Modify({ var modify = new _ol_interaction_Modify_({
features: select.getFeatures(), features: select.getFeatures(),
style: overlayStyle, style: overlayStyle,
insertVertexCondition: function() { insertVertexCondition: function() {
@@ -231,11 +231,11 @@ var modify = new ol.interaction.Modify({
} }
}); });
var map = new ol.Map({ var map = new _ol_Map_({
interactions: ol.interaction.defaults().extend([select, modify]), interactions: _ol_interaction_.defaults().extend([select, modify]),
layers: [layer], layers: [layer],
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: [0, 1000000], center: [0, 1000000],
zoom: 2 zoom: 2
}) })

View File

@@ -1,13 +1,13 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.control'); import _ol_control_ from '../src/ol/control.js';
goog.require('ol.control.MousePosition'); import _ol_control_MousePosition_ from '../src/ol/control/MousePosition.js';
goog.require('ol.coordinate'); import _ol_coordinate_ from '../src/ol/coordinate.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.source.OSM'); import _ol_source_OSM_ from '../src/ol/source/OSM.js';
var mousePositionControl = new ol.control.MousePosition({ var mousePositionControl = new _ol_control_MousePosition_({
coordinateFormat: ol.coordinate.createStringXY(4), coordinateFormat: _ol_coordinate_.createStringXY(4),
projection: 'EPSG:4326', projection: 'EPSG:4326',
// comment the following two lines to have the mouse position // comment the following two lines to have the mouse position
// be placed within the map. // be placed within the map.
@@ -16,19 +16,19 @@ var mousePositionControl = new ol.control.MousePosition({
undefinedHTML: '&nbsp;' undefinedHTML: '&nbsp;'
}); });
var map = new ol.Map({ var map = new _ol_Map_({
controls: ol.control.defaults({ controls: _ol_control_.defaults({
attributionOptions: { attributionOptions: {
collapsible: false collapsible: false
} }
}).extend([mousePositionControl]), }).extend([mousePositionControl]),
layers: [ layers: [
new ol.layer.Tile({ new _ol_layer_Tile_({
source: new ol.source.OSM() source: new _ol_source_OSM_()
}) })
], ],
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: [0, 0], center: [0, 0],
zoom: 2 zoom: 2
}) })
@@ -41,6 +41,6 @@ projectionSelect.addEventListener('change', function(event) {
var precisionInput = document.getElementById('precision'); var precisionInput = document.getElementById('precision');
precisionInput.addEventListener('change', function(event) { precisionInput.addEventListener('change', function(event) {
var format = ol.coordinate.createStringXY(event.target.valueAsNumber); var format = _ol_coordinate_.createStringXY(event.target.valueAsNumber);
mousePositionControl.setCoordinateFormat(format); mousePositionControl.setCoordinateFormat(format);
}); });

View File

@@ -1,24 +1,24 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.interaction'); import _ol_interaction_ from '../src/ol/interaction.js';
goog.require('ol.interaction.MouseWheelZoom'); import _ol_interaction_MouseWheelZoom_ from '../src/ol/interaction/MouseWheelZoom.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.source.OSM'); import _ol_source_OSM_ from '../src/ol/source/OSM.js';
var map = new ol.Map({ var map = new _ol_Map_({
interactions: ol.interaction.defaults({mouseWheelZoom: false}).extend([ interactions: _ol_interaction_.defaults({mouseWheelZoom: false}).extend([
new ol.interaction.MouseWheelZoom({ new _ol_interaction_MouseWheelZoom_({
constrainResolution: true // force zooming to a integer zoom constrainResolution: true // force zooming to a integer zoom
}) })
]), ]),
layers: [ layers: [
new ol.layer.Tile({ new _ol_layer_Tile_({
source: new ol.source.OSM() source: new _ol_source_OSM_()
}) })
], ],
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: [0, 0], center: [0, 0],
zoom: 2 zoom: 2
}) })

View File

@@ -1,25 +1,25 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.control'); import _ol_control_ from '../src/ol/control.js';
goog.require('ol.extent'); import _ol_extent_ from '../src/ol/extent.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.proj'); import _ol_proj_ from '../src/ol/proj.js';
goog.require('ol.source.OSM'); import _ol_source_OSM_ from '../src/ol/source/OSM.js';
var map = new ol.Map({ var map = new _ol_Map_({
layers: [ layers: [
new ol.layer.Tile({ new _ol_layer_Tile_({
source: new ol.source.OSM() source: new _ol_source_OSM_()
}) })
], ],
target: 'map', target: 'map',
controls: ol.control.defaults({ controls: _ol_control_.defaults({
attributionOptions: { attributionOptions: {
collapsible: false collapsible: false
} }
}), }),
view: new ol.View({ view: new _ol_View_({
center: [0, 0], center: [0, 0],
zoom: 2 zoom: 2
}) })
@@ -37,9 +37,9 @@ function wrapLon(value) {
function onMoveEnd(evt) { function onMoveEnd(evt) {
var map = evt.map; var map = evt.map;
var extent = map.getView().calculateExtent(map.getSize()); var extent = map.getView().calculateExtent(map.getSize());
var bottomLeft = ol.proj.transform(ol.extent.getBottomLeft(extent), var bottomLeft = _ol_proj_.transform(_ol_extent_.getBottomLeft(extent),
'EPSG:3857', 'EPSG:4326'); 'EPSG:3857', 'EPSG:4326');
var topRight = ol.proj.transform(ol.extent.getTopRight(extent), var topRight = _ol_proj_.transform(_ol_extent_.getTopRight(extent),
'EPSG:3857', 'EPSG:4326'); 'EPSG:3857', 'EPSG:4326');
display('left', wrapLon(bottomLeft[0])); display('left', wrapLon(bottomLeft[0]));
display('bottom', bottomLeft[1]); display('bottom', bottomLeft[1]);

View File

@@ -1,18 +1,18 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.control'); import _ol_control_ from '../src/ol/control.js';
goog.require('ol.control.ZoomToExtent'); import _ol_control_ZoomToExtent_ from '../src/ol/control/ZoomToExtent.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.source.OSM'); import _ol_source_OSM_ from '../src/ol/source/OSM.js';
var map = new ol.Map({ var map = new _ol_Map_({
controls: ol.control.defaults({ controls: _ol_control_.defaults({
attributionOptions: { attributionOptions: {
collapsible: false collapsible: false
} }
}).extend([ }).extend([
new ol.control.ZoomToExtent({ new _ol_control_ZoomToExtent_({
extent: [ extent: [
813079.7791264898, 5929220.284081122, 813079.7791264898, 5929220.284081122,
848966.9639063801, 5936863.986909639 848966.9639063801, 5936863.986909639
@@ -20,12 +20,12 @@ var map = new ol.Map({
}) })
]), ]),
layers: [ layers: [
new ol.layer.Tile({ new _ol_layer_Tile_({
source: new ol.source.OSM() source: new _ol_source_OSM_()
}) })
], ],
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: [0, 0], center: [0, 0],
zoom: 2 zoom: 2
}) })

View File

@@ -1,12 +1,12 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.format.TopoJSON'); import _ol_format_TopoJSON_ from '../src/ol/format/TopoJSON.js';
goog.require('ol.layer.VectorTile'); import _ol_layer_VectorTile_ from '../src/ol/layer/VectorTile.js';
goog.require('ol.proj'); import _ol_proj_ from '../src/ol/proj.js';
goog.require('ol.source.VectorTile'); import _ol_source_VectorTile_ from '../src/ol/source/VectorTile.js';
goog.require('ol.style.Fill'); import _ol_style_Fill_ from '../src/ol/style/Fill.js';
goog.require('ol.style.Stroke'); import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
goog.require('ol.style.Style'); import _ol_style_Style_ from '../src/ol/style/Style.js';
var key = 'vector-tiles-5eJz6JX'; var key = 'vector-tiles-5eJz6JX';
@@ -16,18 +16,18 @@ var roadColor = {
'minor_road': '#ccb', 'minor_road': '#ccb',
'highway': '#f39' 'highway': '#f39'
}; };
var buildingStyle = new ol.style.Style({ var buildingStyle = new _ol_style_Style_({
fill: new ol.style.Fill({ fill: new _ol_style_Fill_({
color: '#666', color: '#666',
opacity: 0.4 opacity: 0.4
}), }),
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
color: '#444', color: '#444',
width: 1 width: 1
}) })
}); });
var waterStyle = new ol.style.Style({ var waterStyle = new _ol_style_Style_({
fill: new ol.style.Fill({ fill: new _ol_style_Fill_({
color: '#9db9e8' color: '#9db9e8'
}) })
}); });
@@ -46,8 +46,8 @@ var roadStyle = function(feature) {
color = roadColor[kind]; color = roadColor[kind];
width = kind == 'highway' ? 1.5 : 1; width = kind == 'highway' ? 1.5 : 1;
} }
style = new ol.style.Style({ style = new _ol_style_Style_({
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
color: color, color: color,
width: width width: width
}), }),
@@ -58,13 +58,13 @@ var roadStyle = function(feature) {
return style; return style;
}; };
var map = new ol.Map({ var map = new _ol_Map_({
layers: [ layers: [
new ol.layer.VectorTile({ new _ol_layer_VectorTile_({
source: new ol.source.VectorTile({ source: new _ol_source_VectorTile_({
attributions: '&copy; OpenStreetMap contributors, Whos On First, ' + attributions: '&copy; OpenStreetMap contributors, Whos On First, ' +
'Natural Earth, and openstreetmapdata.com', 'Natural Earth, and openstreetmapdata.com',
format: new ol.format.TopoJSON({ format: new _ol_format_TopoJSON_({
layerName: 'layer', layerName: 'layer',
layers: ['water', 'roads', 'buildings'] layers: ['water', 'roads', 'buildings']
}), }),
@@ -82,8 +82,8 @@ var map = new ol.Map({
}) })
], ],
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: ol.proj.fromLonLat([-74.0064, 40.7142]), center: _ol_proj_.fromLonLat([-74.0064, 40.7142]),
maxZoom: 19, maxZoom: 19,
zoom: 15 zoom: 15
}) })

View File

@@ -1,29 +1,29 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.Overlay'); import _ol_Overlay_ from '../src/ol/Overlay.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.coordinate'); import _ol_coordinate_ from '../src/ol/coordinate.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.proj'); import _ol_proj_ from '../src/ol/proj.js';
goog.require('ol.source.OSM'); import _ol_source_OSM_ from '../src/ol/source/OSM.js';
var layer = new ol.layer.Tile({ var layer = new _ol_layer_Tile_({
source: new ol.source.OSM() source: new _ol_source_OSM_()
}); });
var map = new ol.Map({ var map = new _ol_Map_({
layers: [layer], layers: [layer],
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: [0, 0], center: [0, 0],
zoom: 2 zoom: 2
}) })
}); });
var pos = ol.proj.fromLonLat([16.3725, 48.208889]); var pos = _ol_proj_.fromLonLat([16.3725, 48.208889]);
// Vienna marker // Vienna marker
var marker = new ol.Overlay({ var marker = new _ol_Overlay_({
position: pos, position: pos,
positioning: 'center-center', positioning: 'center-center',
element: document.getElementById('marker'), element: document.getElementById('marker'),
@@ -32,14 +32,14 @@ var marker = new ol.Overlay({
map.addOverlay(marker); map.addOverlay(marker);
// Vienna label // Vienna label
var vienna = new ol.Overlay({ var vienna = new _ol_Overlay_({
position: pos, position: pos,
element: document.getElementById('vienna') element: document.getElementById('vienna')
}); });
map.addOverlay(vienna); map.addOverlay(vienna);
// Popup showing the position the user clicked // Popup showing the position the user clicked
var popup = new ol.Overlay({ var popup = new _ol_Overlay_({
element: document.getElementById('popup') element: document.getElementById('popup')
}); });
map.addOverlay(popup); map.addOverlay(popup);
@@ -47,7 +47,7 @@ map.addOverlay(popup);
map.on('click', function(evt) { map.on('click', function(evt) {
var element = popup.getElement(); var element = popup.getElement();
var coordinate = evt.coordinate; var coordinate = evt.coordinate;
var hdms = ol.coordinate.toStringHDMS(ol.proj.transform( var hdms = _ol_coordinate_.toStringHDMS(_ol_proj_.transform(
coordinate, 'EPSG:3857', 'EPSG:4326')); coordinate, 'EPSG:3857', 'EPSG:4326'));
$(element).popover('destroy'); $(element).popover('destroy');

View File

@@ -1,19 +1,19 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.control'); import _ol_control_ from '../src/ol/control.js';
goog.require('ol.control.OverviewMap'); import _ol_control_OverviewMap_ from '../src/ol/control/OverviewMap.js';
goog.require('ol.interaction'); import _ol_interaction_ from '../src/ol/interaction.js';
goog.require('ol.interaction.DragRotateAndZoom'); import _ol_interaction_DragRotateAndZoom_ from '../src/ol/interaction/DragRotateAndZoom.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.source.OSM'); import _ol_source_OSM_ from '../src/ol/source/OSM.js';
var overviewMapControl = new ol.control.OverviewMap({ var overviewMapControl = new _ol_control_OverviewMap_({
// see in overviewmap-custom.html to see the custom CSS used // see in overviewmap-custom.html to see the custom CSS used
className: 'ol-overviewmap ol-custom-overviewmap', className: 'ol-overviewmap ol-custom-overviewmap',
layers: [ layers: [
new ol.layer.Tile({ new _ol_layer_Tile_({
source: new ol.source.OSM({ source: new _ol_source_OSM_({
'url': 'https://{a-c}.tile.thunderforest.com/cycle/{z}/{x}/{y}.png' + 'url': 'https://{a-c}.tile.thunderforest.com/cycle/{z}/{x}/{y}.png' +
'?apikey=0e6fc415256d4fbb9b5166a718591d71' '?apikey=0e6fc415256d4fbb9b5166a718591d71'
}) })
@@ -24,20 +24,20 @@ var overviewMapControl = new ol.control.OverviewMap({
collapsed: false collapsed: false
}); });
var map = new ol.Map({ var map = new _ol_Map_({
controls: ol.control.defaults().extend([ controls: _ol_control_.defaults().extend([
overviewMapControl overviewMapControl
]), ]),
interactions: ol.interaction.defaults().extend([ interactions: _ol_interaction_.defaults().extend([
new ol.interaction.DragRotateAndZoom() new _ol_interaction_DragRotateAndZoom_()
]), ]),
layers: [ layers: [
new ol.layer.Tile({ new _ol_layer_Tile_({
source: new ol.source.OSM() source: new _ol_source_OSM_()
}) })
], ],
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: [500000, 6000000], center: [500000, 6000000],
zoom: 7 zoom: 7
}) })

View File

@@ -1,21 +1,21 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.control'); import _ol_control_ from '../src/ol/control.js';
goog.require('ol.control.OverviewMap'); import _ol_control_OverviewMap_ from '../src/ol/control/OverviewMap.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.source.OSM'); import _ol_source_OSM_ from '../src/ol/source/OSM.js';
var map = new ol.Map({ var map = new _ol_Map_({
controls: ol.control.defaults().extend([ controls: _ol_control_.defaults().extend([
new ol.control.OverviewMap() new _ol_control_OverviewMap_()
]), ]),
layers: [ layers: [
new ol.layer.Tile({ new _ol_layer_Tile_({
source: new ol.source.OSM() source: new _ol_source_OSM_()
}) })
], ],
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: [500000, 6000000], center: [500000, 6000000],
zoom: 7 zoom: 7
}) })

View File

@@ -1,8 +1,8 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.control'); import _ol_control_ from '../src/ol/control.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.source.OSM'); import _ol_source_OSM_ from '../src/ol/source/OSM.js';
// default zoom, center and rotation // default zoom, center and rotation
var zoom = 2; var zoom = 2;
@@ -23,19 +23,19 @@ if (window.location.hash !== '') {
} }
} }
var map = new ol.Map({ var map = new _ol_Map_({
layers: [ layers: [
new ol.layer.Tile({ new _ol_layer_Tile_({
source: new ol.source.OSM() source: new _ol_source_OSM_()
}) })
], ],
controls: ol.control.defaults({ controls: _ol_control_.defaults({
attributionOptions: { attributionOptions: {
collapsible: false collapsible: false
} }
}), }),
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: center, center: center,
zoom: zoom, zoom: zoom,
rotation: rotation rotation: rotation

View File

@@ -1,24 +1,24 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.interaction'); import _ol_interaction_ from '../src/ol/interaction.js';
goog.require('ol.interaction.PinchZoom'); import _ol_interaction_PinchZoom_ from '../src/ol/interaction/PinchZoom.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.source.OSM'); import _ol_source_OSM_ from '../src/ol/source/OSM.js';
var map = new ol.Map({ var map = new _ol_Map_({
interactions: ol.interaction.defaults({pinchZoom: false}).extend([ interactions: _ol_interaction_.defaults({pinchZoom: false}).extend([
new ol.interaction.PinchZoom({ new _ol_interaction_PinchZoom_({
constrainResolution: true // force zooming to a integer zoom constrainResolution: true // force zooming to a integer zoom
}) })
]), ]),
layers: [ layers: [
new ol.layer.Tile({ new _ol_layer_Tile_({
source: new ol.source.OSM() source: new _ol_source_OSM_()
}) })
], ],
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: [0, 0], center: [0, 0],
zoom: 2 zoom: 2
}) })

View File

@@ -1,13 +1,13 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.format.GeoJSON'); import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js';
goog.require('ol.geom.MultiPoint'); import _ol_geom_MultiPoint_ from '../src/ol/geom/MultiPoint.js';
goog.require('ol.layer.Vector'); import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
goog.require('ol.source.Vector'); import _ol_source_Vector_ from '../src/ol/source/Vector.js';
goog.require('ol.style.Circle'); import _ol_style_Circle_ from '../src/ol/style/Circle.js';
goog.require('ol.style.Fill'); import _ol_style_Fill_ from '../src/ol/style/Fill.js';
goog.require('ol.style.Stroke'); import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
goog.require('ol.style.Style'); import _ol_style_Style_ from '../src/ol/style/Style.js';
var styles = [ var styles = [
/* We are using two different styles for the polygons: /* We are using two different styles for the polygons:
@@ -17,26 +17,26 @@ var styles = [
* returned as `MultiPoint` geometry, which will be used to render * returned as `MultiPoint` geometry, which will be used to render
* the style. * the style.
*/ */
new ol.style.Style({ new _ol_style_Style_({
stroke: new ol.style.Stroke({ stroke: new _ol_style_Stroke_({
color: 'blue', color: 'blue',
width: 3 width: 3
}), }),
fill: new ol.style.Fill({ fill: new _ol_style_Fill_({
color: 'rgba(0, 0, 255, 0.1)' color: 'rgba(0, 0, 255, 0.1)'
}) })
}), }),
new ol.style.Style({ new _ol_style_Style_({
image: new ol.style.Circle({ image: new _ol_style_Circle_({
radius: 5, radius: 5,
fill: new ol.style.Fill({ fill: new _ol_style_Fill_({
color: 'orange' color: 'orange'
}) })
}), }),
geometry: function(feature) { geometry: function(feature) {
// return the coordinates of the first ring of the polygon // return the coordinates of the first ring of the polygon
var coordinates = feature.getGeometry().getCoordinates()[0]; var coordinates = feature.getGeometry().getCoordinates()[0];
return new ol.geom.MultiPoint(coordinates); return new _ol_geom_MultiPoint_(coordinates);
} }
}) })
]; ];
@@ -80,19 +80,19 @@ var geojsonObject = {
}] }]
}; };
var source = new ol.source.Vector({ var source = new _ol_source_Vector_({
features: (new ol.format.GeoJSON()).readFeatures(geojsonObject) features: (new _ol_format_GeoJSON_()).readFeatures(geojsonObject)
}); });
var layer = new ol.layer.Vector({ var layer = new _ol_layer_Vector_({
source: source, source: source,
style: styles style: styles
}); });
var map = new ol.Map({ var map = new _ol_Map_({
layers: [layer], layers: [layer],
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: [0, 3000000], center: [0, 3000000],
zoom: 2 zoom: 2
}) })

View File

@@ -1,10 +1,10 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.Overlay'); import _ol_Overlay_ from '../src/ol/Overlay.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.coordinate'); import _ol_coordinate_ from '../src/ol/coordinate.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.proj'); import _ol_proj_ from '../src/ol/proj.js';
goog.require('ol.source.TileJSON'); import _ol_source_TileJSON_ from '../src/ol/source/TileJSON.js';
/** /**
@@ -18,7 +18,7 @@ var closer = document.getElementById('popup-closer');
/** /**
* Create an overlay to anchor the popup to the map. * Create an overlay to anchor the popup to the map.
*/ */
var overlay = new ol.Overlay({ var overlay = new _ol_Overlay_({
element: container, element: container,
autoPan: true, autoPan: true,
autoPanAnimation: { autoPanAnimation: {
@@ -41,10 +41,10 @@ closer.onclick = function() {
/** /**
* Create the map. * Create the map.
*/ */
var map = new ol.Map({ var map = new _ol_Map_({
layers: [ layers: [
new ol.layer.Tile({ new _ol_layer_Tile_({
source: new ol.source.TileJSON({ source: new _ol_source_TileJSON_({
url: 'https://api.tiles.mapbox.com/v3/mapbox.natural-earth-hypso-bathy.json?secure', url: 'https://api.tiles.mapbox.com/v3/mapbox.natural-earth-hypso-bathy.json?secure',
crossOrigin: 'anonymous' crossOrigin: 'anonymous'
}) })
@@ -52,7 +52,7 @@ var map = new ol.Map({
], ],
overlays: [overlay], overlays: [overlay],
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: [0, 0], center: [0, 0],
zoom: 2 zoom: 2
}) })
@@ -64,7 +64,7 @@ var map = new ol.Map({
*/ */
map.on('singleclick', function(evt) { map.on('singleclick', function(evt) {
var coordinate = evt.coordinate; var coordinate = evt.coordinate;
var hdms = ol.coordinate.toStringHDMS(ol.proj.transform( var hdms = _ol_coordinate_.toStringHDMS(_ol_proj_.transform(
coordinate, 'EPSG:3857', 'EPSG:4326')); coordinate, 'EPSG:3857', 'EPSG:4326'));
content.innerHTML = '<p>You clicked here:</p><code>' + hdms + content.innerHTML = '<p>You clicked here:</p><code>' + hdms +

View File

@@ -1,19 +1,19 @@
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.source.BingMaps'); import _ol_source_BingMaps_ from '../src/ol/source/BingMaps.js';
var view = new ol.View({ var view = new _ol_View_({
center: [-4808600, -2620936], center: [-4808600, -2620936],
zoom: 8 zoom: 8
}); });
var map1 = new ol.Map({ var map1 = new _ol_Map_({
layers: [ layers: [
new ol.layer.Tile({ new _ol_layer_Tile_({
preload: Infinity, preload: Infinity,
source: new ol.source.BingMaps({ source: new _ol_source_BingMaps_({
key: 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5', key: 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5',
imagerySet: 'Aerial' imagerySet: 'Aerial'
}) })
@@ -23,11 +23,11 @@ var map1 = new ol.Map({
view: view view: view
}); });
var map2 = new ol.Map({ var map2 = new _ol_Map_({
layers: [ layers: [
new ol.layer.Tile({ new _ol_layer_Tile_({
preload: 0, // default value preload: 0, // default value
source: new ol.source.BingMaps({ source: new _ol_source_BingMaps_({
key: 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5', key: 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5',
imagerySet: 'AerialWithLabels' imagerySet: 'AerialWithLabels'
}) })

View File

@@ -1,11 +1,11 @@
// NOCOMPILE // NOCOMPILE
// this example uses d3 for which we don't have an externs file. // this example uses d3 for which we don't have an externs file.
goog.require('ol.Map'); import _ol_Map_ from '../src/ol/Map.js';
goog.require('ol.View'); import _ol_View_ from '../src/ol/View.js';
goog.require('ol.layer.Image'); import _ol_layer_Image_ from '../src/ol/layer/Image.js';
goog.require('ol.layer.Tile'); import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
goog.require('ol.source.BingMaps'); import _ol_source_BingMaps_ from '../src/ol/source/BingMaps.js';
goog.require('ol.source.Raster'); import _ol_source_Raster_ from '../src/ol/source/Raster.js';
var minVgi = 0; var minVgi = 0;
var maxVgi = 0.25; var maxVgi = 0.25;
@@ -49,7 +49,7 @@ function summarize(value, counts) {
/** /**
* Use aerial imagery as the input data for the raster source. * Use aerial imagery as the input data for the raster source.
*/ */
var bing = new ol.source.BingMaps({ var bing = new _ol_source_BingMaps_({
key: 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5', key: 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5',
imagerySet: 'Aerial' imagerySet: 'Aerial'
}); });
@@ -59,7 +59,7 @@ var bing = new ol.source.BingMaps({
* Create a raster source where pixels with VGI values above a threshold will * Create a raster source where pixels with VGI values above a threshold will
* be colored green. * be colored green.
*/ */
var raster = new ol.source.Raster({ var raster = new _ol_source_Raster_({
sources: [bing], sources: [bing],
/** /**
* Run calculations on pixel data. * Run calculations on pixel data.
@@ -110,17 +110,17 @@ raster.on('afteroperations', function(event) {
schedulePlot(event.resolution, event.data.counts, event.data.threshold); schedulePlot(event.resolution, event.data.counts, event.data.threshold);
}); });
var map = new ol.Map({ var map = new _ol_Map_({
layers: [ layers: [
new ol.layer.Tile({ new _ol_layer_Tile_({
source: bing source: bing
}), }),
new ol.layer.Image({ new _ol_layer_Image_({
source: raster source: raster
}) })
], ],
target: 'map', target: 'map',
view: new ol.View({ view: new _ol_View_({
center: [-9651695, 4937351], center: [-9651695, 4937351],
zoom: 13, zoom: 13,
minZoom: 12, minZoom: 12,

Some files were not shown because too many files have changed in this diff Show More